{'fraction_non_alphanumeric': 0.028213224196520337, 'fraction_numerical': 0.009990833248456005, 'mean_word_length': 5.069120539477382, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Recent Techniques Used in Home Energy Management Systems: A Review

: Power systems are going through a transition period. Consumers want more active participation in electric system management, namely assuming the role of producers–consumers, prosumers in short. The prosumers’ energy production is heavily based on renewable energy sources, which, besides recognized environmental beneﬁts, entails energy management challenges. For instance, energy consumption of appliances in a home can lead to misleading patterns. Another challenge is related to energy costs since inefﬁcient systems or unbalanced energy control may represent economic loss to the prosumer. The so-called home energy management systems (HEMS) emerge as a solution. When well-designed HEMS allow prosumers to reach higher levels of energy management, this ensures optimal management of assets and appliances. This paper aims to present a comprehensive systematic review of the literature on optimization techniques recently used in the development of HEMS, also taking into account the key factors that can inﬂuence the development of HEMS at a technical and computational level. The systematic review covers the period 2018–2021. As a result of the review, the major developments in the ﬁeld of HEMS in recent years are presented in an integrated manner. In addition, the techniques are divided into four broad categories: traditional techniques, model predictive control, heuristics and metaheuristics, and other techniques.


Introduction
In the past, energy management systems have been specifically designed for energy production and distribution/commercialization companies with the aim of monitoring and optimizing energy flows in the power system. More recently, information and communication technologies have played an important role in the energy sector [1], enabling the development of this type of management system at the end-user level. In this context, the energy end-users experienced a changing role over recent years, from a passive to an active perspective [2]. The initial objective was to manage energy consumption in their homes by the end-user themselves. These energy management systems were then called home energy management system (HEMS). At this stage, the main interest of end-users who have a HEMS is to reduce the value of the electricity bill. In a next phase, in addition to reducing electricity costs, end consumers began to worry about energy efficiency and the possibility of producing their own energy, mainly from renewable sources. Thus, currently, HEMS can be considered as a true energy hub, enabling the management of both the energy produced and the energy consumed.
Consequently, HEMSs are of great interest to the public, but particularly to the scientific community, with the aim of providing more and more management facilities, involving innovative techniques with the possibility of achieving greater rigor in this management

Systematic Review Rationale
To contribute to the development of innovative strategies for HEMS, this study consists of a systematic review of the applications of the techniques used in HEMS and the associated technical and computational issues. The review follows the guidelines proposed by Kitchenham [4] for a systematic review. According to these guidelines, at the time of pre-review it is necessary to define the research questions and a review protocol, i.e., the plan on which all review procedures are based. Thus, in planning the review stage, in addition to the research questions, the following must be defined: the search strategy, including the search words (keywords); the eligibility of the data, with the definition of inclusion and exclusion criteria. Then, in the conducting the review stage the review starts and should include data collection and data analysis. Finally, the results are presented, that is, the detailed analysis of the papers included in the work.

Planning the Review
Having a plan is one of the most important steps in producing a good quality review article, as it allows to avoid mistakes that can slow down the process and reduce the quality of the review. Defining research questions is the most important procedure at this stage. Additionally, the plan should include the search strategy and data eligibility.

Research Questions
To achieve the objectives of the review, it is essential to be able to concretely define the subject to be addressed. This is possible through so-called research questions.
Formally, the research questions for this review can be defined as: 1.
What are the main developments in terms of optimization techniques within the scope of HEMS in recent years? 2.
What are the key factors at a technical and computational level that must be considered in the development of HEMS?
To address research question 1, the main methods and techniques used in the development of HEMS were surveyed. The techniques were grouped into the following broad categories: mathematical programming, heuristics and metaheuristics, model predictive control (MPC), and other techniques.
To address research question 2, a comprehensive review of the technical and computational aspects that are considered in the development of HEMS was performed. Among the aspects considered are the problem size, the resolution, the planning horizon, and the time steps, as well as other important considerations such as user behavior, demand-side management, uncertainty, and the consideration of multi-objective problems. In round 1, the titles and abstracts of the papers were analyzed in detail, considering the inclusion and exclusion criteria, resulting in a total of 306 papers. Then, in round 2, the pre-selected papers were analyzed in detail to check the completion of the inclusion and exclusion criteria. Namely, in round 2 it was analyzed whether each paper explicitly focused on techniques applied in HEMS, being discarded if not. As a result, 101 papers were obtained.
The number of selected articles according to article type is shown in Figure 1.
The data were organized in tables and figures to allow an easier and faster analysis, always aiming at answering the research questions.
The number of selected papers according to the inclusion/exclusion criteria is shown in Table 1. In round 1, the titles and abstracts of the papers were analyzed in detail, considering the inclusion and exclusion criteria, resulting in a total of 306 papers. Then, in round 2, the pre-selected papers were analyzed in detail to check the completion of the inclusion and exclusion criteria. Namely, in round 2 it was analyzed whether each paper explicitly focused on techniques applied in HEMS, being discarded if not. As a result, 101 papers were obtained.
The number of selected articles according to article type is shown in Figure 1. The previous review articles and their main features are shown in Table 2. Compared with the reviews mentioned in Table 2: The present work is focused on residential EMS, addressing a broad range of technical and computational issues specifically assessed from a residential point of view, facilitating understanding of the employed methods and modeling setups during the reading. (ii) Only references presenting a clear and extensive description of the employed methods were included in this review.
Review article (15) Article (86) The previous review articles and their main features are shown in Table 2. Compared with the reviews mentioned in Table 2: (i) The present work is focused on residential EMS, addressing a broad range of technical and computational issues specifically assessed from a residential point of view, facilitating understanding of the employed methods and modeling setups during the reading. (ii) Only references presenting a clear and extensive description of the employed methods were included in this review.  [5] Home energy management system (HEMS): concept, architecture, infrastructure, challenges and energy management schemes Focus on concepts, architecture, infrastructure, and energy management scheme of HEMS. Discussion of goals and challenges faced by HEMS. [6] A survey on home energy management Focus on concept and components of HEMS, electric vehicle integration, demand-side management, appliances categorization, discussion of uncertainty incorporation, scheduling techniques, and security. [7] Optimization methods for power scheduling problems in smart home Focus on the concepts of smart grid, smart homes, and mainly scheduling of smart home appliances. The scheduling techniques are divided in exact algorithms and metaheuristic algorithms. Includes a discussion of various types of demand response programs and price schemes.   [8] Smart home energy management system-a review Focus on the concept of smart HEMS and its architecture. Explicit demonstration of formulations for HEMS. Discussion of optimization techniques and solution methods, forecasting, and energy trading and tariffs. Discussion and analysis of factors in HEMS. [9] A review of reinforcement learning for autonomous building energy management Exclusively related to review of reinforcement learning for building energy management. [10] A Review of Deep Reinforcement Learning for Smart Building Energy Management Exclusively related to the applications of deep reinforcement learning for EMS. [11] Home Energy Management System Concepts, Configurations, and Technologies for the Smart Grid Focus on main concepts, configurations, enabling technologies, and communication technologies. [12] Review on Home Energy Management System Considering Demand Responses, Smart Technologies, and Intelligent Controller Focus on previous and current studies focusing on HEMS from a demand response perspective. [13] A Review of Internet of Energy (IoE) Based Building Energy Management Systems: Issues and Recommendations Reviews the use of IoE for improving building EMS performance and its associated technologies. [14] Of impacts, agents, and functions: An interdisciplinary meta-review of smart home energy management systems research EMS benefits for the energy systems. [15] Intelligent Controllers and Optimization Algorithms for Building Energy Management Towards Achieving Sustainable Development: Challenges and Prospects Focus on optimization objectives for comfort, energy use, and scheduling in EMS. [16] Application of DR and co-simulation approach for renewable integrated HEMS: a review Reviews the feasibility of HEMS methods according to their control techniques and functionalities. [17] A review of strategies for building energy management system: Model predictive control, demand side management, optimization, and fault detect and diagnosis Strategies for EMS focusing on model predictive control, optimization, energy efficiency, fault detection, and diagnosis In addition to the papers presented above, we strongly recommend the reader to consult the article [18] which is one of the most cited and most complete papers in the HEMS review.
Journals with at least two articles in the final selection are shown in Table 3. The number of selected papers distributed by year of publication is shown in Figure  2.

Techniques Used in Home Energy Management Systems
HEMS are complex systems, and the decision maker must consider two fundamental issues when planning the system operation: firstly, the system modeling, and secondly, the techniques used to obtain a solution to the problem. The problems on which HEMS are based can generally be formulated as linear programming problems, non-linear programming, and its variants, mixed-integer linear programming (MILP), and nonlinear integer programming problems. In general, the problem of planning the operation of systems such as a home is a non-linear problem with a significant number of constraints and variables. However, through function linearization techniques it is possible to obtain approximations that turn the problem into a linear problem. A significant number of techniques have been applied to HEMS in recent years. However, the technique chosen depends on the nature of the problem at hand. Generally, these techniques can be divided into the following categories, adopted in this work for further classification: traditional techniques, model predictive control, heuristics and metaheuristics, and other techniques, as shown in Figure 3.

Techniques Used in Home Energy Management Systems
HEMS are complex systems, and the decision maker must consider two fundamental issues when planning the system operation: firstly, the system modeling, and secondly, the techniques used to obtain a solution to the problem. The problems on which HEMS are based can generally be formulated as linear programming problems, non-linear programming, and its variants, mixed-integer linear programming (MILP), and non-linear integer programming problems. In general, the problem of planning the operation of systems such as a home is a non-linear problem with a significant number of constraints and variables. However, through function linearization techniques it is possible to obtain approximations that turn the problem into a linear problem. A significant number of techniques have been applied to HEMS in recent years. However, the technique chosen depends on the nature of the problem at hand. Generally, these techniques can be divided into the following categories, adopted in this work for further classification: traditional techniques, model predictive control, heuristics and metaheuristics, and other techniques, as shown in Figure 3.  The number of selected articles according to these categories is shown in Table 4. The category, technique, and simulation platform of the articles are shown in Table  5. Table 5. Selected papers by category, technique, and simulation platform.

Traditional Techniques (Mathematical Optimization)
In this article, the traditional optimization techniques for HEMS applications refer to techniques that use mathematical optimization based on exact algorithms. Hence, in this category it is considered that the solution to the problem is obtained using commercial solvers.

Linear Programming
Linear programming is an optimization technique where the objective function is a linear function and constraints are given by linear functions. Variables assume continuous values. It is considered the simplest way to represent mathematical programming problems. However, it may not be the most efficient way to represent complex real-world problems, mostly based on non-linear processes.
A comprehensive description of the theory of linear and integer programming may be found in [89].
Pure linear programming problems make it difficult and computationally costly to model more complex management systems such as HEMS, so it is not often used in the design of these systems, and this is one of the reasons why few authors in recent years adopted this approach. However, a sample of the employment of this method for HEMS may be found in [19], where the authors propose a HEMS that considers a PV-battery system and thermostatically controlled loads using linear programming to optimize the energy consumption of the loads. The objective is the minimization of operational costs.
The findings of selected papers associated with linear programming are shown in Table 6. Table 6. Findings of selected papers associated with linear programming.

Reference
Findings [19] Comparison between a scheme without HEMS and with HEMS, proving the expected effectiveness of HEMS.

Mixed-Integer Linear Programming
Mixed-integer linear programming (MILP) refers to optimization techniques where the objective function is given by a linear function and subject to linear constraints but includes mixed variables, continuous and discrete variables. These problems allow for greater modeling power as it is possible to consider binary variables that help to represent realworld processes more effectively. The fact that it is based on a linear problem guarantees optimality conditions, i.e., it is guaranteed to obtain a global optimum. Many research works address the formulation of the HEMS problem using MILP. Most of the HEMS consider the load in a segmented matter (multiple appliances or thermal/electrical loads), as well as the energy price information.
A HEMS is proposed for a home with electric and thermal loads, and with the consideration of electric vehicles (EV) integration in [20].
MILP was used in [21] where a HEMS is presented to participate in the day-ahead electricity market through demand-response strategies. All loads, including thermal, are considered for demand response.
A price-sensitive HEMS is proposed by authors of [22], having as components a PV system, energy storage, and controllable loads.
Some authors design HEMS with a particular interest in managing energy storage systems (ESS). This is the case of the authors of [23].
Multiple sources of energy in the same residence are also object of study. For instance, the authors of [24] propose a HEMS for a house incorporating multi-energy resources, namely, electricity, thermal energy, renewables, energy storage, and natural gas.
A new two-level optimization algorithm for the energy management of residential appliances within a smart home is proposed in [25]. The system includes interruptible, uninterruptible, thermostatically controlled, and non-schedulable loads, as well as the charging/discharging strategies of EVs and ESS in the presence of distributed energy resources (DER).
Other studies considered more technical aspects of the residence energy management. An example may be found in [26], where the trading with technical influences of utility requirements is considered: Volt-Watt and Volt-Var functions.
The findings of selected papers associated with mixed-integer linear programming are shown in Table 7. Table 7. Findings of selected papers associated with mixed-integer linear programming.

Reference
Findings [20] The results of the proposed HEMS are compared with other energy management systems, showing the effectiveness of the proposed model, through case studies that allow reducing energy costs in both summer and winter. [21] The results are compared when demand response is considered and when it is not. They demonstrate that the strategy presented with demand response is superior. [22] The proposed methodology allows to reduce house costs by 53% and reduce peak-to-average ratio (PAR) by around 70%.
[23] Several energy-storage scenarios are considered, showing the benefits of considering a battery to store energy. [24] The results show significant cost saving while maintaining user comfort. [25] The results show a reduction in the electricity costs and an increase in power factor according to user's preference. The number of selected papers associated with a given objective for mixed-integer linear programming is shown in Figure 4. [23] Several energy-storage scenarios are considered, showing the benefits of considering a battery to store energy. [24] The results show significant cost saving while maintaining user comfort. [25] The results show a reduction in the electricity costs and an increase in power factor according to user's preference.
The number of selected papers associated with a given objective for mixed-integer linear programming is shown in Figure 4.

Non-Linear Programming
Non-linear programming, different from linear programming and MILP, is an optimization technique where the objective function and/or the constraints are given by non-linear functions. It represents real-world problems in a more real manner, but its main disadvantage is that it does not guarantee an optimal solution; that is, instead of a global optimal, a local optimal can be obtained. Additionally, the computation time tends to increase. For a comprehensive description of the non-linear programming theory, please refer to [90].
As is the case of linear programming, pure non-linear programming problems are not common in HEMS. However, the authors of [27] propose an energy management system for a residence composed solely of renewable sources, wind and PV, and batteries.

Non-Linear Programming
Non-linear programming, different from linear programming and MILP, is an optimization technique where the objective function and/or the constraints are given by non-linear functions. It represents real-world problems in a more real manner, but its main disadvantage is that it does not guarantee an optimal solution; that is, instead of a global optimal, a local optimal can be obtained. Additionally, the computation time tends to increase. For a comprehensive description of the non-linear programming theory, please refer to [90].
As is the case of linear programming, pure non-linear programming problems are not common in HEMS. However, the authors of [27] propose an energy management system for a residence composed solely of renewable sources, wind and PV, and batteries. The objective is to minimize the use of energy from the grid and maximize the sale of energy to the grid from renewables.
The findings of selected papers associated with non-linear programming are shown in Table 8. Table 8. Findings of selected papers associated with non-linear programming.

Reference
Findings [27] The results obtained by non-linear programming are compared with GA, showing the superiority of the former.

Mixed-Integer Non-Linear Programming
Mixed-integer non-linear programming (MINLP) is an optimization technique where the objective function and/or the constraints are given by non-linear functions. Like MILP problems, they include mixed variables. Being non-linear does not guarantee obtaining a global optimum and they can be very difficult to be solved.
MINLP has been successfully applied to HEMS. For instance, the authors of [28] propose a HEMS with integrated renewables and energy storage.
A HEMS model for a smart home is proposed in [29] considering different capacities of energy storage and PV subsidy policies on the scheduling of household appliances.
The findings of selected papers associated with mixed-integer non-linear programming are shown in Table 9. Table 9. Findings of selected papers associated with mixed-integer non-linear programming.

Reference
Findings [28] Three operating scenarios are considered: normal, economic, and smart. The smart scenario manages to significantly reduce the daily energy cost, without greatly detracting from the other objectives. [29] Comparison of single-objective and multi-objective optimization is considered.
In the simulations a reduction of 61% and 71% is verified for peak load and electricity costs in the single-objective optimization.
The number of selected papers associated with a given objective for mixed-integer non-linear programming is shown in Figure 5.
MINLP has been successfully applied to HEMS. For instance, the authors of [28] propose a HEMS with integrated renewables and energy storage.
A HEMS model for a smart home is proposed in [29] considering different capacities of energy storage and PV subsidy policies on the scheduling of household appliances.
The findings of selected papers associated with mixed-integer non-linear programming are shown in Table 9. Table 9. Findings of selected papers associated with mixed-integer non-linear programming.

Reference
Findings [28] Three operating scenarios are considered: normal, economic, and smart. The smart scenario manages to significantly reduce the daily energy cost, without greatly detracting from the other objectives. [29] Comparison of single-objective and multi-objective optimization is considered. In the simulations a reduction of 61% and 71% is verified for peak load and electricity costs in the single-objective optimization.
The number of selected papers associated with a given objective for mixed-integer non-linear programming is shown in Figure 5.

Dynamic Programming
In dynamic programming (DP), the problem as a whole is divided into several subproblems, i.e., a solution to the original problem is obtained through simpler problems. The optimal solutions of the sub-problems are stored in time, which allows previous calculations to help in the next stages. Using this strategy, the complexity of the problem tends to decrease [91]. For the fundamentals for the theory of DP, please consult [92]. DP has been applied in HEMS. For instance, the authors of [30] proposed a HEMS for homes consisting of PV systems, batteries, and controllable loads. To solve the problem, the Differential DP (DDP) technique is presented.
A novel state-space approximate DP (SS-ADP) approach to quickly solve a HEMS problem can be found in [31].
The findings of selected papers associated with dynamic programming are shown in Table 10. Table 10. Findings of selected papers associated with dynamic programming.

Reference
Findings [30] The DDP results are compared with the results of the exact DP, approximate DP, and MINLP. DDP proves to be computationally faster than the mentioned techniques. [31] Similar solutions are obtained by the proposed SS-ADP and DP, since the solutions of the SS-ADP approach are in the 0.8% of the DP solutions. In addition, savings in computational time of at least 20% are verified. The number of selected papers associated with a given objective for dynamic programming is shown in Figure 6. [30] The DDP results are compared with the results of the exact DP, approximate DP, and MINLP. DDP proves to be computationally faster than the mentioned techniques. [31] Similar solutions are obtained by the proposed SS-ADP and DP, since the solutions of the SS-ADP approach are in the 0.8% of the DP solutions. In addition, savings in computational time of at least 20% are verified.
The number of selected papers associated with a given objective for dynamic programming is shown in Figure 6.

Stochastic Programming
Stochastic programming is an optimization technique where the objective function and constraints include uncertainty in parameters and variables. The optimal value of the objective function is given by the expected value of the objective function. Stochastic programming is considered when there is knowledge about the probability distribution function. Further, these problems can be based on two-state or multi-state problems, being called two-stage stochastic programming problems or multi-stage stochastic programming problems. A set of realizations for the parameters that involve uncertainty can be considered, being designated by scenarios. Usually, each scenario is associated with a probability. A detailed description of the fundamentals of stochastic programming may be found in [93].

Stochastic Programming
Stochastic programming is an optimization technique where the objective function and constraints include uncertainty in parameters and variables. The optimal value of the objective function is given by the expected value of the objective function. Stochastic programming is considered when there is knowledge about the probability distribution function. Further, these problems can be based on two-state or multi-state problems, being called two-stage stochastic programming problems or multi-stage stochastic programming problems. A set of realizations for the parameters that involve uncertainty can be considered, being designated by scenarios. Usually, each scenario is associated with a probability. A detailed description of the fundamentals of stochastic programming may be found in [93].
Due to its characteristics, stochastic programming has been applied in HEMS, not only as the single method used but also associated with other methods to evaluate and deal with the uncertainty. To deal with the uncertainty, two situations in particular are explored with more frequency: dealing with electricity market price, especially when the system also injects energy in the grid, and dealing with multiple sources of renewable energy, in which the generation depends on factors that could suffer considerable variation, such as wind speed and solar radiation.
For instance, stochastic programming is employed by the authors of [32] for the optimal bidding strategy for autonomous residential energy management systems. This system allows the management of the production and consumption of the house and the participation in the local market environment through the technique of stochastic programming using intervals from the scenarios that represent the uncertainty of the market price of local electricity and PV production. The problem is formulated as a twostage stochastic programming problem. The first stage is related to the day-ahead market and the second stage is related to real-time.
The approach of multiple-stage framework stochastic programming is explored by many authors. The optimal energy management and sizing of renewable energy for a home and a microgrid are proposed in [33], in which the problem is formulated in a two-stage approach.
In [34], a HEMS is presented for a house composed of the PV system and battery and loads. The problem is formulated as a two-stage stochastic programming problem as well. The first stage determines the optimal day-ahead energy procurement and the scheduling of shiftable appliances. The second stage is related to the real-time operation, namely the charging and discharging process of the battery.
In [35], a HEMS with PV systems, EVs, ESS, and thermal and electric loads is presented. The problem is formulated as a two-stage stochastic programming problem. The first stage defines the quantities of energy to be sold and purchased from the grid, and the second stage defines the decisions about customer's convenience and DER operation, namely temperature and charging and discharging rates of EVs and energy storage.
In the same fashion of multi-resource of energy as presented above, a HEMS is presented for a home that includes wind turbines, diesel generators, and EVs in [36].
The authors of [37] propose a HEMS with demand response, renewable resources, and battery storage.
In [38], a HEMS is presented, considering electrical and thermal loads. The optimization problem is also formulated as two-stage stochastic programming in [39] for a HEMS including wind micro-turbine, battery, EV, and electric and thermal loads. The first stage is related to trading energy with the day-ahead local market, and the second stage is related to trading energy in real-time.
Another stochastic model of a HEM system is proposed by authors of [40]. The model optimizes the customer's cost in different demand response programs.
In [41], a HEMS is developed for a house consisting of different electric appliances and with generation from PV systems and battery storage.
The findings of selected papers associated with stochastic programming are shown in Table 11. Table 11. Findings of selected papers associated with stochastic programming.

Reference
Findings [32] It is demonstrated that the optimal offering model is more robust than the non-optimal offering model. [33] The results of stochastic programming are compared with the results of deterministic programming, showing the superiority of the former.
[34] Stochastic programming is beneficial for using imperfect forecasts.
[35] The proposed strategy allows for a reduction in electricity costs.
[ 36] The results show that operating all capacity resources minimizes the operational costs.
[37] The operation is analyzed for two cases, with HEMS, and without HEMS. The use of a stochastic approach improved results. [38] The proposed methodology allows obtaining better results in less time.
[39] Participation of smart home in a time-of-use pricing scheme leads to increased profit.
[40] The deterministic approach is compared with the stochastic approach, showing the superiority of the stochastic approach.
[41] The case studies presented on different prices allows to observe the effectiveness of the proposed model.
The number of selected papers associated with a given objective for stochastic programming is shown in Figure 7.  Table 11. Findings of selected papers associated with stochastic programming.

Reference
Findings [32] It is demonstrated that the optimal offering model is more robust than the non-optimal offering model. [33] The results of stochastic programming are compared with the results of deterministic programming, showing the superiority of the former. [34] Stochastic programming is beneficial for using imperfect forecasts. [35] The proposed strategy allows for a reduction in electricity costs. [36] The results show that operating all capacity resources minimizes the operational costs.
[37] The operation is analyzed for two cases, with HEMS, and without HEMS. The use of a stochastic approach improved results. [38] The proposed methodology allows obtaining better results in less time. [39] Participation of smart home in a time-of-use pricing scheme leads to increased profit.
[40] The deterministic approach is compared with the stochastic approach, showing the superiority of the stochastic approach.
[41] The case studies presented on different prices allows to observe the effectiveness of the proposed model.
The number of selected papers associated with a given objective for stochastic programming is shown in Figure 7.

Robust Programming
In robust programming, like stochastic programming, uncertainty is considered in the parameters and variables. There is no knowledge about the probability distribution function of parameters that involve uncertainty. Instead, intervals of values for the parameters are considered. This often leads to exaggerated assumptions about the parameters, i.e., it is considered the worst case. Consequently, it is not considered a consensual technique. Further details may be found in [94,95].
Despite the above disadvantages, robust programming has been applied to HEMS. For instance, the authors of [42] propose a HEMS considering a hierarchical control, having a central controller and local controllers. The central controller optimizes the schedule of the non-thermal loads. The local controllers respond to the real-time variations to obtain thermal comfort. A data-driven distributional robust optimization is proposed to guarantee solution robustness against the worst probability distribution of multiple uncertainties.
A flexible-constrained energy management model is proposed for smart-home-equipped PV systems and energy storage in [43].
In [44], a risk-based robust decision-making framework for smart residential buildings, considering electric and thermal appliances and plug-in hybrid vehicles is proposed.
The findings of selected papers associated with robust programming are shown in Table 12. Table 12. Findings of selected papers associated with robust programming.

Reference
Findings [42] The results show that the proposed approach can reduce the electricity cost in comparison with other techniques.
[43] The deterministic approach is compared with the robust approach. Additionally, a sensitivity analysis is performed to assess the robustness of the problem. [44] The robustness of the problem and the computational efficiency are verified by the proposed approach.
The number of selected papers associated with a given objective for robust programming is shown in Figure 8. A flexible-constrained energy management model is proposed for smart-homeequipped PV systems and energy storage in [43].
In [44], a risk-based robust decision-making framework for smart residential buildings, considering electric and thermal appliances and plug-in hybrid vehicles is proposed.
The findings of selected papers associated with robust programming are shown in Table 12.

Reference
Findings [42] The results show that the proposed approach can reduce the electricity cost in comparison with other techniques.
[43] The deterministic approach is compared with the robust approach. Additionally, a sensitivity analysis is performed to assess the robustness of the problem. [44] The robustness of the problem and the computational efficiency are verified by the proposed approach.
The number of selected papers associated with a given objective for robust programming is shown in Figure 8.

Model Predictive Control
The model predictive control (MPC) is an advanced method of control based on a receding horizon principle, aimed at determining the best course of action while meeting the requirements. In [96,97], detailed information on the theory of the MPC may be found.
The application of MPC in HEMS has developed significantly in recent years. For instance, in [45] a HEMS for a residential building with a PV system, ESS, thermal and electric loads, and EVs is proposed. The MPC problem considered a prediction horizon of four hours for every 5 min.
The authors of [46] propose a HEMS for a smart home focusing on the energy balance

Model Predictive Control
The model predictive control (MPC) is an advanced method of control based on a receding horizon principle, aimed at determining the best course of action while meeting the requirements. In [96,97], detailed information on the theory of the MPC may be found. The application of MPC in HEMS has developed significantly in recent years. For instance, in [45] a HEMS for a residential building with a PV system, ESS, thermal and electric loads, and EVs is proposed. The MPC problem considered a prediction horizon of four hours for every 5 min.
The authors of [46] propose a HEMS for a smart home focusing on the energy balance between the three phases to control both active and reactive power. Several case studies are considered, assuming a prediction horizon of 24 h, a control horizon of 24 h, and a simulation horizon of 48 h.
A comprehensive approach of a mixed-integer quadratic-programming MPC scheme based on the thermal building model and the building energy management system is employed by authors of [47].
A HEMS is developed by employing an MPC framework in [48] and implemented using a Branch-and-Bound algorithm. The authors discuss the selection of different parameters, such as time-step to employ, predict, and control horizons and the effect of the weather on the system performance.
A predictive HEMS for a residential building with the integration of a plug-in EV (PEV), a PV array, and a heat pump is developed by [49]. A stochastic MPC strategy is applied.
The findings of selected papers associated with model predictive control are shown in Table 13. Table 13. Findings of selected papers associated with model predictive control.

Reference
Findings [45] Various configurations, namely, stand-alone and centralized configurations of MPC are formulated and compared with other traditional rule-based control. The MPC configurations suggest energy cost savings. [46] The proposed methodology manages to balance the three phases. [47] The proposed controller offers a solution to reformulate the discrete stochastic constraints to avoid the exponential growth of the scenario tree experienced by existing controllers. The proposed controller's efficiency is shown by benchmarking and comparing it with the multistage stochastic programming algorithm in the context of HEMS. [48] A comparison is made between the economic performance of the proposed approach with a real photovoltaic battery system existing in a residence equipped with several IoT devices, with savings larger than 30% both on sunny and cloudy days. [49] The MPC ensures that home load demand, PEV battery charging requirements, and household thermal comfort conditions are met.
The number of selected papers associated with a given objective for model predictive control is shown in Figure 9. A HEMS is developed by employing an MPC framework in [48] and implemented using a Branch-and-Bound algorithm. The authors discuss the selection of different parameters, such as time-step to employ, predict, and control horizons and the effect of the weather on the system performance.
A predictive HEMS for a residential building with the integration of a plug-in EV (PEV), a PV array, and a heat pump is developed by [49]. A stochastic MPC strategy is applied.
The findings of selected papers associated with model predictive control are shown in Table 13.

Reference
Findings [45] Various configurations, namely, stand-alone and centralized configurations of MPC are formulated and compared with other traditional rule-based control. The MPC configurations suggest energy cost savings. [46] The proposed methodology manages to balance the three phases. [47] The proposed controller offers a solution to reformulate the discrete stochastic constraints to avoid the exponential growth of the scenario tree experienced by existing controllers. The proposed controller's efficiency is shown by benchmarking and comparing it with the multistage stochastic programming algorithm in the context of HEMS. [48] A comparison is made between the economic performance of the proposed approach with a real photovoltaic battery system existing in a residence equipped with several IoT devices, with savings larger than 30% both on sunny and cloudy days. [49] The MPC ensures that home load demand, PEV battery charging requirements, and household thermal comfort conditions are met.
The number of selected papers associated with a given objective for model predictive control is shown in Figure 9.

Forecasting in HEMS
A smart household, as previously mentioned, is composed of a variety of energy systems. To allow the HEMS to make better decisions, knowing the future valuesforecasting-of, for example, electric loads, electricity generation and storage state of

Forecasting in HEMS
A smart household, as previously mentioned, is composed of a variety of energy systems. To allow the HEMS to make better decisions, knowing the future valuesforecasting-of, for example, electric loads, electricity generation and storage state of charge, is an important asset for the improvement of HEMS efficiency.
The use of forecasting models is mandatory in model-based predictive control (MBPC). The reason is that MBPC uses predictive models, that should output the modelled variable's forecasts for each step ahead within the Prediction Horizon (PH) considered, i.e., provide multi-step-ahead forecasting. This type of forecast can be achieved in a direct mode, by having several one-step-ahead forecasting models, each providing the prediction of each step ahead within the prediction horizon. An alternative is to use a recursive version. In this case, only one model is necessary, and for each step within the PH, the inputs change, eventually employing predictions obtained in previous steps.
In this sub-section, we describe some of the articles in which the forecasting is a considerable component in the HEMS system.
In [51], a real-time forecasting is developed considering renewable generation, and the HEMS updates the inputs of scheduling system before each optimization calculation.
In [34], forecasting is employed in an integrated HEMS framework where it is assessed together with monitoring, scheduling, and coordination, focusing on the renewable energy generation and storage of the residence.
The authors of [98] develop power predictions using GA-ANN for a day-ahead forecast in a short-term fashion.
In [99], the authors used a Muti-Objective Genetic Algorithm (MOGA) framework to design a multi-step ahead recursive forecast model (a Radial Basis Function ANN) for the power demand in a residential HEMS. In [100], the same residence was used as case study to propose an ensemble forecasting approach. The ensemble of models is easily obtained by the MOGA approach and has been shown to obtain more accurate forecasts than the single solution. Although MOGA is a metaheuristic it is only used for model design, and not specifically for HEMS.
The authors of [84] use ANN to forecast the renewable energy sources (wind and solar) of a net zero energy building. In [101], the authors explore forecasting techniques in a HEMS from a prosumer perspective.
In [102], using the MOGA formulation, the authors develop a short-term forecasting of the photovoltaic solar power, to be used in a HEMS.
Forecasting is also very important in residential energy communities. In [103], the authors review a variety of forecasting methods to be employed in the energy communities control context. In [104], forecasting is explored considering the load demand, wind power, and electricity price.

Heuristics and Metaheuristics
Heuristics stand for strategies using readily accessible information to control problemsolving processes in man and machine, to obtain good enough results in an admissible length of time. Detailed information about heuristic search strategies may be found in [105,106]. A metaheuristic guides a subordinate heuristic using concepts derived from artificial intelligence, biological, mathematical, natural, and physical sciences to improve their performance. Information about metaheuristics theory may be found in [107,108]. Consequently, one of the differences between heuristics and metaheuristics is that heuristics are problem dependent; on the contrary, metaheuristics are problem independent.
Currently, heuristics and metaheuristics are the most used techniques in HEMS, taking advantage of the computational efficiency they often provide. For instance, a domestic microgrid is presented and an energy management system developed in [50]. The authors present four metaheuristics: grey wolf optimization (GWO), binary particle swarm optimization (PSO) (BPSWO), genetic algorithm (GA), and wind-driven optimization. Furthermore, they developed several combinations of these metaheuristics.
The authors of [51] propose an energy management system based on real-time electricity scheduling for a house that includes renewable, wind energy, and PV and ESS. GA is applied to obtain the solution of the problem.
A HEMS is presented in [52] that must guarantee the house's resilience, i.e., to be able to be self-sufficient when there is a failure in the network. To solve the problem, a new metaheuristic called Natural Aggregation Algorithm (NAA) is presented.
In [53] a HEMS is proposed for the optimal management of appliances in a home. To find the solution to the problem, four heuristics are presented: bat algorithm, GWO, moth flam optimization, and Harris hawks optimization.
A HEMS is presented in [54]. To obtain a solution to the problem, four metaheuristics are considered: integrated multi-objective antlion optimization, multi-objective PSO, the second version of the non-dominated sorting GA, and the basic antlion optimizer algorithm.
A HEMS for energy management at the level of electricity and heat is developed in [55]. To solve the problem, a fusion between the Harmony Search Algorithm technique and the PSO is presented.
The optimal planning of various energy sources, namely, fuel cell-based micro-combined heat and power (CHP), batteries, and EVs is proposed in [56]. For this, the real coded GA technique is presented.
A HEMS for a consumer in the presence of an energy storage and PV generation is developed by authors of [57]. To solve the problem, a hybrid technique between GWO and GA is presented, named Hybrid Grey Wolf GA (HGWGA).
In [58], a HEMS is proposed for a home with demand-responsive applications, PV systems, and ESS. The Polar Bear Optimization (PBO) technique is presented.
A scheduling algorithm for the energy management of a house consisting of PV and wind systems, batteries, diesel generators, and responsive loads is proposed in [59]. To solve the problem the PSO is used.
In [60], a HEMS is proposed for a smart home. To solve the problem, GWO is proposed. The authors of [61] propose a HEMS for a household considering DER and EVs. To solve the problem, a version of the GA, the improved GA, is presented.
A HEMS is proposed in [62], for a home with renewables, wind and PV, ESS, and electric and thermal loads. To solve the problem, GA is used.
In [63], a smart grid scenario is developed with a novel restricted and multi-restricted scheduling method for the residential customers. The optimization problem is developed under the time-of-use (TOU) pricing scheme. To optimize the formulated problem, GWO is utilized.
The problem of optimal scheduling of home appliances in HEM systems is formulated as a constrained, multi-objective optimization problem with integer decision variables and a powerful variant of PSO, named as enhanced leader (EL) PSO in [64]. In the proposed multi-objective formulation, the effect of weight factor on optimal electricity bill of the home and optimal comfort of the consumers is meticulously investigated.
In [65], an optimization problem for HEMS using a hybrid approach based on cuckoo search algorithm and earthworm algorithm is developed. However, there is a problem in such HEMS, that is, an uncertain behavior of the user that can lead to forced start or stop of an appliance, deteriorating the purpose of scheduling of appliances. To solve this issue, coordination among appliances for rescheduling is incorporated in HEMS using game theory.
The min-conflict local search algorithm (MCA) is hybridized with the GWO for the power scheduling problem in smart home in [66]. The proposed method is called GWO-MCA. MCA is utilized as a new operator of GWO to improve its exploitation capability in addressing constraint satisfaction problems, particularly scheduling problems.
The authors of [67] propose a computational intelligence model for the Internet of Things applications by applying the concept of swarm intelligence into connected devices. The bee colony approach is used. The HEMS performance improvement by using a dragonfly algorithm and GA heuristicbased approach is evaluated in [68].
In [69], a new optimal method is developed for HEMS based on the Internet of Things. The problem is solved using an improved version of the butterfly optimization algorithm (BOA).
The findings of selected papers associated with heuristics and metaheuristics excluding reinforcement learning are shown in Table 14. Table 14. Findings of selected papers associated with heuristics and metaheuristics excluding reinforcement learning.

Reference
Findings [50] The hybrid versions guarantee lower costs than the mentioned heuristics. [51] The results of GA-based ESS management and traditional GA are compared. GA-based ESS management is found superior to traditional GA. [52] NAA is compared with Differential Evolutionary and PSO. NAA shows better results both in terms of obtaining results and computing time. [53] The Harris hawks optimization technique obtains the best results compared to the other techniques. [54] The integrated multi-objective antlion optimization can reduce costs by more than 80%. [55] The fusion between the two techniques demonstrates superiority compared to the separate techniques.
[56] Optimum operation of energy sources is achieved by considering various types of tariffs. [57] The HGWGA technique outperforms GWO and GA.
[58] PBO is compared with GWO and GA, showing superiority in reducing electricity and PAR costs. Still, PBO proves to be faster in terms of computing.
[59] Three scenarios are considered, ranging from an unmanaged system to the proposed planning, showing the effectiveness of the proposed model. [60] GWO is compared with other techniques. The results show that GWO allows for better results. [61] The results show that improved GA gives better results than GA. [62] The results show that the proposed methodology allows for better results.
[63] GWO is compared with the PSO algorithm to show its effectiveness. [64] The results indicate the superiority of ELPSO over basic PSO, artificial bee colony, backtracking search algorithm, gravitational search algorithm, and dragonfly algorithm. [65] The results show a reduction in electricity costs of 50%.
[66] The hybrid technique outperforms other techniques.
[67] The proposed approach shows a reduction in electricity costs.
[68] Dragonfly shows better results than GA in electricity cost reduction.
[69] The improved version of BOA is compared with PSO and BOA showing the effectiveness of the proposed approach.
The number of selected papers associated with a given objective for heuristics and metaheuristics excluding reinforcement learning is shown in Figure 10.

Reinforcement Learning (RL)
RL is one of the techniques in the heuristics and metaheuristics category that has grown the most in recent years. In this sense, a specific section on this technique is created.
A HEMS is developed in [70] using the reinforcement learning (RL) technique. Through the Q-learning algorithm, it is possible to obtain an appliance operation planning.
The authors of [71] propose a HEMS focusing on demand response. To solve the problem the RL technique is presented.
The energy management for a residential building is presented in [72]. The building has PV panels, EVs, and micro-CHP. To solve the problem, the RL technique is used.
The authors of [73] developed a HEMS for a home with electric and thermal loads, PV systems, energy storage, and EVs. To solve the problem, the RL is employed, more precisely deep Q-learning and double deep Q-learning.
The authors of [74] provide a steady price prediction model based on artificial neural networks. In cooperation with forecasted future prices, multi-agent RL is adopted to make optimal decisions for different home appliances in a decentralized manner.
In [75], based on the living habits of the residents, dependency modes for house energy resources are proposed and are integrated into the RL algorithms. Through the case studies, it is verified that the proposed method can schedule the appliances properly to satisfy the established dependency modes.
In [76], a data-driven approach that leverages RL to manage the optimal energy consumption of a smart home with a rooftop solar photovoltaic system, ESS, and smart home appliances is developed. The same authors propose a hierarchical deep RL (DRL) method for the scheduling of energy consumption of smart home appliances and DER including an ESS and an EV [109].
The findings of selected papers associated with reinforcement learning are shown in Table 15.

Reinforcement Learning (RL)
RL is one of the techniques in the heuristics and metaheuristics category that has grown the most in recent years. In this sense, a specific section on this technique is created.
A HEMS is developed in [70] using the reinforcement learning (RL) technique. Through the Q-learning algorithm, it is possible to obtain an appliance operation planning.
The authors of [71] propose a HEMS focusing on demand response. To solve the problem the RL technique is presented.
The energy management for a residential building is presented in [72]. The building has PV panels, EVs, and micro-CHP. To solve the problem, the RL technique is used.
The authors of [73] developed a HEMS for a home with electric and thermal loads, PV systems, energy storage, and EVs. To solve the problem, the RL is employed, more precisely deep Q-learning and double deep Q-learning.
The authors of [74] provide a steady price prediction model based on artificial neural networks. In cooperation with forecasted future prices, multi-agent RL is adopted to make optimal decisions for different home appliances in a decentralized manner.
In [75], based on the living habits of the residents, dependency modes for house energy resources are proposed and are integrated into the RL algorithms. Through the case studies, it is verified that the proposed method can schedule the appliances properly to satisfy the established dependency modes.
In [76], a data-driven approach that leverages RL to manage the optimal energy consumption of a smart home with a rooftop solar photovoltaic system, ESS, and smart home appliances is developed. The same authors propose a hierarchical deep RL (DRL) method for the scheduling of energy consumption of smart home appliances and DER including an ESS and an EV [109].
The findings of selected papers associated with reinforcement learning are shown in Table 15.  The results demonstrate that RL promotes good planning, allowing the purchase of energy and gas to be carried out in periods of low prices.
[73] Double deep Q-learning is compared with PSO, showing better results. [74] The results show that the strategy with demand response is better than the strategy without demand response. [75] The difference between the achieved result by the proposed approach and the optimal solution is relatively small. However, the computational time for DRL is smaller than optimization. [76] The results show a reduction of 14% in the electricity costs.
[ 109] The results show that the proposed methodology allows for better results.
The number of selected papers associated with a given objective for reinforcement learning is shown in Figure 11.

Reference
Findings [70] The RL technique is compared with Least Slack Time (LST) scheduling, obtaining better results. [71] To show the effectiveness of the proposed model, the RL results are compared with the MILP results, showing the superiority of the RL. [72] The results demonstrate that RL promotes good planning, allowing the purchase of energy and gas to be carried out in periods of low prices. [73] Double deep Q-learning is compared with PSO, showing better results. [74] The results show that the strategy with demand response is better than the strategy without demand response. [75] The difference between the achieved result by the proposed approach and the optimal solution is relatively small. However, the computational time for DRL is smaller than optimization. [76] The results show a reduction of 14% in the electricity costs. [109] The results show that the proposed methodology allows for better results.
The number of selected papers associated with a given objective for reinforcement learning is shown in Figure 11.

Other Techniques
This category includes all other techniques that do not fit into the categories presented or that have hybrid versions of the techniques described above.
Scheduling and optimal planning of appliances are approached by different authors. In [77], a HEMS for the optimal planning of appliances, energy resources, and electrothermal storage is presented. For this, the combination between the Modified Flower Pollination Algorithm and the MILP is presented.
The authors of [78] provide a new residential energy management system based on the convolution neural network (CNN) including a PV array environment. The CNN is used in the estimation of the non-linear relationship between the residence PV array power and meteorological datasets. The residential energy management system has three main stages for the energy management such as forecasting, scheduling, and real functioning. A short-term forecasting strategy has been performed in the forecasting stage based on the PV power and the residential load. A coordinated scheduling has been utilized for minimizing the cost function.
A novel framework for HEMS based on RL and employing neural networks in achieving efficient home-based demand response is addressed in [79].
A HEMS for a smart home having a PV system and battery storage is proposed in [80]. To solve the problem, a hybrid technique between stochastic programming and robust optimization is presented.

Other Techniques
This category includes all other techniques that do not fit into the categories presented or that have hybrid versions of the techniques described above.
Scheduling and optimal planning of appliances are approached by different authors. In [77], a HEMS for the optimal planning of appliances, energy resources, and electrothermal storage is presented. For this, the combination between the Modified Flower Pollination Algorithm and the MILP is presented.
The authors of [78] provide a new residential energy management system based on the convolution neural network (CNN) including a PV array environment. The CNN is used in the estimation of the non-linear relationship between the residence PV array power and meteorological datasets. The residential energy management system has three main stages for the energy management such as forecasting, scheduling, and real functioning. A short-term forecasting strategy has been performed in the forecasting stage based on the PV power and the residential load. A coordinated scheduling has been utilized for minimizing the cost function.
A novel framework for HEMS based on RL and employing neural networks in achieving efficient home-based demand response is addressed in [79].
A HEMS for a smart home having a PV system and battery storage is proposed in [80]. To solve the problem, a hybrid technique between stochastic programming and robust optimization is presented.
The authors of [81] propose a HEMS with a focus on demand response. To solve the problem, a hybrid technique between the PSO and the two-point estimate method is used. The technique is shown to guarantee shorter computation times without reducing the accuracy of the results.
The energy management for a house consisting of ESS, fuel cell and electrical and thermal loads is proposed in [82]. To solve the problem, a hybrid technique between PSO and sequential quadratic programming is presented.
A multi-objective optimization of offline strategies for HEMS is addressed in [83]. Two approaches are compared, namely the common timetable-based and the proposed approach based on decision trees. The timetable-based strategy is optimized using multi-objective GA and the tree-based using multi-objective genetic programming. The results of the latter show a reduction in costs of up to 17%.
A novel technique for managing the energy in a zero-energy building using a combination of neural networks and MPC is proposed in [84].
A combination of RL and fuzzy reasoning is employed in [85] for an effective energy management system with demand response. RL is considered as a model-free control strategy which learns from the interaction with its environment by performing actions and evaluating the results.
The authors of [86] propose the design and implementation of a fuzzy control system that processes environmental data to recommend minimum energy consumption values for a residential building. This system follows the forward chaining Mamdani approach and uses decision tree linearization for rule generation.
In [87], the implementation of a HEMS based on a fuzzy logic controller is addressed. The proposed HEMS manages the energy from the PV to supply home appliances in the grid-connected PV-battery system. Similarly, a new power management strategy based on fuzzy logical combined state machine control is developed in [88]. Its effectiveness is compared with various strategies such as DP, state machine control, and fuzzy logical control with simulation.
The findings of selected papers associated with other techniques are shown in Table 16. Reference Findings [77] The hybrid technique allows to obtain superior results in less time. Additionally, it is compared with other metaheuristics and better results are achieved. [78] The CNN is compared with other methods, proving its superiority. [79] The results show the effectiveness of the data-driven HEMS framework, both for electricity costs and computational efficiency.
[80] Robust optimization is used in the day-ahead operation and stochastic programming for the real time operation. The results prove the effectiveness of the hybrid approach.
[81] The hybrid technique guarantees shorter computation times without reducing the accuracy of the results. [82] The authors claim that this hybrid technique allows to incorporate the global search characteristics of PSO with the local search capabilities of sequential quadratic programming.
The results demonstrate the effectiveness of the proposed model. [84] The results show that the system is capable of satisfying loads without the need to import energy from the grid. On the contrary, the proposed approach allows injecting energy into the grid and having some economic return. [85] The results show that the proposed scheduling approach can smooth the power consumption and reduce the electricity costs.
[ 86] The proposed approach improved the accuracy and made the computation faster. [87] Experimental results show a fast processing time and a cost reduction of 10% when compared with a system without a fuzzy logic controller. [88] The effectiveness of the proposed approach is compared with various strategies such as DP, state machine control, and fuzzy logical control with simulation. The number of selected papers associated with a given objective for other techniques is shown in Figure 12. The number of selected papers associated with a given objective for other techniques is shown in Figure 12.

Computational Issues Considered in Home Energy Management Systems
When designing the HEMS, the decision maker must consider several factors, among which are optimal decision making and the associated computational issues. In the case of computational issues, one must consider the resources available at the level of processing the programs, the formulation of the problem, and the time window that allows new decisions to be made for the optimal HEMS operation. These issues arise because there is a need for timely decision making and because of the dimension of the problem that tends to grow into more complex problems.

Problem Size
The literature states that the increase in the problem dimension is related to several aspects, namely, with the parameters that model the considered time intervals, such as the resolution and the planning horizon, and with the number of devices considered [18].
However, other causes can increase the scale of HEMS problems. One of the causes for the increase in the dimension of problems in the field of engineering, especially in energy management in buildings, is the consideration of uncertainty. Uncertainty is an essential issue because buildings in the future, in addition to the inherent uncertainty related to load, will use renewable energy sources, and integrate EVs. Here, we are talking about the increase in the dimension of the problem due to uncertainty essentially when considering stochastic programming. When considering the representation of uncertainty through scenarios in a problem, a reasonable number of scenarios should be considered to represent the uncertainty more accurately. However, considering too many scenarios can lead to an increase in computing time incompatible with timely decision making [93]. To solve this problem, the literature has suggested scenario reduction techniques in [110] and [111]. Scenario reduction is an important branch of decision-making problems in problems involving uncertainty. The concept of scenario reduction aims to define subsets of the initial set of scenarios, i.e., to determine a set of representative scenarios that best represent the initial set of scenarios [110,111]. In the initial set, each scenario is associated with a probability. In the final set, the preserved scenarios assume new probabilities that were previously associated with the initial scenarios.

Computational Issues Considered in Home Energy Management Systems
When designing the HEMS, the decision maker must consider several factors, among which are optimal decision making and the associated computational issues. In the case of computational issues, one must consider the resources available at the level of processing the programs, the formulation of the problem, and the time window that allows new decisions to be made for the optimal HEMS operation. These issues arise because there is a need for timely decision making and because of the dimension of the problem that tends to grow into more complex problems.

Problem Size
The literature states that the increase in the problem dimension is related to several aspects, namely, with the parameters that model the considered time intervals, such as the resolution and the planning horizon, and with the number of devices considered [18].
However, other causes can increase the scale of HEMS problems. One of the causes for the increase in the dimension of problems in the field of engineering, especially in energy management in buildings, is the consideration of uncertainty. Uncertainty is an essential issue because buildings in the future, in addition to the inherent uncertainty related to load, will use renewable energy sources, and integrate EVs. Here, we are talking about the increase in the dimension of the problem due to uncertainty essentially when considering stochastic programming. When considering the representation of uncertainty through scenarios in a problem, a reasonable number of scenarios should be considered to represent the uncertainty more accurately. However, considering too many scenarios can lead to an increase in computing time incompatible with timely decision making [93]. To solve this problem, the literature has suggested scenario reduction techniques in [110,111]. Scenario reduction is an important branch of decision-making problems in problems involving uncertainty. The concept of scenario reduction aims to define subsets of the initial set of scenarios, i.e., to determine a set of representative scenarios that best represent the initial set of scenarios [110,111]. In the initial set, each scenario is associated with a probability. In the final set, the preserved scenarios assume new probabilities that were previously associated with the initial scenarios.

Planning Horizon, Resolution, and Time Steps
From a computational point of view, in HEMS design it is important to present the concepts of planning horizon, resolution, and time steps. Planning horizon refers to the period of operation that is subject to treatment and optimization by the HEMS, generally in periods of more than 1 h to days. Resolution refers to the time interval considered between each decision-making period, usually in periods of minutes to hours. Time steps are the result of the ratio between the planning horizon and the resolution. For instance, a planning horizon of 12 h is considered in [48], with a resolution of 15 min, and 48 time steps. A planning horizon of 24 h is considered, together with a resolution of 15 min, making a total of 96 time steps in [22,24,42,52,55,72]. The scheduling horizon considered ranges from 5 a.m. of day D to 5 a.m. of day D + 1. Similarly, in [21,28,32,39,50,70,112], the time horizon is also 24 h, but with a resolution of 1 h and 24 time steps. Other works propose the use of a 30 min resolution for a 24 h time horizon, which is equivalent to 48 time steps [23,27,51,61]. There are cases where optimization is performed for shorter resolution periods, e.g., 5 min for a time horizon of 24 h and consequently 288 time steps are involved [20,25,34,59]. Some authors present cases where optimization is performed for several resolution values. This is the case of [53] which compares the results for a time horizon of 24 h, but for two different resolutions: 1 h and 12 min. The work with the lowest resolution among the selected papers is [60], where the resolution is 1 min for a time horizon of 24 h and a time steps value of 1440. The authors of [19,37,46,73,113] propose planning for a longer period, in the order of days to years.

Technical Issues Considered in Home Energy Management Systems
The decision maker must also consider some important technical aspects when designing a HEMS. Namely, it must consider whether there is a need to consider uncertainty in the formulation of the problem, whether there is more than one objective to be considered, and whether it is necessary to formulate the problem as a multi-objective problem. Additionally, demand-side management strategies and the associated tariffs and incentives should also be discussed.

Uncertainty
The energy management of a house is a complex problem that requires extra attention to the components that make up the house system. Particularly, nowadays houses are increasingly based on energy production systems based on renewable energy resources due to environmental concerns. In this sense, the production of energy from renewable sources implies greater flexibility in energy management systems, as the forecast of its production is never perfect. Additionally, the load, i.e., the power consumption and the electricity market prices also have random and difficult to predict behaviors. In recent years, yet another source of uncertainty has begun to hover over electrical systems and HEMS, the integration of EVs, many of them as bidirectional devices, with grid-to-vehicle and vehicle-to-grid capability.
Proper representation of procedures through mathematical descriptions cannot always be formalized using deterministic formulations. In the real world, it is expected that situations occur where the representation of parameters through their average values is not favorable. The literature presents solutions for non-deterministic environments to include the treatment of uncertainty. According to [114], decision making considering the treatment of uncertainty can be divided into three types, according to the environment: decision making with random parameters in which the probability distribution function is known; decision making with parameters where there is no information about the probability distribution function; and decision making based on fuzzy sets theory, with uncertainty in parameters' fuzzy numbers and in constraint fuzzy sets.
To reduce the effects of uncertainty in a house, some techniques are presented in the literature to solve this issue that can technically and economically affect the operation of energy management systems in houses.
In environments where the probability distribution is known, the use of stochastic programming techniques is suggested, namely two-stage stochastic programming and multi-stage stochastic programming. Thus, in [32] the uncertainty management using two-stage stochastic programming is presented. In the day-ahead stage, the proposed residential energy management system considers uncertainty for electricity price and PV generation modeled by interval-based scenarios. In the real-time stage, the uncertainty is modeled by scenarios. There are 4 scenarios for day-ahead stage and they have the same probability, while for real-time stage 10 scenarios are considered, with variable probability.
The authors of [33] addressed the uncertainty related to energy production, with load consumption and with electricity prices. For each hour of the day, 10 scenarios are generated for each of the uncertainty sources.
The authors of [34,36] addressed the uncertainty related to PV power output and load, and wind power and load, respectively. For each uncertainty resource 6 scenarios are generated, making a total of 36 scenarios. The probabilities of the scenarios are variable.
Some works consider the need to reduce the number of scenarios when there is a high degree of uncertainty. This is the case of [35] where 1500 scenarios are generated to represent PV power behavior, ambient temperature, and load behavior. Due to the high number of scenarios, the number of 1500 scenarios is reduced to 15 new scenarios by applying the backward method scenario reduction technique, to which new probabilities are assigned.
The authors of [38] also used scenario reduction when considering uncertainty of PV power. The scenario generation is based on a seven-step distribution model for a Gaussian distribution, resulting in a total of 4096 scenarios. This value is reduced to 10 scenarios using the backward reduction method proposed by [110]. The proposed technique is compared with Monte Carlo Simulation (MCS) and two-point method. However, to obtain a cost like the proposed technique, the MCS must increase the scenarios from 50,000 to 500,000, but that obviously implies a very large increase in computation time. Additionally, considering the two-point method that generates 48 scenarios, there is no guarantee of representing the uncertainty in the best way.
In [39], the uncertainty is associated with mobility pattern of EVs and wind power. The scenarios are generated by an Autoregressive Moving Average (ARMA) and reduced by 10 scenarios by K-means clustering technique.
The uncertainty associated with PV power, wind power, load, and electricity price are addressed in [37]. A maximum of 450 scenarios is considered to represent uncertainty, as, according to the authors, computing time can increase significantly.
The authors of [40] consider uncertainties of EVs availability and small-scale renewable energy generation, PV power, and wind power. Parameter realizations with uncertainty are modeled through roulette wheel mechanism (RWM).
In [41], the uncertainty in PV power and energy demand is considered. In total, 10 scenarios of sources of uncertainty are considered.
In environments where the probability distribution is not known, the use of robust programming techniques is necessary. Thus, in [43] the uncertainty management using robust programming is presented. Uncertainty is related to electricity market prices. In this work, it is stated that the use of stochastic programming is not the ideal technique to model the uncertainty of market prices, because the probability density functions may not correctly represent the price behavior with the integration of renewable sources. Furthermore, it is said that the best way to access market price uncertainty without using historical data is by considering the worst case, obtained through robust optimization.
A robust optimization approach is considered to deal with the uncertainty on energy supply, based on wind power and the uncertainty of thermal and electrical loads by the authors of [44]. It is stated that robust optimization approaches can be better suited for assuming that the parameters are within some limits, which is more general than assuming a known distribution of parameters. Furthermore, it is found that historical data can be important for updating the limits, and that robust optimization is more suitable for problems that involve risk, as they assume that the scenarios are the worst-case scenario within the parameter limits.
Fuzzy decision-making environment is the last group. In this environment, according to [114] two types of uncertainty exist, including ambiguity and vagueness. Ambiguity refers to the situation where the choice among multiple alternatives is undetermined, while vagueness refers to the case in which sharp and precise boundaries for some domains of interest are not delineated.

Multi-Objective Problems
Usually, the management of a home is presented in the literature only to respond to a single objective, or formulated only for the electrical part, or for the thermal part. However, in many cases, researchers consider multiple objectives to be achieved simultaneously, as was possible to see in the summary of many of the works presented in the previous sections. In the literature, multiple objectives are presented simultaneously, as minimization of energy costs and user comfort [24], minimization of energy costs, PAR and user comfort [50,53,54], minimization of energy cost and emissions [77], minimization of energy costs and PAR [50,57], and minimization of energy costs and battery degradation [59]. However, these papers do not present the formulation in the conventional form of multi-objective problems, that is, problems with multi-objective formulations. Thus, in a multi-objective problem we are in the presence of more than one objective to be maximized or minimized following specific rules. The most used techniques in the specialized literature on HEMS when there is a multi-objective problem are weighted sum and the representation technique Pareto Front. However, outside the specialized literature on HEMS, other techniques such as bounded objective and physical programming are used for multi-objective problems [18].

Weighted Sum
In weighted sum, the formulation of the problem consists of the definition of an objective function composed of two or more objective functions, and to each of these objective functions a scalar is added that aims to define the weight that each will have in the final value of the resulting objective function. Generally, the objective functions that make up the scalar objective function are functions that concur with distinct or conflicting objectives. The sum of the weights of each of the objective functions typically assumes the unity value. It is considered the simplest way to formulate multi-objective problems due to its simplicity, but the value of the objective must be linearly scalable [18].
For instance, a multi-objective problem is formulated by the authors of [70], aiming to minimize electricity costs and minimize the discomfort wait cost. A coefficient is used to balance the cost of electricity with the discomfort wait cost.
Similarly, the HEMS proposed in [20] is formulated as a multi-objective problem, employing as minimization objectives the energy consumption expense and comfort deviation. A total of 11 groups of combinations between the coefficients that model the weight of each objective are considered. It is verified that this formulation allows flexibility to adjust the results according to user preferences.
A problem formulated to answer multiple objectives is presented in [28], namely, energy costs, user's convenience, consecutive waiting time, and PAR. At this stage, the goals all have the same weight as they do not have associated coefficients. However, given the results obtained, it is verified that it is in the user's interest to associate a higher weight to some of the goals. Thus, in a second phase, coefficients are associated to each objective, resulting in a multi-objective problem using the weighted sum technique. It is concluded that this technique allows easier access to specific requirements of residents.
The authors of [23] formulate the model as a multi-objective problem that is converted into a single objective problem by a linear combination of two objective functions. The two conflicting goals are the reduction in energy costs and the reduction in peak load demand.
In [22], the HEMS is formulated as a multi-objective problem using weight coefficients for two distinct objectives, as are user's comfort and the total operating cost which are negatively correlated.
An original problem is proposed in [46] with three different objectives, namely, selfconsumption, user comfort, and grid support. To formulate the problem, three coefficients are considered that model the weight of each individual objective. The authors state that this work presents an innovation, as the three weights can be permanently adjusted and used in the next simulation step.
The authors of [60] claim that the formulation of the scheduling problem as a single objective may lead to some issues in balancing the power demand and improving the user comfort level due to the larger effort on minimizing energy cost in detriment of the other objectives. Therefore, a multi-objective formulation is proposed, having four objectives to minimize, namely the cost of electricity, PAR, capacity power limit rate, and waiting time rate.
In [44], the energy management of the residential buildings is formulated as a multiobjective problem, considering two objectives, namely operating and CO 2 emissions costs. Using the weighted sum technique, two weights are employed to control the impact of the system operation and the total emissions on the total cost of the system; thus making it possible to make a trade-off between the environmental impact and the economic impact.

Pareto Front
In multi-objective problems it is important to introduce a fundamental concept which is the Pareto Front concept. Pareto Front refers to a trade-off curve where all the optimal values of a multi-objective problem are based [115]. This curve has the function of offering the decision maker a set of optimal solutions on which it then decides which one is closest to its ambitions [114,115]. Thus, in a Pareto Front, with two conflicting objectives, one can only get a higher value for one of the objectives if the other decreases. For instance, in [62], the HEMS is formulated as a multi-objective problem using the Pareto front technique. The two objectives in dispute are the minimization of energy consumption and the minimization of energy costs. To show the effectiveness of the formulation, the Pareto Front results are compared with the results obtained by the multi-objective problem formulated with weighted sum. The results of Pareto Front are superior to those of weighted sum, achieving, in many cases, a reduction in cost of about 25% while an increase in the use of renewable sources is achieved.
The objectives associated with multi-objective problems obtained from the list of selected papers are shown in Table 18. Table 18. Objectives associated with multi-objective problems from the list of the selected papers.

Reference
Objectives Weighted Sum Pareto Front [70] Minimization of electricity costs and of discomfort wait cost 1 [20] Minimization of energy consumption expense and comfort deviation 1 [28] Minimization of energy costs, maximization of user's convenience, minimization of consecutive waiting time, and minimization of PAR 1 [23] Minimization of energy costs and reduction in peak load demand 1 [22] Maximize user's comfort and minimization of operating costs 1 [46] Maximize self-consumption, user comfort, and grid support 1 [60] Minimization of electricity costs, PAR, capacity power limit rate, and waiting time rate 1 [62] Minimization of energy costs and of energy consumption 1 [44] Minimization of operating cost and CO 2 emissions 1 Table 18 shows that in most of the selected papers the formulation is based on multiobjective problems using the weighted sum technique.

User Behavior
When developing HEMS, user behavior must also be taken into account. Several issues can be addressed within the scope of user behavior, namely: the number of occupants in the house, which can result in a significant increase in energy consumption; the availability of users to participate in demand response strategies; and the behavior of users with electric vehicles, which is a trend that is here to stay. For instance, in [20] six types of uncertain user behaviors are considered, which are separately modeled through energy consumption deviation. These six types of behaviors form the set of uncertain behaviors that allow predicting the needs of users. A scheduling algorithm based on human-appliances interaction in smart homes is proposed in [70]. This strategy of considering humanappliance interaction proves to have good results. In [45], user behavior is introduced in the model of a HEMS, through historical data extracted from a smart meter. It is also stated that constraints may arise in data acquisition in buildings due to privacy issues when considering user behavior. In [21], an electric vehicle charging management system is integrated into a HEMS, taking into account the behavior of electric vehicle owners. To model the stochastic behavior of electric vehicle holders, the uncertainty formulation takes into account the arrival and departure periods of electric vehicles.

Demand Response and Pricing
Electric systems were characterized a few decades ago, in the previous paradigm, as being essentially centralized and with little or no user action. Currently, there is a paradigm shift towards a network where the user can assume some status to be able to contribute to decisions related to the electrical system. In this sense, one of the clearest examples of this paradigm shift are the incentives that aim to encourage the user to reduce or change energy consumption. Here, we enter the field of demand response, which is defined as changing the profile of energy use by users based on dynamic electricity prices or other incentives to improve the efficiency and reliability of the power system [7]. Demand response programs take the form of time varying pricing or rebates because of changing the demand profile compared to the forecasted base value [116]. In this sense, demand response programs are commonly classified as price-based or incentive-based programs [6,7,116]. According to [6], both categories aim to minimize the energy bill for the users, with the following differences: in price-based programs, demand is adjusted to network prices according to user preferences, namely, TOU price, real-time price (RTP), critical peak price (CPP), and inclining block rate (IBR); while incentive-based programs can be divided into voluntary-direct load control (DLC) or emergency demand response program (EDRP); mandatory-capacity market program (CAP) or interruptible/curtailable services (I/C); and market clearing-demand bidding (DB) or ancillary services (A/S).
TOU is a widely used pricing scheme, characterized by being made up of two or three different price periods over the course of a day. In the case of two prices, the first refers to the price for off-peak periods and the second to peak periods [7]. The three-price case consists of low-peak, mid-peak, and peak periods [7,117]. In many cases, the TOU is characterized by having an associated seasonality, and it is usual for the hours of application of these prices to vary, for example, in summer and winter. Additionally, the timetable for these prices varies with the day of the week, with weekdays having one cost and Saturday and Sunday other costs. This is the case for companies operating in Portugal.
For instance, in [112] the TOU is applied as a pricing scheme together with RTP or for fixed prices. The TOU guarantees the greatest reduction in operating costs and the fixed price the highest cost. Furthermore, the TOU guarantees the greatest exchange of energy with the grid and the RTP the lowest value.
A typical Moroccan household is managed with a HEMS considering the TOU in [27]. The step-rate tariff is considered, which together with the TOU are the two most used price schemes in Morocco.
The TOU is one of the pricing schemes proposed in a HEMS to manage a house considering demand response in [45]. The TOU is compared with hourly pricing and five minutes pricing. The result of one year of operation shows that the TOU allows cost savings of up to 26%, a value higher than that obtained by the hourly pricing. However, the results demonstrate that the real-time five minutes pricing allows cost savings of up to 42%. These results are said to show the effectiveness of the TOU and RTP.
CPP is a pricing scheme very similar to the TOU, considering two distinct periods, off-peak and peak periods, just like the TOU, with the difference of considering two periods, one of extremely high demand values and another with relatively low demand [7,117]. The existence of extremely high demand periods causes prices to follow this behavior, which leads to CPP prices being higher than the TOU. CPP is a very specific case of price, as it refers to days where less usual demand profiles are seen, characterized by very large peaks.
RTP is a pricing scheme where prices vary hourly, and there can be very large differences between the price of one hour and another hour. Two types of RTP are generally considered, namely, day-ahead pricing and hourly pricing [7]. In the case of day-ahead pricing, the prices for each hour of day D are defined on day D − 1. This price is closely related to the hourly prices that are defined in the day-ahead electricity market and that reflect the marginal price, resulting from the crossing of the energy purchase and sale curves. The hourly price is defined by prices revealed every hour [7]. Day-ahead pricing is the most suitable for consumers, as they know a priori the price of each hour, allowing for timely planning and with a greater degree of certainty [7,117].
For instance, the RTP scheme is subscribed by a user of a home in Illinois, US, in [51]. The next 2 h RTP signal of each period is available for the consumer through a smart meter. The developed HEMS has the capability of bi-directional operation, being able to sell energy to the network at half the price of the RTP scheme.
The RTP scheme is used in [54] to measure the energy costs of a home. The RTP scheme is compared with CPP scheme. The problem is formulated as a multi-objective problem that analyzes the effects of each of the tariffs on each of the objectives, which are the electricity cost and the PAR. The results show that the electricity cost is reduced by 75% and 80% when using RTP and CPP, respectively. Regarding PAR, it is reduced by 35% and 30% using RTP and CPP schemes with respect to the unscheduled case.
Similarly, RTP and CPP schemes are used in [57] in a HEMS. The electricity cost has been reduced by up to 43% when only the RTP scheme is considered. By incorporating the CPP scheme, the cost of electricity was reduced by up to 63% and the PAR reduced by up to 38%.
Inclining Block Rate (IBR) is a pricing scheme where the price increases with increasing energy consumption. Thus, an increase in energy consumption that exceeds the value defined for an hour, a day, or a month result in an increase in the price to be charged [7]. This pricing scheme forces users to be more careful in how they consume energy over a given period. The IBR scheme is used in conjunction with other price-based demand response schemes in a HEMS in [41]. The other pricing schemes evaluated are RTP, CPP, and TOU. The results show that the RTP scheme is the best method applied, as it simulates real market conditions. It is said that with the TOU, as there are no penalties, it is only effective for cases with low consumption values. Furthermore, it is claimed that the IBR together with the TOU scheme can solve the problem of over-consumption using the price signals.

From HEMS to Energy Communities
Although the focus of this work is not energy communities and microgrids, we briefly present here the developments that have been made in these areas in recent years, as those are a very hot topic of research and application An energy management system for a residential microgrid with a micro-CHP unit, photovoltaic generation, hybrid vehicles, and ESS is proposed in [112]. The objective is to minimize the energy costs associated with the purchase of energy from the grid, and with the cost of natural gas. The transaction is compared for various pricing scenarios, namely, TOU, RTP, or for fixed prices.
The authors of [113] propose the comparison between a management system for a house and a community. Systems must manage energy from thermal and electrical points of view. The problem is formulated as a multi-objective system, where the objectives are the minimization of operating costs and emissions. The system is applied for a planning horizon of one year and one week. It is concluded that the Community Management System is better than the Management System for a house, both economically and environmentally. It is stated that neither the Home Management System nor the Community Management System is economically viable at this time, unless the size of the ESS is reduced, and the thermal energy capacity increased.
In [103], a review of microgrid control and optimization in terms of objectives, constraints, and optimization techniques is presented. The components of the microgrid, the advantages for the grid and for the final consumers are also presented.
Another review is presented in [118] regarding power generation systems for microgrids for residential applications. Greater attention is paid to DC microgrids. The technical differences and strategies used in energy management systems in microgrids are presented.
A hierarchical energy management system is proposed for a set of building microgrids that together form an energy community in [119]. Each building has a building energy management system that optimizes the operation considering local information and price information. Next, at the highest level, the community energy management system is responsible for managing the operation between all building microgrids and then with the main network. This sequence of decision making allows the minimization of the operation costs of the problem formulated as a MILP problem. A system for planning the operation of a microgrid is presented in [120]. The microgrid consists of several participants with renewable production and EVs. The technique used to find the optimal solution is the multiagent RL. Multi-agent RL is compared to single-agent RL, demonstrating the superiority of the former. The authors of [104] addressed an energy management system for a commercial microgrid that includes renewable production from wind and the inclusion of EVs. The paper's biggest contribution is the consideration of electricity price uncertainty in an MPC. Furthermore, the risk is considered through the Conditional Value at Risk (CVaR) measure. The objective is the minimization of operating costs. It is verified that EVs have an effective contribution to the microgrid energy balance.
In [121], an energy management system for microgrids consisting of a set of buildings, ESS, EV, and renewable energy sources is presented. The PSO is applied to find a solution to the problem that aims to minimize costs. The results demonstrate a significant reduction in costs.
A fuzzy logic-based energy management for microgrids connected to the grid is developed by the authors of [122]. The system includes renewable sources and energy storage. The goal is to minimize power fluctuations in the network, while maintaining the battery state of charge within predefined limits.
Similarly, in [123], a fuzzy logic controller is applied in the EMS of microgrids by considering dramatic behavior of renewable energy resources while maintaining battery state within secure limits. A comparison with the time-based constant and variable charge/discharge control of battery demonstrates, in simulation, the effectiveness of the proposed fuzzy controller in a residential AC microgrid. An energy management system is presented for a hybrid residential microgrid consisting of a diesel generator, wind turbine, PV system, and battery energy storage in [124]. The objectives are to minimize costs, reduce emissions, and increase the penetration of renewable sources. The problem is solved using PSO. The results demonstrate that there can be a reduction in emissions of more than 35% in the optimal configuration compared to the scenario where diesel generators are responsible for satisfying all demand.
A risk-averse energy management system for large-scale industrial building microgrids is presented in [125]. The objectives are to minimize operating costs and minimize greenhouse gas emissions. To solve the problem, a hybrid technique between the flower pollination algorithm and MILP is applied. It is noted that this hybrid version is applied because the techniques compensate for the limitations of each one, namely the disadvantage of obtaining an optimal location with the flower pollination algorithm and the size of the problem for the MILP. The results show that the proposed hybrid technique outperforms other techniques such as GA and simulated annealing.
The authors of [126] propose an energy management system of a building microgrid with the objective of minimizing energy costs, considering thermal comfort. The system uses the MPC to define the optimal operating points. The results allow for the reduction in operating costs.
A model for the optimal integration of building microgrids based on renewable sources, EV, and batteries in the electricity market is proposed in [127], namely, in the day-ahead market and in the regulated market. The objective is to maximize the profit of building microgrids through participation in the electricity market. The problem is formulated as a MILP problem. The results demonstrate the increase in profit, the reduction in renewable energy curtailment, and decrease in power in peak hours compared to the case where there is no optimization.
Stochastic programming is applied in an energy management system for grid-connected building microgrids considering uncertainty of PV power and the stochastic behavior of EVs in [128]. The system based on stochastic programming is compared with deterministic programming, showing that the former guarantees the minimization of electricity costs.
In [129], an energy management system for a residential microgrid with PV generation and battery energy storage is presented. The aim is to minimize electricity costs. PSO is used to solve the problem. The PSO when compared with other techniques allows better results to be obtained.

Conclusions
This review article provided a comprehensive systematic review of published works considering HEMS techniques, technical and computational issues. The results of the systematic review resulted in the division of techniques used in HEMS systems into four categories: traditional techniques, MPC, heuristics and metaheuristics, and other techniques. The authors conclude this document by presenting the discussion of the following points identified through the development of this work, and that should be highlighted: − IEEE Access (IEEE) is the journal with the biggest number of documents published within the review criteria, followed by Energies (MDPI) and Applied Energy (Elsevier). Within the considered period, 2020 was the year when most documents were published. − The reviews published between 2018 and 2021 focused mainly on broader concepts and enabling technologies presentation, HEMS architecture, benefits for the energy grid, and specific components of HEMS or methods, as reinforced learning. − There is a variety of documents being published on the topic of HEMS. However, when addressing specifically the HEMS techniques, many studies were excluded from the review due to the lack of information on the applied method itself. − Although not being a specific search term, most of the articles have as an objective the reduction in the economic costs related to residence power consumption. − The statistical analysis of the data showed that the most used technique is the category of heuristics and metaheuristics, followed by traditional techniques. In fact, this was an expected conclusion since with the development of systems that emulate the behavior of nature and the development of Artificial Intelligence, it has seen an exponential growth in recent years. Thus, it is expected that in the future these systems will continue to play an important role in HEMS design. − It is also important to highlight the traditional techniques, based on exact algorithms and solved by commercial solvers, which guarantee a global optimum when formulated as linear problems. This is an advantage of traditional techniques and should not be overlooked. With the evolution of computational power and the reduction in computing time, these techniques will continue to play an important role in the future of HEMS. − The MPC will also be an important player as it can contribute to limiting the uncertainty that characterizes HEMS. − MATLAB is the simulation platform most used for the development of selected works, but some works also used GAMS and Python, among other punctual uses of other platforms. − In computational issues, it is verified that most of the papers address the issue of operation planning using HEMS using a 24 h planning horizon and a 1 h resolution. It is expected that in the future there will be a need for optimization systems that plan for values of less than one hour to obtain a more reliable optimization. − Some documents, despite clearly presenting the HEMS technique being used, did not present in detail the simulation setup used, which may make the method complicated to replicate. The application of the same method for the same case study/data set may have different results according to the assumed simulation setup, such as planning horizon, resolution, and time steps. We advise the clear presentation of this setup in future publications. − Uncertainty is also a very important factor to consider in HEMS systems, especially when it integrates renewable energy resources and their forecast. − Most HEMS ideally should have a multi-objective approach, once the social component related to the occupants' preferences is as important as the energy savings or other objectives intrinsically related to grid or system benefits. − Overall, the works published on HEMS are very focused on the adaptation of the adopted framework to the case study in which it is applied, and ideally there should be more studies focusing on the assessment of generalization of the methods for other datasets (residential buildings with different occupation patterns, equipment usage, among others). The good performance of the HEMS generalization assessment contributes as a basis to the commercialization of these solutions.
− The performance assessment metrics of a HEMS-how good is the HEMS for a determined case study-should vary according to the objectives of the system, considering the compromise between accuracy, computational resources, computational time, among others.
Although this review followed all the rules presented in Section 2, this work has some limitations. From the outset, the fact of considering selected papers from the year 2018 forward on the Web of Science platform. This decision was made as the optimization in the HEMS area has grown rapidly and we aimed to present a systematic and recent review that could provide an overview of what has been done in recent years. As a result, some important papers in the area may have been missed. However, we presented throughout the text, and, in Table 1, the review papers that were previously undertaken in this area and that include papers earlier than 2018.
We found that it is very difficult to compare the results obtained with different technologies, and even with different approaches using the same technology. This is due to the complexity of the problem, the multiplicity of the different factors intervening in a HEMS, and the lack of public databases in this topic that can be used by different researchers to assess their different technologies. In this sense, in [130] the reader can find several data related to a group of houses located in the South of Portugal, with HEMS, renewable energy, and energy storage.
As this work was focused on HEMS techniques, nothing was mentioned regarding the necessary infrastructure to implement the HEMS, quite often obtained by IOT techniques. Additionally, to implement HEMS techniques efficiently, one should be able to detect which appliances are working, preferably using Non-Invasive Load Monitoring (NILM) methods. These are important topics for an overall view of HEMS.
Another limitation is the absence of a complete review of microgrids and energy communities. We only briefly present the link between HEMS, energy communities, and microgrids. In the future, from our point of view, it is expected that management systems for energy communities will become the rule rather than the exception as it has been until now. This will happen because with the opening of the market and with greater decisionmaking power of the prosumers, they will aggregate to start managing their energy on a larger scale and perhaps enter the market in the form of clean energy aggregators. When a large community of buildings is considered, its management involves typically the fast processing of a large quantity of data, precluding, this way, the use of big data platforms.

Conflicts of Interest:
The authors declare no conflict of interest. The number of citations and location of selected articles with at least five citations is shown in Table A2.