**2. State of the Art and Related Work**

There is a broad and extensive bibliography related to the work on Home Energy Management Systems (HEMSs) architecture and strategies, semantic representation of SH and HEMS concepts, DR strategies from within the SH and interfacing with the SG. In this section, we will briefly cover some of the most relevant works from our proposal perspective, sorted in reverse chronological order and categorised into two families: existing architectures and ontological work related to the interoperability of the solution.

#### *2.1. Architecture and Security*

Machorro-Cano et al. present HEMS-IoT [14]; a machine learning-based HEMS for energy saving, ensuring comfort and security while reducing energy consumption. The proposed architecture consists of seven layers, from presentation to device, in which information security is considered between presentation, IoT services and management layers, contemplating both authentication and authorisation. It does not mention DR or DER management as part of the proposed HEMS, nor explores the possibility of its integration with existing HAS, although its management layer does apply a semantic approach to home management, utilising a self-developed ontology to represent the main domotic concepts. Overall it presents a monolithic structure that goes from device to presentation, where interoperability has not been approached.

Elshaafi et al. [15] explore an approach to decentralised automated DR and home energy management. The proposed architecture is implemented using a multi-agent system with three different levels: home, aggregator and distribution system operator (being the latter two SG-related). At the home level, they define only two agents: the device agent and the HEMS agent. Their combined objective is to reduce the energy bill while respecting user preferences and comfort. While device agents encapsulate the communications with the home devices, the HEMS agent is responsible for the grunt of the work: planning, optimising and communicating with SG agents. This architecture does not consider the existence of a previous HAS. The final solution is presented in the form of a home gateway device that will directly interact with smart devices, although it does consider DER management through the different device agents. It addresses interoperability by proposing the usage of standard communication interfaces (OSGi: Open Services Gateway initiative [16]) and REST interfaces) and the use of Web Ontology Language (OWL) for information modelling. Finally, the proposed architecture takes into consideration the privacy and security of home users by using XACML (eXtendible Access Control Markup Language [17]) as an attribute-based access control platform, controlling the visibility of home devices to the HEMS agent.

The MAS2TERING project [18] defines a multi-agent system consisting of the following agents: *Distribution system operator agent*, *Aggregator agent*, *Central home energy management agent*, *Microgeneration agent*, *Appliance agent* and *Battery agent* whose interactions aim at delivering demand-side management through the supply chain, from generation to consumer appliances. This architecture does not cover security aspects, nor the integration with existing HASs or home energy management.

Zhang et al. propose iHEMS [19], a publish-subscribe communications infrastructure, using Information-Centric Networking (specifically Content Centric Networking) as the communication backbone. It does not rely on securing the communication channels but on encrypting the data itself, using a secure-group communications scheme above the pub-sub layer. The architecture itself contemplates the different devices interconnected through the Information Centric Networking-based pub-sub substrate, as well as a *Directory Service*, which devices use to publicise their data and a *Group Controller* in charge of key management for encryption/decryption.

Digital Environment Home Energy Management System (DEHEMS) project [20] proposes a service-based architecture, consisting of a remote server where the knowledge base is deployed, which in turn is fed from a *Data Collector* located in the home, to which sensors, devices, appliances and display devices are connected using wireless interfaces.

Rosello-Busquet et al. [21] propose a home gateway for a HEMS system, to control the devices in a home network at the service level. Built over the OSGi framework, it uses DogOnt ontology as the base for its knowledge base data repository. The architecture is composed of six bundles: *Knowledge Base*, *Interface*, *Network n*, *Networks Manager*, *Manager* and *Network Emulator*.

ThinkHome by Reinisch et al. [22] describes a multi-agent system architecture with two main premises: ensuring energy efficiency at home and comfort optimisation. The control strategies realised by the multi-agent system are split into problem aspects which are directly mapped to the different agents of the framework: *Control*, *Users*, *Global Goals*, *Context Inference*, *Auxiliary Data*, *Knowledge Base Interface* and *Building Automation System Interface*.

After the bibliographical review performed in architecture and security, we can conclude that none of the reviewed works considers all the previously described concerns of a modern prosumer-oriented SH in their architecture. None addresses data model and communications interoperability simultaneously to enable successful interaction with other service providers, such as external device platforms, Smart Hubs and the SG. Finally, security was covered by some works, but mostly in the communications domain, not placing the focus on data privacy, which represents a major concern in the complex SH ecosystem.

#### *2.2. Ontological Background*

To model the information in SHEMSs, a wide range of topics had to be covered, which resulted in an extensive survey of the different existing related ontologies. The topics or areas covered include grid DR management, home DR management, DER management, energy metering and performance assessment, energy saving advice, (home) infrastructure, user preferences, weather and environmental and sensor data: to name but a few. It is needless to say that no single ontology covers all of the required areas and that they all differ in the level of detail with which the different concepts are captured.

To summarise the ontological state of the art, Table 1 categorises the most relevant surveyed works according to our specific use case. Later, in Section 3.4, the mapping of those ontologies to specific elements in our proposal will be presented.


**Table 1.** Ontology summary.

\* Grayed rows are imported in DABGEO.

Smart Energy Domain Ontology (SARGON) [25] extends SAREF (Smart Applications REFerence [35]) but, unlike SAREF4EE, focuses on the control and monitoring of distribution electrical grids, integrating it with building energy automation.

OSEIM and NewOSEIM [23,24] leverage semantic reasoning over an ontology presenting knowledge about the internal and external environment of a home, to achieve intelligent energy management.

DABGEO [26] is an ontology semantically equivalent to OEMA [36], a previous ontology by the same authors. It improves on the former by offering a modular ontology that can be imported into subsets, facilitating its adoption in custom use-case scenarios. As its predecessor, it links and extends concepts from other previous ontologies. The base of the ontology network is ThinkHome, to which SAREF4EE, EnergyUse and ProSGV3 have been added.

EnergyUse framework [27] for home energy-saving advice applications, enriches PowerONT [37] (the power consumption ontology) with other ontologies and maps it to JSON-LD.

MAS2TERING ontology [18,38], developed under the homonymous project, implements USEF (Universal Smart Energy Framework [39]) through multi-agent systems. The purpose of the ontology is the representation of the data of different SG domains and to provide interoperability between SG agents and stakeholders. It is based in Energy@Home [40] and CIM (International Electrotechnical Commission's Common Information Model [41]).

The DNAS framework presents an ontology [30] to represent energy-related occupant behaviour to understand total energy consumption in buildings.

The MIRABEL [32,42] ontology for modelling flexibility in SG energy management, allows actors to express their energy flexibility for a specific device. It also represents energy profiles for devices, as well as production and storage devices.

BOnSAI [33,43] presents an ontology for incorporating Ambient Intelligence in Smart Buildings that can be used for energy management and monitoring. Includes concepts about functionality, QoS, hardware, users and context.

#### **3. Proposal**

The general or conceptual architecture of our proposal (Figure 3) is composed of multiple Energy Management Components (EMCs) responsible for a specific domain within home energy management, which interact with each other to pursue their goals, cooperating toward a common objective of increasing energy efficiency and reducing energy costs of the home.

**Figure 3.** Knowledge Base-centred architecture of the Smart Home Energy Management System.
