Uniﬁed Algorithm for Demand-Side Appliance Commitment

: Recent energy efﬁciency and conservation programs have created an unprecedented demand for home energy management systems (HEMS) in the residential sector aimed at reducing electricity consumption and saving on electricity bills. This paper gives a brief review of the basic algorithms found in the literature for HEMS that target optimum scheduling for home appliances participating in demand response (DR) programs. The working principles, as well as the pros and the cons, of these algorithms are explained and analyzed. Then, a uniﬁed algorithm to manage the hourly power consumption of home appliances on a daily basis is suggested using two scenarios. The ﬁrst scenario aims to simultaneously achieve dual utility/customer beneﬁts while avoiding the individual drawbacks of each presented algorithm. The second scenario aims to actively involve DR customers in making the optimum decision regarding their appliances in the face of their dynamic desires. The proposed algorithm is generic in the sense that it has the ability to achieve three different objectives for dual utility/customer beneﬁts. Moreover, the paper takes into consideration a range of constraints, such as load priority, customer preferences, utility request, and electricity dynamic pricing scheme. The essential goal of this algorithm is not only to curtail or control the power consumption of appliances but to also shift it to a better price period based on different tariff rates. The results reﬂect the effectiveness of the proposed algorithm, which extends the previous ﬁndings in the literature by considering a wider range of limitations applied on HEMS.


Introduction
The world energy consumption, defined as the total energy used by the entire human civilization, is on the rise. It has more than doubled in the last 40 years and is projected to increase by up to 30% by 2030 [1]. Electric power systems are encountering more frequent stress conditions due to this rise in electricity demand. Repeated outages of transmission lines, which are likely to occur during critical peak hours, have been a major cause of electric grid stress. This has led to concerns among governments about significant power disruptions. At the same time, investment in the electrical infrastructure has struggled to keep up with increased demand to avoid system failures. Such events may cause a supply limit situation, where cascading failures and large-area blackouts are possible. These problems have consequently created a strong incentive for adopting energy efficiency initiatives and conservation plans [2]. Moreover, reducing energy use is not only one of the surest ways of lowering carbon emissions, but it also helps in saving money [3].

HEMS Algorithms Based on Load Power Curtailment
Power curtailment is the basic approach for home appliance management, and the main idea of this type of algorithm is that appliances are normally turned off in the event of a DR event according to the demand limit signal from the utility company and depending on predefined customer preferences (load priority and comfort level). Based on this concept, Amer et al. [18] proposed an algorithm that is capable of reducing the overall consumed power of a household by managing its appliances based on a predefined appliance priority. Pipattanasomporn et al. [19] presented a HEMS algorithm that manages and controls the consumption of certain household appliances to guarantee the total energy consumption below a certain level during a DR event and according to predefined customer preferences. These preferences not only include load priority but also involve preset customer comfort level. Many research works have evolved around the same idea (see, for instance, References [20,21]), where the overall power consumption of a single or group of houses are kept below the sanctioned level, with minimum comfort violation. Kuzlu et al. [20] sets up a hardware demonstration to validate the proposed algorithm by Pipattanasomporn et al. [19]. The experiment indicated the effectiveness of the proposed HEMS in monitoring and controlling household appliances under the suggested DR algorithm. Various practical and implementation aspects for different HEMS algorithms have also been discussed in the literature. For example, communication time delay and its energy consumption were analyzed in Reference [20]. A low-power wireless personal area network (6LoWPAN) communication protocol that enables IPv6 over IEEE802. 15.4 standard was adopted in Reference [22] instead of frequently used protocols such as ZigBee and Z-Wave. The commercial viability of the HEMS hardware setup was studied in Reference [23], where a low-cost home automation system that is capable of controlling and managing both the home appliance comfort level and energy consumption was proposed.
In Reference [21], small changes in the abovementioned approaches for curtailment-based HEMS were explored Although the same load types of References [19,20] were utilized here, a dynamic load priority was adopted instead of fixed load priority. This enabled the authors to demonstrate dynamic load management by changing the priorities of loads to be curtailed during a DR event.
Despite the partial success of HEMS algorithm based on power curtailment in general, this algorithm may be characterized by three main drawbacks. The first is the direct and complete cutting off of the scheduled load with lower priority; the second is the high off-peak demand that results just after a DR event period due to consumers compensating for the curtailed load; and the third relates to the possible violation of customer comfort degree under some circumstances of low

HEMS Algorithms Based on Load Power Curtailment
Power curtailment is the basic approach for home appliance management, and the main idea of this type of algorithm is that appliances are normally turned off in the event of a DR event according to the demand limit signal from the utility company and depending on predefined customer preferences (load priority and comfort level). Based on this concept, Amer et al. [18] proposed an algorithm that is capable of reducing the overall consumed power of a household by managing its appliances based on a predefined appliance priority. Pipattanasomporn et al. [19] presented a HEMS algorithm that manages and controls the consumption of certain household appliances to guarantee the total energy consumption below a certain level during a DR event and according to predefined customer preferences. These preferences not only include load priority but also involve preset customer comfort level. Many research works have evolved around the same idea (see, for instance, References [20,21]), where the overall power consumption of a single or group of houses are kept below the sanctioned level, with minimum comfort violation. Kuzlu et al. [20] sets up a hardware demonstration to validate the proposed algorithm by Pipattanasomporn et al. [19]. The experiment indicated the effectiveness of the proposed HEMS in monitoring and controlling household appliances under the suggested DR algorithm. Various practical and implementation aspects for different HEMS algorithms have also been discussed in the literature. For example, communication time delay and its energy consumption were analyzed in Reference [20]. A low-power wireless personal area network (6LoWPAN) communication protocol that enables IPv6 over IEEE802.15.4 standard was adopted in Reference [22] instead of frequently used protocols such as ZigBee and Z-Wave. The commercial viability of the HEMS hardware setup was studied in Reference [23], where a low-cost home automation system that is capable of controlling and managing both the home appliance comfort level and energy consumption was proposed.
In Reference [21], small changes in the abovementioned approaches for curtailment-based HEMS were explored Although the same load types of References [19,20] were utilized here, a dynamic load priority was adopted instead of fixed load priority. This enabled the authors to demonstrate dynamic load management by changing the priorities of loads to be curtailed during a DR event.
Despite the partial success of HEMS algorithm based on power curtailment in general, this algorithm may be characterized by three main drawbacks. The first is the direct and complete cutting off of the scheduled load with lower priority; the second is the high off-peak demand that results just after a DR event period due to consumers compensating for the curtailed load; and the third relates to the possible violation of customer comfort degree under some circumstances of low demand limit signal from the utility company. These drawbacks can be alleviated by adjusting the algorithm objectives to either load power control or load power shifting.

