An optimal home energy management system for modulating heat pumps and photovoltaic systems. (15th November 2020)