An Algorithm for Intelligent Home Energy Management and Demand Response Analysis | Synapse