HEMS Algorithms Based on Load Power Control
The main difference in this approach is that it does not totally sacrifice customer comfort by shedding their loads; instead, it tries to partially satisfy customer preferences by controlling the load operational time and, hence, controlling energy consumption. This approach improves the utilization efficiency of appliances and increases the overall capability of the system. Consequently, it increases the lifetime of appliances and reduces potential damage from directly cutting off the main supply. For example, it may increase the air conditioning (AC) temperature set point, giving the AC unit the chance to be OFF for a longer time according to its priority, thereby decreasing its ON period and the energy drawn by the AC unit. Saha et al. [24], tried to relax the customer preferences limit of the AC and therefore reduce the total power consumption of the AC unit instead of curtailing the load. In this study, a smart thermostat was included in the HEMS to allow flexibility in room temperature control. This prevented the room temperature from rising above a certain acceptable range but helped reduce electricity grid stress situations while ensuring customers' comfort preferences. Parithi [25] used the same load types and the same load priority as in References [19,20,24], but the proposed algorithm had the benefit of controlling the power consumed in different loads instead of cutting them out completely. The drawbacks of approaches based on load power control are threefold. Firstly, this algorithm is implemented with the aid of an additional hardware component, such as a smart thermostat, which may increase the overall cost of large-scale applications. Secondly, this algorithm is only applicable for thermally controlled appliances, such as AC and water heaters (WH). Thirdly, this algorithm does not take into account the full monetary benefit that can be achieved for customers by deferring the load to a low price period.

HEMS Algorithms Based on Load Power Shifting
In this approach, the HEMS algorithms depend on different factors for organizing the daily load pattern. For instance, they shift loads by incorporating utility tariffs based on various pricing schemes, such as time of use, critical peak, and real time, with two ultimate objectives: relieving the stress on the power system network and providing electricity consumers significant monetary savings.
Boynuegri et al. [26] developed a load management mechanism based on a DR event model and multirate tariffs to respond to utility peaks and decrease energy bills for consumers by shifting loads to cheap tariff periods. Chavali et al. [27] adopted an algorithm that schedules the appliance operation as per the price signal. This model assumes that all the appliances are operating in specific modes and that the appliances can switch between various modes depending on the energy consumption. Amer and El-zonkoly implemented another HEMS algorithm [18] using an Arduino microcontroller. Besides managing the end-use appliances as per their preset priority to reduce the total consumption under a certain limit, the algorithm also achieves the purpose of clipping the peak-to-average ratio (PAR). Another approach was outlined in Reference [28], where a scheduling method for a home network based on a smart grid was introduced. To avoid high PAR, the authors combined the real-time pricing model (RTP) with the inclining block rate (IPR) model to reduce electricity bills and strength the stability of the electricity grid system. In Reference [29], the authors were concerned more with the impact electric vehicle charging may have on overloading distribution transformers. Thus, they proposed a DR strategy by performing load scheduling and shaping, thereby avoiding problems related to transformer overloading.
However, all the HEMS approaches discussed in this section are incapable of achieving simultaneous dual utility/customer benefits. The curtailment-based algorithms can participate in restoring the balance between production and consumption but they do not achieve energy bill savings for consumers. The HEMS algorithms based on load power control avoid direct cut-off of the home loads and thereby prevent violation of customer preferences, but they can only be applied on certain appliances. Moreover, they have the tendency to increase the system cost of large-scale applications. The load power shifting HEMS algorithms can effectively respond to the utility request by taking into account monetary savings for customers. However, unfortunately, they do not take into consideration the sequential operation of some daily activities, which may lead to inappropriate operation of home appliances and increase what is called "inconvenience cost" [30].
In this work, three basic energy management algorithms for home appliances that are generally used with customers who actively engage in demand response programs are studied. The operational performance of home appliances in achieving customer and utility benefits under these algorithms are analyzed. The advantages and disadvantages of each algorithm are further evaluated. Hence, a novel algorithm based on blending these three algorithms is proposed. The main idea behind this unified algorithm is to incorporate the identified advantages of each algorithm while avoiding the shortcomings of the different algorithms. The main contribution of this paper is that it examines the current home energy management algorithms found in the literature and proposes a novel algorithm structure that combines three established HEMS algorithms-load power curtailment, load power control, and load power shifting-to achieve dual benefits for customers and the utility company. The primary advantages of this new algorithm are as follows:

•
The proposed algorithm extends the results in the literature and addresses different shortcomings in other basic algorithms, such as peak rebound, appliance direct cut off, and appliance shifting to higher price period.

•
The proposed algorithm equips both the customer and the utility company with the proper capability to play an active role in reducing energy consumption and home electricity costs while easing network supply limit conditions.
The paper is organized as follows. Section 1 gives a generic introduction of the three main kinds of HEMS algorithms, its objectives, and various constraints of such algorithms. A classification of home load appliances is performed in Section 2, where the mathematical model and the daily profile for specific load appliances used in the simulation are explained. Section 3 discusses the basic concept of each surveyed HEMS algorithms and suggests a novel technique called "unified algorithm". Different HEMS algorithms are validated and analyzed in Section 4. Finally, conclusions are drawn in Section 5.

