**5. Discussion**

Intelligent energy managemen<sup>t</sup> is a recurring and widely discussed topic in the scientific community. The continuous incorporation of new hardware and software elements is achieving increasingly complex and efficient goals. In this paper, we have presented a novel approach at the crossroads between energy managemen<sup>t</sup> systems and Voice Assistants. The research is focused on residential environment but could be extended to energy communities, commercial buildings, or microgrids benefiting both customers (energy savings and comfort) and utilities (support of demand side managemen<sup>t</sup> role in enhancing the flexibility of local energy systems). It combines energy managemen<sup>t</sup> system, Voice Assistant, IoT, AI, and big data in a single ecosystem to create a novel Energy Management Expert Assistant that learns and adapts to users while improving system efficiency without sacrificing comfort. The system has been developed and implemented in a real pilot, allowing it to evaluate and optimize the decisions taken and improve during its implementation. This practical implementation has required a development that has been spread over two years. It integrates numerous IoT sensors and actuators, thus a large amount of data have been collected and stored in time series and relational databases. The implementation has been developed in three phases (P0–P1, P2, and P3) to optimize the development of the system. In the first period (P1), the habits of the residents were monitored, which made it possible

to create a base model to optimize the decisions made by the system within acceptable comfort ranges for the users. The incorporation of the Virtual Assistant has maximized the results obtained. In this phase, we also optimized the best location and type of sensors and actuators to improve comfort and incentivize the participants. Two more phases were developed, being the third one where the system is already in full performance, and the best results are obtained. In this paper, we have presented the data up to this third period.

The work provides new developments in several lines of interest with real experimental results (not simulated) for which a measured deployment of sensors, actuators, as well as the development of IoT applications, recording of large amounts of data, visualization and processing of the data generated, modelling, ML, IoT intelligent environments, ES, and obtaining patterns has been required. It has been developed to obtain energy savings, cost reduction, comfort improvement, and social projection.

In addition to the above benefits, if this energy managemen<sup>t</sup> system were widely adopted, it could provide interesting value-added elements for both users and utilities. Some of these elements could be: (1) adaptation of residents to routines suggested by the Wizard that allow to modify consumption habits and reduce the amount of bills, (2) loadshifting to the valley times, therefore (3) reducing consumption at peak times, (4) allowing the reduction of total peak demand for distribution grid congestion alleviation, (5) a more flexible response to demand from two levels of action: a first level that would be managed by our system (local) without significantly affecting the comfort of users, and a second level in which it is the aggregator or the utility (external system) which, through a demand response policy, act on the consumption of household appliances, potentially affecting the comfort of users, and (6) social work by reducing consumption and therefore emissions of greenhouse gases or assistance to specific groups with special needs served by the Assistant: elimination of barriers in the home, a sense of companionship, natural connection with the outdoors, information and advice on consumption, etc.

Finally, it should be noted that the ML data and its model have been published (see Data Availability Statement), and given the information it can generate, we believe it will be a fundamental tool for optimizing energy consumption and comfort as a future continuation of this work. Future research directions would focus on adding new elements of power generation, storage, demand response, power quality, greater flexibility of the system to shorten adaptation times for users and vice versa, and consumption prediction to optimize the use of these energy sources, minimize expenditure and maximize comfort. The Wizard will continue to be a fundamental element after the good results achieved during its use in the present work.

**Author Contributions:** Conceptualization, M.L.-R.; data curation, M.L.-R.; formal analysis, M.L.-R.; funding acquisition, A.M.-M.; investigation, M.L.-R.; methodology, M.L.-R.; project administration, A.M.-M.; resources, J.G.-Z. and A.G.-d.-C.; software, M.L.-R.; supervision, A.M.-M.; validation, J.G.-Z. and A.G.-d.-C.; visualization, J.G.-Z. and A.G.-d.-C.; writing—original draft, M.L.-R.; writing—review and editing, M.L.-R. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the Project IMPROVEMENT (grant SOE3/P3E0901) cofinanced by the Interreg SUDOE Programme and the European Regional Development Fund (ERDF), and partially funded by the Spanish Ministry of Economy and Competitiveness under Project TEC2016-77632-C3-2-R.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** The Machine Learning and associated data presented in this study are available in Experiments from Azure AI Gallery (https://gallery.azure.ai/experiments accessed on 23 July 2021) under the title "Predicting the energy consumption of a house (BDTR-E1d)". Public link: https://gallery.cortanaintelligence.com/Experiment/Predicting-the-energy-consumption-ofa-house-BDTR-E1d accessed on 23 July 2021.

**Conflicts of Interest:** The authors declare no conflict of interest.
