## 9 Conclusions  
The EMS developed in this study represents a significant advancement in optimizing residential electricity consumption, demonstrating its ability to reduce costs and enhance energy efficiency. During simulations, the EMS achieved substantial cost reductions,  
Figure 33: Energy balance by electricity periods.  
Figure 32: Cost savings with the proposed solution.  
highlighting its effectiveness across diverse climatic scenarios. This was accomplished by strategically utilizing thermal energy stored in the building's structure, maximizing the TES capacity, and reducing reliance on expensive electricity sources during peak demand periods.  
The EMS significantly increased PV self-consumption, particularly in summer, by prioritizing the use of solar-generated energy to meet the household's thermal and electrical demands. This approach reduced grid dependency, not only lowering costs but also decreasing the carbon footprint of the system. Additionally, the EMS exhibited strong resilience to extreme climatic conditions, such as heatwaves or cold spells, maintaining optimal thermal comfort levels by anticipating and efficiently managing temperature fluctuations and energy demand.  
The innovative use of TES allowed the system to leverage the building's thermal inertia for strategic heat storage and release. This resulted in the more efficient operation of the HVAC system, reducing energy demand peaks and improving thermal stability within the home. This approach optimized the use of electric batteries and improved the integration of intermittent renewable sources, like solar energy, by dynamically adjusting the indoor temperature setpoints within defined comfort margins.  
Real-world testing confirmed the EMS's applicability in typical residential settings, demonstrating cumulative electricity consumption savings exceeding 57% in some cases. These findings underscore the system's feasibility for deployment in similar housing configurations, promoting the adoption of advanced energy management technologies that contribute to the sustainability and decarbonization of the residential sector.  
Environmentally, the EMS proved to be an effective tool for reducing CO2 emissions by decreasing dependence on grid electricity, particularly during high carbon intensity periods. This aligns with global energy transition goals towards renewable sources and enhances the flexibility of energy systems by enabling greater integration of renewables into existing infrastructure.  
Finally, the EMS design features a scalable and flexible architecture, making it adaptable to various residential configurations and existing systems. This opens new opportunities for large-scale implementation, supporting energy sustainability and achieving emission reduction targets in the residential sector. This study establishes a milestone in integrating predictive control and thermal storage solutions into residential settings, paving the way for future developments in this field.  
Conceptualization, R.F. and J.F.; methodology, R.F. and J.F.; formal analysis, R.F. and J.F.; investigation, R.F. and J.F.; validation, R.F.; writing--original draft preparation, R.F; writing--review and editing, R.F. and J.F.; supervision, J.F. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
Not applicable.  
Data Availability Statement: Data used in this article can be found in [66].  
The authors would like to thank IGNIS Energa for their support of [PERSON]'s Industrial PhD Thesis and for the facilities and equipment used in the validation of the results.  
Author [PERSON] was employed by the company IGNIS Energa S.L. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.