Home Appliances Modeling
Different classes of home load appliances were utilized in this paper. Usually, home appliances are classified into two categories according to their importance for customers. The first includes home appliances that serve vital functions to customers. These activities are performed in a daily basis and cannot be dispensed with or disturbed. This type of home appliances is normally called "critical" loads. In the sense of HEMS algorithms, these critical loads cannot be curtailed, controlled, or deferred (shifted). Lighting loads, TVs, refrigerators, and laptops are some of the common appliances that fall under this category. The second class includes home appliances that serve less important functions to customers. These activities are also performed in a daily basis but they can be delayed or disturbed. This type of home appliances is normally called "noncritical" loads. In the sense of HEMS algorithms, these noncritical loads can be curtailed, controlled, or deferred (shifted). Water heaters (WH), air conditioning (AC) systems, cloth dryers (CD), and electric vehicles (EV) are the common appliances that fall under this category. In this paper, the noncritical home appliance loads were further classified. The classification is based on categorizing the appliances into three groups. The first is the group of home appliance loads that can be directly curtailed or cut off upon a command signal from the HEMS algorithm. In this paper, the CD was chosen to represent this group. The second is the group of home appliance loads that can be controlled without direct and full cutting off. In this type of noncritical load, the HEMS algorithm controls other auxiliary devices that are attached to these loads, which in turn alters the operational state of these noncritical home appliance loads. In this paper, the AC and WH were chosen to represent this group. The last group consists of home appliance loads that can be shifted to operate in a low-price period. For this type of noncritical load, the HEMS algorithm recommends a better period of operation in terms of electricity cost. In this paper, the EV was chosen to represent this group.
Four different home appliance loads used to represent the three categories of noncritical loads were prioritized from high to low as per their importance to consumers. Table 1 shows the rated power of each utilized home appliance, the priority, and its preferences. In general, loads with high priority, such as water heater (WH), are the last to be curtailed or shifted. Refrigerator, cooking stove, lighting, and some electronic appliances were chosen to represent the critical home appliance loads. An aggregated random load profile of these appliances is shown in Table 2 for a 12 h period starting from 12 p.m. to 12 a.m., with maximum and minimum values being 1 and 2 KW, respectively. These critical loads have not been shown but were always added to the daily load profile of noncritical appliances. The noncritical load profiles for each selected home appliances, as well as their energy consumption that shape the daily home load curve, were developed according to References [18,31]. The details of these models and different input parameters can also be found in Reference [15]. The mathematical models for the WH, AC, CD, and EV home appliances, which represent the daily power consumption of each appliance according to customer needs and desires, were built in a MATLAB/Simulink environment. The total home load profile was deduced from aggregation of individual home appliance load pattern. Sample simulation results of WH and AC MATLAB models are presented in Figures 2 and 3. Figure 2 shows the daily load pattern for the WH appliance, where it consumes its rated power due to two water withdrawal events by the customer. These withdraw events are shown as a drop in the outlet water temperature; the WH temperature set point is also recorded in this figure. The cyclic power consumption of the AC appliance is shown in Figure 3. The pulsating load pattern of the AC appliance was mainly due to its fluctuating nature in room temperature depending on customer preference of the room temperature (AC temperature set point).

Concepts behind HEMS Algorithms
A DR event can be defined as a period during which noncritical demand of consumers needs to be curtailed, controlled, or shifted to relieve system stress. HEMS algorithms monitor the household energy consumption and perform these actions to keep the total consumption below the specified KW limit during DR events. In this section, the main working ideas behind three different algorithms for HEMS-load power curtailment algorithm (LPcur-a), load power control algorithm (LPcon-a), and load power shifting algorithm (LPshi-a)-are presented. These algorithms essentially serve to control the power consumption of home appliances below a specified threshold signal described by utility companies as a DR request for a predetermined period while maintaining convenient customer preferences in terms of load priority and comfort level. The presented algorithms pave the way to elucidate a new HEMS algorithm, i.e., the unified algorithm. This algorithm blends the three mentioned algorithms in order to achieve dual customer/utility benefit

Concepts behind HEMS Algorithms
A DR event can be defined as a period during which noncritical demand of consumers needs to be curtailed, controlled, or shifted to relieve system stress. HEMS algorithms monitor the household energy consumption and perform these actions to keep the total consumption below the specified KW limit during DR events. In this section, the main working ideas behind three different algorithms for HEMS-load power curtailment algorithm (LPcur-a), load power control algorithm (LPcon-a), and load power shifting algorithm (LPshi-a)-are presented. These algorithms essentially serve to control the power consumption of home appliances below a specified threshold signal described by utility companies as a DR request for a predetermined period while maintaining convenient customer preferences in terms of load priority and comfort level. The presented algorithms pave the way to elucidate a new HEMS algorithm, i.e., the unified algorithm. This algorithm blends the three mentioned algorithms in order to achieve dual customer/utility benefit

Concepts behind HEMS Algorithms
A DR event can be defined as a period during which noncritical demand of consumers needs to be curtailed, controlled, or shifted to relieve system stress. HEMS algorithms monitor the household energy consumption and perform these actions to keep the total consumption below the specified KW limit during DR events. In this section, the main working ideas behind three different algorithms for HEMS-load power curtailment algorithm (LPcur-a), load power control algorithm (LPcon-a), and load power shifting algorithm (LPshi-a)-are presented. These algorithms essentially serve to control the power consumption of home appliances below a specified threshold signal described by utility companies as a DR request for a predetermined period while maintaining convenient customer preferences in terms of load priority and comfort level. The presented algorithms pave the way to elucidate a new HEMS algorithm, i.e., the unified algorithm. This algorithm blends the three mentioned algorithms in order to achieve dual customer/utility benefit and thus avoid the individual drawbacks of the algorithms. The main benefits of the unified algorithm are as follows: For the customers, it reduces their electricity cost without violating customer preferences. For the utility companies, it relieves the stress on the grid, which enhances the system's stability, security, and reliability. All investigated algorithms start with gathering information signals from customer, the utility company, and each appliance. This information is treated as input signals that drive the algorithm to produce the needed output signals. These output signals are delivered to dedicated controllers that manipulate home appliances, taking into account dual benefits for utility companies and customers as well as customer preferences. Figure 4 represents the input/output modules with corresponding signals of different HEMS algorithms. and thus avoid the individual drawbacks of the algorithms. The main benefits of the unified algorithm are as follows: For the customers, it reduces their electricity cost without violating customer preferences. For the utility companies, it relieves the stress on the grid, which enhances the system's stability, security, and reliability. All investigated algorithms start with gathering information signals from customer, the utility company, and each appliance. This information is treated as input signals that drive the algorithm to produce the needed output signals. These output signals are delivered to dedicated controllers that manipulate home appliances, taking into account dual benefits for utility companies and customers as well as customer preferences. Figure 4 represents the input/output modules with corresponding signals of different HEMS algorithms.

