Concretely the system will be able to acquire distributed measurements of all kinds and remotely control some electrical loads, home battery packs and energy producers. It will also be used to control other devices such as gas or oil heaters, controllable blinds, etc. The control architecture that is provided will be open and expandable. It includes a local control stage at the scale of a house to preserve the privacy of the end-users and a “global” control stage whose scale can be from one neighborhood to an entire country. It will accommodate both local optimization algorithms to meet the needs of end users (e.g. maximization of auto consumption) and global optimization algorithms to achieve the goals of the electrical network operator (e.g. to clip the power peaks). The system will be tested with predictive optimization algorithms, in particular depending on the weather forecasts. It will be deployed in different sites in a real grid.