**1. Introduction**

In the wake of increasingly present climate change effects, the scientific community proposes a "decarbonization" of our society, from transportation and industry to energy sectors. As society shifts from fossil fuel usage for transportation [1] and heating to electricity, our total electrical energy usage and dependence increases, imposing an excessive load on our already-ageing power distribution grid, leading to the development of different Demand Response (DR) strategies and mechanisms for the Smart Grid (SG). At the same time, electricity production is shifting towards renewable energy sources. These new energy sources, though, are not as controllable and predictable as traditional ones, in which production could be more easily matched to demand, increasing the need for effective DR.

Traditional demand-side management measures have taken the approach of reducing total energy consumption by increasing appliances' energy efficiency and leveraging technology to reduce wastage. More recently, as more producer-consumers (*Prosumers*) join the grid; leveraging Distributed Energy Resources (DERs) both for local energy generation and storage [2,3] also come as interesting opportunities to help both: reduce global carbon emissions and make better use of the grid.

According to the International Energy Agency (IEA) [4], electricity wholesale prices in Spain, France, Germany and the United Kingdom, increased in 2021 from three to more than four times in respect to the 2016–2020 period. This steep increase in electricity prices, together with the cost reduction of renewable energy production technologies such as solar Photo-Voltaic (PV), as well as electrical energy accumulation through different battery technologies, have greatly promoted its application in residential installations, as a way to reduce the electricity bill.

**Citation:** Gonzalez-Gil, P.; Martinez, J.A.; Skarmeta, A. A Prosumer-Oriented, Interoperable, Modular and Secure Smart Home Energy Management System Architecture. *Smart Cities* **2022**, *5*, 1054–1077. https://doi.org/10.3390/ smartcities5030053

Academic Editors: Antonio Cano-Ortega, Francisco Sánchez-Sutil and Aurora Gil-de-Castro

Received: 23 July 2022 Accepted: 19 August 2022 Published: 24 August 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

57

In this present situation of increased electricity prices, reduced costs for the application of DERs in residential installation, the need for cooperation between energy consumers/prosumers and the grid and the variable nature of renewable energy production; new and innovative solutions are needed to deal with the complexity of our present and future energy system.

#### *1.1. Smart Home Energy Management*

The Internet of Things (IoT): the interconnection of everyday physical devices through Information and Communication Technology (ICT), presents itself as a great candidate to automate and manage the ever-increasing complexity of those places where us humans dwell, as well as helping to shape electricity demand, better match production and consumption and quickly react to variability, while reducing the electricity bill and keeping within user-defined comfort parameters (Figure 1).

**Figure 1.** Smart Home energy management.

Many advances have come forth in the last years regarding the Smart Home (SH). More specifically, in the field of home automation, where a plethora of devices and appliances are available: smart bulbs, refrigerators, washing machines, tumble dryers, electric vehicles (and chargers), Home Ventilation and Air Conditioning (HVAC) and the likes. Several different technologies have coalesced and started to settle among the general public, designed to integrate many of those devices under a single point of control: the Smart Hubs. Among the most known commercial cloud-based solutions for Smart Hubs are those from Google, Amazon and Apple; however, there is also a growing community of Do It Yourself (DIY) enthusiasts, that have opted for open and often self-hosted solutions such as Home Assistant [5], Domoticz [6] and OpenHab [7] to name but a few. These open solutions come as great frameworks for the rapid development of new ideas beyond home automation, allowing us to leverage already existing integrations of different devices and platforms.

The present picture of a modern prosumer-oriented SH is thus a complex ecosystem in which energy management has to comply with a broad range of concerns (Figure 2). The interaction with external agents, like the SG, Smart Hubs and other external services, places high interoperability expectations both in data modelling and communication interfaces, as well as in the privacy concerns of the home inhabitants [8,9].

To this end, new and innovative solutions must be brought forth, such as the use of semantic web technologies to bridge the gap among the many different services and domains of home energy management, standard interfaces to facilitate communications with other agents and security mechanisms to facilitate setting boundaries to information access.

**Figure 2.** Home energy management concerns.

#### *1.2. Contribution of This Paper*

This work proposes a Smart Home Energy Management Systems (SHEMSs) [10–12] architecture design capable of integrating the many different facets of energy management of a modern home, in an interoperable, standard-based and secure way so that consumers/prosumers and grid are benefited. To that end, we have leveraged the use of semantic technologies for their potential to store and extract knowledge from heterogeneous sources, providing a formal common ground [13] as well as existing ontologies that capture the represented concepts. Additionally, to be able to offer a solution that stands to be integrated by different vendors and parties, we propose the use of standard-based secure technologies for information exchange.

The rest of this document is structured as follows: in Section 2, we reflect on the previously existing work on this topic. In Section 3, we propose a secure architecture for modular SHEMS, integrable with existing Home Automation Systems (HASs), which is later showcased by implementation in a real scenario in Section 4. Finally, we discuss the results obtained in Section 5, providing conclusions and possible future lines of work in Section 6.