HEMS Algorithms Based on Load Power Curtailment
The framework of this algorithm is based on read, check, decide, and update requests. This algorithm starts with reading input signals from different sources. The algorithm checks for comfort level violation and then for compliance with utility request. If the demand limit signal is higher than the total power consumption of the appliances, the algorithm allows appliances with comfort level violation to operate according to their priority. Otherwise, the algorithm curtails the chosen appliances based on their priority. In general, the algorithm permits violating the customer setting from least important to the most important appliance. This is performed to match the demand limit. The steps of this algorithm are summarized as follows: 1. Read Inputs 2. Check comfort level violation 3. Check compliance with utility request 4. Check load priority 5. Decide on suitable appliance status 6. Update 7. Return to step 2 In this system, the algorithm first checks whether or not there is a DR event. In case of a DR event, the total home power consumption is minimized to satisfy the DR request. Some selected appliances are turned off completely during the DR event, such as the CD and EV, which will be start operating again after the DR event finishes. Curtailing the loads will be done gradually according to the preset priority of each load to satisfy the DR request, i.e., the EV will be the first to be curtailed and the water heater will be the last. Unfortunately, this can sacrifice customer comfort in order to minimize the overall home power consumption and may therefore lead to peak rebound just after the DR event.

HEMS Algorithms Based on Load Power Curtailment
The framework of this algorithm is based on read, check, decide, and update requests. This algorithm starts with reading input signals from different sources. The algorithm checks for comfort level violation and then for compliance with utility request. If the demand limit signal is higher than the total power consumption of the appliances, the algorithm allows appliances with comfort level violation to operate according to their priority. Otherwise, the algorithm curtails the chosen appliances based on their priority. In general, the algorithm permits violating the customer setting from least important to the most important appliance. This is performed to match the demand limit. The steps of this algorithm are summarized as follows: 1.
Check comfort level violation 3.
Check compliance with utility request 4.
Check load priority 5.
Decide on suitable appliance status 6. Update 7.
Return to step 2 In this system, the algorithm first checks whether or not there is a DR event. In case of a DR event, the total home power consumption is minimized to satisfy the DR request. Some selected appliances are turned off completely during the DR event, such as the CD and EV, which will be start operating again after the DR event finishes. Curtailing the loads will be done gradually according to the preset priority of each load to satisfy the DR request, i.e., the EV will be the first to be curtailed and the water heater will be the last. Unfortunately, this can sacrifice customer comfort in order to minimize the overall home power consumption and may therefore lead to peak rebound just after the DR event.

HEMS Algorithms Based on Load Power Control
In this kind of HEMS algorithms, the algorithm is not allowed to directly interact with the home appliances and curtail them. Instead, the algorithm will control other supplementary devices, such as the smart thermostat in the case of AC, which will in turn control the status of the AC in such a way that permits serving the higher priority appliance and keeps the total power consumption less than the demand limit signal (utility request compliance). This is achieved by adjusting the thermostat set point (increasing the room temperature set point in the case of AC). It can also be used to decrease the water temperature set point in the case of WH. This way, the operational time of the appliance, and thus its daily energy consumption, will decrease. The main advantage of this approach is that the home comfort level will not be totally scarified but rather kept within customer satisfaction limit. The steps of this algorithm are summarized as follows: 1.
Check comfort level violation 3.
Check compliance with utility request 4.
Check load priority 6.
Decide on suitable appliance status 7. Update 8.
Return to step 2 In this paper, the room temperature set point of the AC was increased by 10 • C (18 • F), which consequently decreased the ON time of the AC and made it draw less energy over the time. Similarly, for the WH, the algorithm has the ability to decrease the hot water temperature set point by 10 • C (18 • F). Unfortunately, in some circumstances, such as high or low ambient temperatures, this algorithm may not be able to cope with the demand limit signal when both the AC and WH are still operating, even after adjusting their set points.

HEMS Algorithms Based on Load Power Shifting
Although the framework of this algorithm seems to be similar to the LPcur-a, it has an essential difference in that this algorithm checks periods of the day to search for low energy price period according to a prespecified tariffs scheme, which is called time of use (ToU) pricing scheme. In this scheme, the electricity tariff is not fixed the whole day but rather changes (increases) in peak load periods. This motivates the customer to use their appliances out of peak periods. Once the algorithm determines the high-price periods, it avoids shifting the load in those periods. Hence, the algorithm can achieve the same benefits as the LPcur-a while also saving money for the customers. The steps of this algorithm are summarized as follows: 1.
Check comfort level violation 3.
Check compliance with utility request 4.
Check time of use period 5.
Check load priority 6.
Decide on suitable appliance status 7. Update 8.
Return to step 2 In this paper, the algorithm will reschedule the shiftable loads according to suggested (ToU) pricing scheme, outlined in Table 3, to limit power consumption during both the DR event and high-tariff periods. In this case, the shiftable loads are the EV and CD loads. The expensive tariff period is assumed to be from 8:00 p.m. to 10:00 p.m. during which the HEMS algorithm will shift the EV and CD loads to cheap tariff periods so as to limit the energy consumption during the high-tariff periods.

Unified HEMS Algorithms
The unified algorithm comprises the three interlinked algorithms, i.e., the algorithms based on shifting, controlling, and curtailment. The key advantage of this novel algorithm is that it achieves simultaneous dual utility/customer benefits while avoiding individual drawbacks of each algorithm. In this section, the main ideas behind this algorithm are presented in two scenarios.

