Home Energy Router for smart consumer grids