# A Cyber-Physical Approach for Residential Energy Management: Current State and Future Directions
## 3 Architecture for Home Energy Management Systems
Middleware solutions are used to integrate and coordinate the nodes, thus achieving a real-time status and management of the household. The Data Analytics Layer provides data storage, management and analysis (monitoring, forecasting, comfort-level analysis, etc.) to the data. Furthermore, at this stage, control tasks and scheduling algorithms are executed. Machine Learning techniques and different data processing strategies will translate the data to an easy and understandable form which can be visualized by the user. In addition, data visualization and user interactions are guaranteed in this layer through a user interface. The user interface provides consumers with advanced energy management applications and services. First, data are sensed and aggregated in the HAN, and once processed, actuation and control commands are sent back to physical devices according to energy consumption cost and user satisfaction. The proposed architecture shares the same basic structure of most traditional IoT-based HEMS. However, a higher combination and coordination between physical and computational elements is included, understanding data processing as a layer (Data Analytics), and thus, becoming a cyber-physical architecture for HEMS. Figure 3 shows a relationship between traditional IoT architectures and the cyber-physical based (CPS-based) ones. CPS includes complex analytics strategies, such as data mining, inference, and decision making. These systems benefit from massive wireless networks and physical devices (\"things\"), to provide intelligent services based on the knowledge of the surrounding physical world. Traditional IoT architectures focus on data acquisition and transmission, being less oriented to security and data processing [87]. In the proposed platform, security is conceived in every layer;  
Figure 1: Composition of previous IoT architectures for HEMS. however, to deepen in this particular topic is out of the scope of this paper since it requires significant research efforts, being considered an independent research field. The development of such systems benefits a wide variety of sectors ranging from remote healthcare to commercial services. Among these services, demand response (DR) and load planning programs focus on analyzing individual load levels in homes or buildings, which is promising in terms of energy efficiency. This analysis allows the possibility of  
Figure 3: Relationship between traditional IoT architectures elements and the CPS-based. Figure 2: Schematic diagram of a Home Energy Management System (HEMS). Stages involved: Data acquisition, Communication, and Data Analytics. identifying the less efficient or malfunctioning devices and implementing the appropriate actions intended for reducing consumption. In this scenario, consumers can have direct feedback on real-time power consumption effectively participating in the sustainable smart grid system. Additional useful information such as consumers' behavior patterns including occupation, sleep patterns, and other activities could also be inferred from appliance data. These activities are commonly known as activities of daily living (ADL), with applications in customer profiling, targeted marketing, monitoring of curfews, detection of illegal activities, and remote healthcare monitoring for elder people living alone, among other fields [16; 18; 20; 21; 43]. In an economic perspective, HEMS have a direct impact on reducing electricity consumption for households [30; 88]. This can be mainly achieved through demand response and demand side management programs. These programs will allow to obtain efficiency and bill reduction in smart cities reducing the total energy consumption, or deferring the operation of certain appliances, especially during off-peak hours. The authors of [88] highlighted that HEMS is also eco-friendly technology that significantly impact environmental conservation.