First Scenario
By dividing the loads into shifting (deferrable), controllable and behavior sensitive loads, the idea of the unified algorithm will be as follows: The unified algorithm starts by applying the steps of the algorithm based on load power shifting. The justification is that this algorithm satisfies the dual benefit for the utility company and the customer. If the number of the shifted loads is not enough to comply with the demand limit signal value, the unified algorithm can start applying the steps of the algorithm based on load power control on the controllable types of loads, such as the AC and WH. If the total home consumption is still higher than the demand limit signal, the algorithm manipulates other kinds of loads (behavioral sensitive loads), such as the CD, and cuts them out to satisfy the requirement. This way, the unified algorithm is always targeting the achievement of dual customer/utility benefit without directly cutting off the loads that may jeopardize the customer comfort level. At the same time, the unified algorithm is also giving a higher level of interest to the priority of the load appliance and the customer comfort level by taking into account increase in the efficiency of some home appliances, which will enhance its lifetime as a result of reducing its operational time.

Second Scenario
The unified algorithm starts by applying the steps of the algorithm based on load power shifting. This will not only ensure the needed grid support at unbalanced event but will also benefit customers providing them savings in their energy bills. Accordingly, the unified algorithm will determine certain loads to be shifted at low price periods. The algorithm then provides the customers with an additional feature of accepting or refusing its suggestions. The decline of the recommended deferred loads may happen due to high demand from customers on these loads. In such a case, the algorithm based on load power control, discussed in Section 4, is applied. Hence, the algorithm will try to change the predefined setting of some loads, such as the AC or WH. If the customer refuses this second suggestion as well, the unified algorithm will apply the steps of the algorithm based on load power curtailment and curtail the load according to their priority and preference settings. This way, the unified algorithm will not directly cut off the loads but instead give the consumers other valuable options, such as monetary saving in monthly energy bills to comply with the utility's request signal, and does not sacrifice the customer preference settings (load priority and comfort level). Furthermore, the algorithm avoids creating high off-peak demand due to random compensation of the curtailed load.
The main benefit of this unified algorithm scenario is that it will actively involve the DR users in taking the optimum decision in face of their dynamic desire. In doing so, the algorithm will create another degree of freedom by increasing the level of customer intervention (interaction) with the already agreed DR agreement. The algorithm therefore offers a kind of dynamic deal between the utility and their customers instead of normally fixed agreement that imposes obligations on the customer.
In this paper, the first scenario of the unified algorithm was adopted, implemented, and compared with the other three algorithms. The idea of the second scenario is only presented for future development.

Simulation Results and Discussion
The four mentioned HEMS algorithms were validated and analyzed using a MATLAB/Simulink environment. The steps of each algorithm were performed to represent one simulation cycle. Each cycle represented 10 min in real time; therefore, in 1 h, the MATLAB model for different HEMS algorithms made six cycles. These algorithms were applied on a 12 h time frame of one day, which in turn represented 72 simulation cycles. The inputs for each MATLAB model were the load profile of various home appliances, which were generated from different load models presented in section II as well as the utility request that comprised DR signal in KW and its duration in hours. For the AC appliance, the room temperature set point was 18 • C (64.4 • F), and for the WH appliance, the hot water temperature set point was 50 • C (122 • F). The output of each MATLAB models was the optimized load profile subjected to the defined HEMS algorithm. Figure 5 shows the MATLAB model for each HEMS algorithm along with its input and output signals.

Simulation Results and Discussion
The four mentioned HEMS algorithms were validated and analyzed using a MATLAB/Simulink environment. The steps of each algorithm were performed to represent one simulation cycle. Each cycle represented 10 min in real time; therefore, in 1 h, the MATLAB model for different HEMS algorithms made six cycles. These algorithms were applied on a 12 h time frame of one day, which in turn represented 72 simulation cycles. The inputs for each MATLAB model were the load profile of various home appliances, which were generated from different load models presented in section II as well as the utility request that comprised DR signal in KW and its duration in hours. For the AC appliance, the room temperature set point was 18 °C (64.4 °F), and for the WH appliance, the hot water temperature set point was 50 °C (122 °F). The output of each MATLAB models was the optimized load profile subjected to the defined HEMS algorithm. Figure 5 shows the MATLAB model for each HEMS algorithm along with its input and output signals. Four simulation experiments were performed to validate each HEMS algorithm. In these experiments, each simulation results mainly showed two cases scenario. The first represented daily home appliance profiles without DR event, and the second represented the modified daily home appliances profiles to comply with DR event. As a step toward achieving better appliance scheduling, the unified algorithm was then applied. Furthermore, a comparison between various HEMS algorithms in terms of total daily energy consumption, electricity cost, and degree of comfort level was established. These quantized indexes were also calculated for the case of a no DR event.

LPcur-a Simulation
In this simulation experiment, the tested algorithm was triggered by utility request signals. The demand limits were chosen as 8 KW, 7 KW, and 6 KW, respectively, and lasted for a duration of three hours from 5:00 p.m. to 8:00 p.m. Figure 6 illustrates the daily individual and total home appliances profiles without a DR event (Figure 6a) and with a DR event (Figure 6b-d). The results showed that the proposed algorithm managed to curtail the home appliances and keep the total household consumption below the selected demand limit requests. It also showed that the algorithm complied with the customers' predefined priority of appliances, achieving minimum violation of customer desire and comfort levels. Remarks 1 and 2 reflect the pros and cons of this algorithm, respectively. Four simulation experiments were performed to validate each HEMS algorithm. In these experiments, each simulation results mainly showed two cases scenario. The first represented daily home appliance profiles without DR event, and the second represented the modified daily home appliances profiles to comply with DR event. As a step toward achieving better appliance scheduling, the unified algorithm was then applied. Furthermore, a comparison between various HEMS algorithms in terms of total daily energy consumption, electricity cost, and degree of comfort level was established. These quantized indexes were also calculated for the case of a no DR event.

