System for controlling a demand response of a plurality of electrical heating devices, comprising a plurality of local electrical heating devices, EHDs, a plurality of local thermostatic controllers, LTCs, and a plurality of local energy stores TESs, wherein each electric heating device, EHD, is connected to and controlled by a respective local thermostatic controller, LTC, and is connected to and thermally coupled to an associated local thermal energy store, TES, wherein each local thermal energy store, TES, comprises a temperature sensor for detecting the temperature of the local thermal energy store, TES; a local renewable energy system, RES, generator which provides electricity to each of the plurality of local electrical heating devices, EHDs, via a decentralized electricity microgrid, wherein the decentralized electricity microgrid is electrically connected to an electrical-energy exchange means which is different to the local renewable energy system, RES, generator; a cloud-based supervisory control, CSC, system which is configured to receive information about a degree of import and export of electricity between the electrical-energy exchange means and the local, decentralized electricity microgrid; wherein the cloud-based supervisory control, CSC, system is configured to control each local thermostatic controller, LTC, by receiving and sending information to each local thermostatic controller, LTC, characterized in that the cloud-based supervisory control, CSC, system is configured to activate, among all of the plurality of local electrical heating devices, EHDs, a specific amount of local electrical heating devices, EHDs, depending on a received information about the degree of import and export of electricity between the electrical-energy exchange means and the local, decentralized electricity microgrid at a specific point in time, and perform an operation mode selected from a group consisting of a renewables self-consumption, RSC, operation mode and a peak-load shifting, PLS, operation mode. a plurality of local electrical heating devices, EHDs, a plurality of local thermostatic controllers, LTCs, and a plurality of local energy stores TESs, wherein each electric heating device, EHD, is connected to and controlled by a respective local thermostatic controller, LTC, and is connected to and thermally coupled to an associated local thermal energy store, TES, wherein each local thermal energy store, TES, comprises a temperature sensor for detecting the temperature of the local thermal energy store, TES; a local renewable energy system, RES, generator which provides electricity to each of the plurality of local electrical heating devices, EHDs, via a decentralized electricity microgrid, wherein the decentralized electricity microgrid is electrically connected to an electrical-energy exchange means which is different to the local renewable energy system, RES, generator; a cloud-based supervisory control, CSC, system which is configured to receive information about a degree of import and export of electricity between the electrical-energy exchange means and the local, decentralized electricity microgrid; wherein the cloud-based supervisory control, CSC, system is configured to control each local thermostatic controller, LTC, by receiving and sending information to each local thermostatic controller, LTC, characterized in that the cloud-based supervisory control, CSC, system is configured to activate, among all of the plurality of local electrical heating devices, EHDs, a specific amount of local electrical heating devices, EHDs, depending on a received information about the degree of import and export of electricity between the electrical-energy exchange means and the local, decentralized electricity microgrid at a specific point in time, and perform an operation mode selected from a group consisting of a renewables self-consumption, RSC, operation mode and a peak-load shifting, PLS, operation mode.