Email Record: Energy management in homes and residential microgrids :