LPcur-a Simulation
In this simulation experiment, the tested algorithm was triggered by utility request signals. The demand limits were chosen as 8 KW, 7 KW, and 6 KW, respectively, and lasted for a duration of three hours from 5:00 p.m. to 8:00 p.m. Figure 6 illustrates the daily individual and total home appliances profiles without a DR event (Figure 6a) and with a DR event (Figure 6b-d). The results showed that the proposed algorithm managed to curtail the home appliances and keep the total household consumption below the selected demand limit requests. It also showed that the algorithm complied with the customers' predefined priority of appliances, achieving minimum violation of customer desire and comfort levels. Remarks 1 and 2 reflect the pros and cons of this algorithm, respectively. Remark 1: 1. The algorithm not only respected the input constraint of the utility in all cases (Figure 6b-d), but it also changed its strategy in choosing the appliance to be curtailed to adapt with lower demand limit signals imposed by the utility. 2. With the 8 KW demand limit signal (Figure 6b), the operational strategy of the appliances shows that the algorithm only permitted the motor of the CD to be ON, while making the AC ON and OFF in order to fulfill the WH draw event and serve the noncritical loads as well. Once the temperatures of the WH tank was raised to its temperature set point, the algorithm turned the WH to be OFF and allowed the CD appliance to be fully ON (CD motor + heater) and gave the EV the chance to be charged. This satisfied the initial customer desire, as shown in Figure  6a. 3. With the lower demand limit signal of 7 KW (Figure 6c), another appliance operational strategy was adopted by the algorithm, which led it to serve only the WH and the noncritical load while partially scarifying the room temperature comfort level and the customer desire by letting the AC be turned OFF and by shifting both the CD and the EV to work at 7:00 p.m. instead of 6:00 p.m. and at 8:00 p.m. instead of 7:00 p.m., respectively. This situation altered with the WH becoming OFF, and the algorithm helped in retrieving the room temperature comfort level and the initial customer desire by letting the AC and the CD to be ON. 4. When the demand limit signal value decreased even further to 6 KW (Figure 6d), the CD and the AC were permitted to be cyclically ON and OFF when there was no need to use the WH.

Remark 2:
1. With some lower value of demand limit signals, the algorithm was required to turn off the AC to comply with the demand limit signal. This meant the room temperature reached 35.17 °C (95.32 °F), and the customer comfort level was sacrificed. 2. The system led to a high off-peak demand just after a DR event period as customers compensated for the curtailed load. Hence, a new peak rebounded, which may jeopardize the electric grid. Remark 1:

1.
The algorithm not only respected the input constraint of the utility in all cases (Figure 6b-d), but it also changed its strategy in choosing the appliance to be curtailed to adapt with lower demand limit signals imposed by the utility.

2.
With the 8 KW demand limit signal (Figure 6b), the operational strategy of the appliances shows that the algorithm only permitted the motor of the CD to be ON, while making the AC ON and OFF in order to fulfill the WH draw event and serve the noncritical loads as well. Once the temperatures of the WH tank was raised to its temperature set point, the algorithm turned the WH to be OFF and allowed the CD appliance to be fully ON (CD motor + heater) and gave the EV the chance to be charged. This satisfied the initial customer desire, as shown in Figure 6a. 3.
With the lower demand limit signal of 7 KW (Figure 6c), another appliance operational strategy was adopted by the algorithm, which led it to serve only the WH and the noncritical load while partially scarifying the room temperature comfort level and the customer desire by letting the AC be turned OFF and by shifting both the CD and the EV to work at 7:00 p.m. instead of 6:00 p.m. and at 8:00 p.m. instead of 7:00 p.m., respectively. This situation altered with the WH becoming OFF, and the algorithm helped in retrieving the room temperature comfort level and the initial customer desire by letting the AC and the CD to be ON. 4.
When the demand limit signal value decreased even further to 6 KW (Figure 6d), the CD and the AC were permitted to be cyclically ON and OFF when there was no need to use the WH.
With some lower value of demand limit signals, the algorithm was required to turn off the AC to comply with the demand limit signal. This meant the room temperature reached 35.17 • C (95.32 • F), and the customer comfort level was sacrificed. 2.
The system led to a high off-peak demand just after a DR event period as customers compensated for the curtailed load. Hence, a new peak rebounded, which may jeopardize the electric grid.

LPcon-a Simulation
In this simulation experiment, the imposed demand limit signal by the utility was chosen to be 6 KW for a duration of three hours from 5:00 p.m. to 8:00 p.m. Figure 7 illustrates the daily individual and total home appliances profiles without a DR event (Figure 7a) and with a DR event (Figure 7b). In general, the following comments can be deduced: 1.
For the case of no DR event, the AC managed to be ON with temperature violation. This situation altered in the case of a DR event, where the AC managed to be OFF for a certain period to serve the higher priority load such as WH (see Figure 7b at 5:00 p.m.).

2.
This was achieved by controlling the thermostat that in turn kept the AC off by increasing its set point temperature; the maximum room temperature reached 30.31 • C (86.57 • F).

3.
The WH managed to be ON for the OFF period of the AC (due to a water drawn event on this period) and once it was OFF, the AC managed to be ON (Figure 7b); the minimum water set point changed to 40 • C (104 • F). 4.
The algorithm was able to make the home aggregated load appliances comply with the demand limit signal from the utility. At the same time, it reduced the daily operational time of the AC and hence decreased the total home energy consumption, saving will save money for the customer. 5.
The algorithm was capable of changing the above situation in point 4 when the room temperature increased and reached the new set point. In such a case, the WH managed to be OFF while the AC was turned ON. 6.
The algorithm contributed to conserving energy consumption, with a total saving of 4.764 KWh, or 9.4% saving, through the day. This may also lead to enhancing the lifetime and longevity of the AC unit. 7.
Although this algorithm was able to follow the utility request taking into account other constraints, this was not achievable for the high ambient temperature values as it would sacrifice the customer comfort level. In this simulation experiment, the imposed demand limit signal by the utility was chosen to be 6 KW for a duration of three hours from 5:00 p.m. to 8:00 p.m. Figure 7 illustrates the daily individual and total home appliances profiles without a DR event (Figure 7a) and with a DR event (Figure 7b). In general, the following comments can be deduced: 1. For the case of no DR event, the AC managed to be ON with temperature violation. This situation altered in the case of a DR event, where the AC managed to be OFF for a certain period to serve the higher priority load such as WH (see Figure 7b at 5:00 p.m.). 2. This was achieved by controlling the thermostat that in turn kept the AC off by increasing its set point temperature; the maximum room temperature reached 30.31 °C (86.57 °F). 3. The WH managed to be ON for the OFF period of the AC (due to a water drawn event on this period) and once it was OFF, the AC managed to be ON (Figure 7b); the minimum water set point changed to 40 °C (104 °F). 4. The algorithm was able to make the home aggregated load appliances comply with the demand limit signal from the utility. At the same time, it reduced the daily operational time of the AC and hence decreased the total home energy consumption, saving will save money for the customer. 5. The algorithm was capable of changing the above situation in point 4 when the room temperature increased and reached the new set point. In such a case, the WH managed to be OFF while the AC was turned ON. 6. The algorithm contributed to conserving energy consumption, with a total saving of 4.764 KWh, or 9.4% saving, through the day. This may also lead to enhancing the lifetime and longevity of the AC unit. 7. Although this algorithm was able to follow the utility request taking into account other constraints, this was not achievable for the high ambient temperature values as it would sacrifice the customer comfort level.

