With the development of new technologies (sensors, storage batteries, etc.) in the field of energy, and CO2 emissions that continue to increase with the massive use of fossil fuels, it has become more than necessary to develop new energy-smart systems. These systems must not only increase the use of renewable energy but also adapt to the customer’s consumption profile in order to reduce unused energy. This project aims to create installations for generating (via photo-voltaic panels) and storage (via batteries) of energy to use solar energy to promote self-consumption and regulation of the electricity grid. These facilities will be distributed, i.e. placed in several different houses and buildings, in order to reach a very wide coverage of the territories. Based on clean solar energy, the system will optimise the charging and discharge of batteries to meet the demand for frequency regulation (and thus help stabilise the electricity grid) and to promote self-consumption when batteries are not used for regulation. The system will be based on optimisation and artificial intelligence techniques to take into account all the constraints of complex systems but also consumption profiles and meterological conditions.