LPshi-a Simulation
In this simulation experiment, the imposed demand limit signal by the utility was chosen to be 6 KW for a duration of three hours from 5:00 p.m. to 8:00 p.m., the room temperature set point was

LPshi-a Simulation
In this simulation experiment, the imposed demand limit signal by the utility was chosen to be 6 KW for a duration of three hours from 5:00 p.m. to 8:00 p.m., the room temperature set point was set to 18 • C (64.4 • F), and the hot water temperature was set to 50 • C (122 • F). Furthermore, this algorithm took into consideration the time of use pricing scheme, where a high-tariff period was assumed to be applied from 8:00 p.m. to 10:00 p.m. Figure 8 illustrates the daily individual and total home appliance profiles without a DR event (Figure 8a) and with a DR event (Figure 8b). As it can be inferred from these figures, the algorithm not only succeeded in maintaining the total load of the home appliances below the demand limit signal, but it also deferred the operation of some appliances to the low-price period (after 10:00 p.m.) as recommended by the adopted time of use pricing scheme (shown in Table 3), hence offering the customer significant monetary savings. The algorithm performed a cyclic operation between the CD and AC while deferring the EV to the low-price period to fulfill all required constraints, such as utility request, customer comfort, and desire levels. A comparison between the results of this algorithm and the first algorithm (LPcur-a) reflects the superiority of the former in performing two shifts for the EV operation to start working after 10:00 p.m. instead of working after 8:00 p.m. as recommended by the later algorithm (see Figures 6 and 8). In doing so, the algorithm avoided creating a high off-peak period or shifted it to periods where the grid was lightly loaded (after 10:00 p.m.).
Energies 2018, 11, x FOR PEER REVIEW 14 of 18 set to 18 °C (64.4 °F), and the hot water temperature was set to 50 °C (122 °F). Furthermore, this algorithm took into consideration the time of use pricing scheme, where a high-tariff period was assumed to be applied from 8:00 p.m. to 10:00 p.m. Figure 8 illustrates the daily individual and total home appliance profiles without a DR event (Figure 8a) and with a DR event ( Figure 8b). As it can be inferred from these figures, the algorithm not only succeeded in maintaining the total load of the home appliances below the demand limit signal, but it also deferred the operation of some appliances to the low-price period (after 10:00 p.m.) as recommended by the adopted time of use pricing scheme (shown in Table 3), hence offering the customer significant monetary savings. The algorithm performed a cyclic operation between the CD and AC while deferring the EV to the low-price period to fulfill all required constraints, such as utility request, customer comfort, and desire levels. A comparison between the results of this algorithm and the first algorithm (LPcur-a) reflects the superiority of the former in performing two shifts for the EV operation to start working after 10:00 p.m. instead of working after 8:00 p.m. as recommended by the later algorithm (see Figures 8b and 6b). In doing so, the algorithm avoided creating a high off-peak period or shifted it to periods where the grid was lightly loaded (after 10:00 p.m.).

Unified Algorithm Simulation
In this simulation experiment, all home appliance loads were chosen to be ON in the period starting from 5:00 p.m. and 8:00 p.m. In this time period, 6 KW demand limit signal was applied as an input to this algorithm by the utility, the room temperature set point was set to 18 °C (64.4 °F), and hot water temperature was set to 50 °C (122 °F). A high electricity price period from 8:00 p.m. to 10:00 p.m. was also considered. Figure 9 illustrates the daily individual and total home appliance profiles without a DR event (Figure 9a) and with a DR event (Figure 9b). This proposed algorithm works in the following manner. It firstly recommends shifting one of deferrable loads, such as the EV, to the low-price period after 10:00 p.m. It calculates the aggregated home appliances power consumption and compares it with the imposed demand limit signal by the utility. If the aggregated power consumption is less than the demand limit signal, the algorithm will not take any further action. This way, this algorithm coincidently resembles the LPshi-a. On the other hand, if the deferred load does not comply with the demand limit signal, the proposed algorithm will apply the procedures of LPcon-a by changing the AC temperature setting to make the AC OFF. This action is

Unified Algorithm Simulation
In this simulation experiment, all home appliance loads were chosen to be ON in the period starting from 5:00 p.m. and 8:00 p.m. In this time period, 6 KW demand limit signal was applied as an input to this algorithm by the utility, the room temperature set point was set to 18 • C (64.4 • F), and hot water temperature was set to 50 • C (122 • F). A high electricity price period from 8:00 p.m. to 10:00 p.m. was also considered. Figure 9 illustrates the daily individual and total home appliance profiles without a DR event (Figure 9a) and with a DR event (Figure 9b). This proposed algorithm works in the following manner. It firstly recommends shifting one of deferrable loads, such as the EV, to the low-price period after 10:00 p.m. It calculates the aggregated home appliances power consumption and compares it with the imposed demand limit signal by the utility. If the aggregated power consumption is less than the demand limit signal, the algorithm will not take any further action. This way, this algorithm coincidently resembles the LPshi-a. On the other hand, if the deferred load does not comply with the demand limit signal, the proposed algorithm will apply the procedures of LPcon-a by changing the AC temperature setting to make the AC OFF. This action is taken to ensure the aggregated power consumption of the home appliances comply with the demand limit signal. However, if this action is not enough, the algorithm will start to apply the steps of LPcur-a and cut off the CD in order to serve both the noncritical higher priority loads and the critical loads. This way, the proposed algorithm blends or combines other algorithms in only one algorithm that is more flexible and useful than the previous algorithms. In our study, the HEMS contributed to energy saving of 2.8473 KWh, or 5.5% saving, through the day. taken to ensure the aggregated power consumption of the home appliances comply with the demand limit signal. However, if this action is not enough, the algorithm will start to apply the steps of LPcur-a and cut off the CD in order to serve both the noncritical higher priority loads and the critical loads. This way, the proposed algorithm blends or combines other algorithms in only one algorithm that is more flexible and useful than the previous algorithms. In our study, the HEMS contributed to energy saving of 2.8473 KWh, or 5.5% saving, through the day.

Discussion of Results
The advantages of the unified algorithm are illustrated in Figure 10 and Tables 4 and 5. Figure  10 shows the room temperature variations during the 12 h period of study for LPcur-a, LPcon-a, and the unified algorithm. During the proposed demand response period from 5:00 p.m. to 8:00 p.m., the unified algorithm and the LPcon-a achieved less fluctuations compared with the high fluctuations that occurred with LPcur-a. The maximum value of the room temperature when applying the unified algorithm was 30.27 °C (86.5 °F), while it reached 35.17 °C (95.32 °F) in the case of LPcur-a. This result reveals the effectiveness of the unified algorithm in complying with utility request while achieving minimum customer comfort level violation and preserving the temperature inside the room within a satisfactory customer set point. The saving in the energy consumption for the unified algorithm (4.62%) was also higher than the corresponding value for the LPcur-a (3.48%). Table 4 shows the energy cost for 12 h period of study before and after applying the different proposed algorithms. The energy cost for each algorithm was computed based on ToU pricing in Table 3. The energy cost after applying the LPcur-a algorithm was higher than the energy cost before applying it. This was due to the random compensation of the curtailed load just after the demand response event, which did not take into consideration the period of low price in the ToU pricing scheme. The unified algorithm achieved lower energy cost compared to the other proposed algorithms.

Discussion of Results
The advantages of the unified algorithm are illustrated in Figure 10 and Tables 4 and 5. Figure 10 shows the room temperature variations during the 12 h period of study for LPcur-a, LPcon-a, and the unified algorithm. During the proposed demand response period from 5:00 p.m. to 8:00 p.m., the unified algorithm and the LPcon-a achieved less fluctuations compared with the high fluctuations that occurred with LPcur-a. The maximum value of the room temperature when applying the unified algorithm was 30.27 • C (86.5 • F), while it reached 35.17 • C (95.32 • F) in the case of LPcur-a. This result reveals the effectiveness of the unified algorithm in complying with utility request while achieving minimum customer comfort level violation and preserving the temperature inside the room within a satisfactory customer set point. The saving in the energy consumption for the unified algorithm (4.62%) was also higher than the corresponding value for the LPcur-a (3.48%). Table 4 shows the energy cost for 12 h period of study before and after applying the different proposed algorithms. The energy cost for each algorithm was computed based on ToU pricing in Table 3. The energy cost after applying the LPcur-a algorithm was higher than the energy cost before applying it. This was due to the random compensation of the curtailed load just after the demand response event, which did not take into consideration the period of low price in the ToU pricing scheme. The unified algorithm achieved lower energy cost compared to the other proposed algorithms.   Table 5 shows the energy consumption comparison between the LPcur-a, LPcon-a, and the developed unified algorithm. It can be seen that the unified algorithm outperformed the LPcur-a in terms of energy saving. The LPcon-a achieved a higher energy saving among the algorithms as the LPcon-a depends mainly on alleviating the controllable loads (making them totally off) to decrease the power consumption by adjusting the set points of AC and WH during the whole period of the DR event, which results in more energy savings.

Conclusions
This paper summarized the literature on HEMS techniques and methodologies, categorized them into three types of algorithms (LPcur-a, LPcon-a, and LPshi-a), and finally proposed a new unified algorithm that overcomes the drawbacks of these three traditional algorithms. Simulation investigations were performed for the four algorithms using a MATLAB/Simulink environment, which facilitated the evaluation of the pros and cons for each algorithm. The results revealed that the proposed unified algorithm performed better in terms of customer comfort preservation, compliance with utility DR request, and energy cost savings. The strategy adopted in the proposed unified algorithm limited variations in the room temperature around the customers' desired set point better than the load power curtail algorithm. The maximum value of the room temperature when applying the unified algorithm was 30 °C (86 °F), compared to 35 °C (95 °F) that was reached in the case of LPcur-a, implying a higher level of customer satisfaction. The energy cost savings were 3.5%, 2%, and 1.5% for the unified algorithm, LPcon-a, and LPshi-a respectively, which also proves the superiority of the proposed algorithm.   Table 5 shows the energy consumption comparison between the LPcur-a, LPcon-a, and the developed unified algorithm. It can be seen that the unified algorithm outperformed the LPcur-a in terms of energy saving. The LPcon-a achieved a higher energy saving among the algorithms as the LPcon-a depends mainly on alleviating the controllable loads (making them totally off) to decrease the power consumption by adjusting the set points of AC and WH during the whole period of the DR event, which results in more energy savings.

Conclusions
This paper summarized the literature on HEMS techniques and methodologies, categorized them into three types of algorithms (LPcur-a, LPcon-a, and LPshi-a), and finally proposed a new unified algorithm that overcomes the drawbacks of these three traditional algorithms. Simulation investigations were performed for the four algorithms using a MATLAB/Simulink environment, which facilitated the evaluation of the pros and cons for each algorithm. The results revealed that the proposed unified algorithm performed better in terms of customer comfort preservation, compliance with utility DR request, and energy cost savings. The strategy adopted in the proposed unified algorithm limited variations in the room temperature around the customers' desired set point better than the load power curtail algorithm. The maximum value of the room temperature when applying the unified algorithm was 30 • C (86 • F), compared to 35 • C (95 • F) that was reached in the case of LPcur-a, implying a higher level of customer satisfaction. The energy cost savings were 3.5%, 2%, and 1.5% for the unified algorithm, LPcon-a, and LPshi-a respectively, which also proves the superiority of the proposed algorithm.