Optimization of Demand-Response-Based Intelligent Home Energy Management System with Binary Backtracking Search Algorithm

: In many nations, limited power from providers and an increase in demand for electricity have created new opportunities that can be used by home energy management systems (HEMSs) systems to enforce proper use of energy. This paper presents a virtual intelligent home with demand response (DR) model home appliances that have an inverter air conditioner, water pump, washing machine, and inverter refrigerator. A binary backtracking search algorithm (BBSA) is proposed to introduce the optimal schedule controller. With the proposed BBSA schedule controller, the highest energy consumption during DR can be reduced by 33.84% during the weekends and by 30.4% daily during the weekdays. The results indicate the e ﬀ ectiveness of the proposed HEMS. Additionally, the model can control the appliances and maintain total residential energy consumption below the deﬁned demand limit. the BBSA schedule the PSO. results illustrate the capability of the proposed HEMS total the weekend. This intelligent HEMS can accurately determine scheduling and can shift domestic load operation during peak-hour energy consumption by seamlessly scheduling electrical appliances at speciﬁed intervals without making users uncomfortable. The BBSA results were compared with the PSO schedule controller and the results showed that the BBSA schedule controller is better than the PSO. The results revealed that the BBSA schedule controller performs better in minimizing the energy consumed by household devices during both weekends and weekdays. The results indicated that the proposed HEMS is e ﬀ ective. In addition, the model can control the appliances and keep total consumption of residential energy below the given demand limit.


Introduction
As the world progresses, the proportion of electrical energy used by residential customers is increasing dramatically, mainly in developing countries [1]. The main global problems include rising electricity prices and power demand, climate change, global warming, restrictions in traditional electricity generation, and their accompanying environmental concerns. These problems have resulted in economic and severe political crises around the world [2]. Home energy management systems (HEMSs) are becoming increasingly important due to the above concerns as they help to reduce demand for energy, especially through peak load periods. HEMSs must not only be taken as a way to reduce greenhouse gas emissions, but also to allow the electricity of a house to be automatically managed [3]. HEMSs can assist with the reduction of the overall consumption of energy by scheduling domestic home appliances without causing discomfort to customers [4].
Demand response (DR) plays an important role in decreasing energy use at peak hours and can help increase efficiency and reliability in operation [2,[5][6][7]. DR is a program that encourages homeowners to decrease their energy consumption during periods of high-power demand. Therefore, DR can be described as changes in the use of electricity by demand-side sources from their normal types of response consumption, and changes in electricity costs or incentives to reduce electricity consumption during periods with high wholesale prices [8][9][10]. To efficiently schedule home devices, many heuristic optimization techniques have been exploited to automatically create an optimal schedule of household appliances for adjusting power usage during high demand periods [11][12][13][14][15]. Optimization is a method of finding the best solutions to problems after selecting the objective function that is subjected to constraints.
Information 2020, 11, 395 3 of 18 computing time, making it inconvenient for use in a real-time schedule. Haider et al. [35] implemented dynamic home load scheduling to improve the scheduling of household devices, which permits customers to decrease peak loads and minimize electricity bills.
From these studies, both heuristic and mathematical optimization can be applied to resolve scheduling matters. The mathematical optimization technique's capability provides exact solutions but are generally time-consuming for resolving complex optimization matters. To control the drawbacks of the mathematical optimization technique, heuristic optimization is now widely applied. However, the extensively applied heuristic optimization techniques, such as PSO, have some constraints: high computational complexity, slow convergence, they can easily become trapped in local minima solutions [36], and difficulty choosing optimal control parameters, leading to wrong solutions. Derrac et al. [37] provided more statistical tests to compare different algorithms. Ahmed et al. [38] described a new binary backtracking search algorithm (BBSA) "as a suitable controller for HEM systems". The proposed BBSA minimizes electricity costs and energy consumptions during peak hours on weekdays and weekends. To check the accuracy of the HEMS controller, the binary PSO and BBSA were compared; the results showed that the BBSA schedule controller is better than PSO. Sisodiya et al. [8] applied a novel HEMS with DR incorporating energy storage systems for electricity bill and power reduction in a home using a PSO algorithm. The result showed that the scheduling of loads with a PSO algorithm was better than without in terms of minimized energy consumption, which was reduced by 14.58%. Smart meters work together with real-time and device scheduling via HEMS. Therefore, the above works motivated us to use a comparatively novel optimization technique like the BBSA to develop a method for virtual HEMS schedule control with robust exploration capabilities and fast convergence solution that searches for the best use of populations and works in the domain to obtain the use.
Previous studies on scheduling household appliances concentrated only on minimizing electric bills and saving energy; they were constrained to using outdated home appliances. Unfortunately, there has not been enough research since HEMSs were introduced that incorporate the use of effective heuristic optimization techniques, customer comfort, and DR to manage power consumption in home appliances.
Many studies on air conditioner response to demand mainly focused on air conditioners that have constant speed [39]. However, in recent years, users have switched to using inverter air conditioners because of their comfort and energy-saving advantages.
The inverter system provides a desired constant power to the utility [40]. The inverter transforms incoming AC to DC before generating the needed frequency current (high or low frequency) through modulation in an electrical circuit inverter. The inverter motor or variable-speed motor can minimize operation costs, unlike constant motor speed. Countries such as China have witnessed a significant increase in the installation of air conditioners following the formulated national energy-savings and emission reduction policies [41]. Hence it is essential to study the role IAC plays in meeting demand needs.
The main contributions of this study can be summarized as follows: • The development and creation of an intelligent HEM system with DR-enabled considering the cost of electricity, home occupancy, and achieving the best energy savings, costs, and the optimal schedule for home appliances.

•
Considering user comfort as the main energy management process priority to promote the integration of the program into the consumer's everyday routine without impacting their lifestyle.

•
Inverter appliances are used for the first time because most studies focused on older appliances as the use of inverter appliances is more suitable and better than traditional devices in loads management in terms of energy and cost savings.

Novel Home Energy Management System Software Implementation
The system, which consists of the proposed BBSA algorithms and includes the HEMS graphical user interface (GUI) and DR-enabled models, was developed in C#.
As shown in Figure 1, the novel HEMS is advanced as part of the proposed HEM program. It is an easy-to-use program that analyzes the two algorithms by entering information and variables of household appliances in the main interface. The variables include the temperature for the inverter air conditioner and refrigerator, the duration and number of operation cycles for the washing machine, and information about the size of the tank for the water pump, adding constants and variables to the values of equations for all devices, and adding information about the daily temperature. The average temperature of one day in the summer was adopted, as shown in Figure 2, as a case study. As shown in Figure 1, the novel HEMS is advanced as part of the proposed HEM program. It is an easy-to-use program that analyzes the two algorithms by entering information and variables of household appliances in the main interface. The variables include the temperature for the inverter air conditioner and refrigerator, the duration and number of operation cycles for the washing machine, and information about the size of the tank for the water pump, adding constants and variables to the values of equations for all devices, and adding information about the daily temperature. The average temperature of one day in the summer was adopted, as shown in Figure 2, as a case study.
The program functions as a dashboard for users to control their device conditions, household power consumption, water level, room temperatures, demand limit, consumption of the device, demand cost, total cost, and related comfort settings preferences. The dashboard can be used for changing the priority settings and preferences. Every displayed parameter on the dashboard is updated at specific intervals to provide the most accurate up-to-date information.

Home Energy Management System Strategy by Electrical Device Type
A mathematical home appliance model is needed to conduct a residential DR. In addition, it is essential for determining the features and operating conditions of household appliances to achieve optimum scheduling for the residential DR application.
We investigated the power load scheduling of four electrical appliances using the utility under DR to decrease residential electricity costs. The model includes the following appliances: As shown in Figure 1, the novel HEMS is advanced as part of the proposed HEM program. It is an easy-to-use program that analyzes the two algorithms by entering information and variables of household appliances in the main interface. The variables include the temperature for the inverter air conditioner and refrigerator, the duration and number of operation cycles for the washing machine, and information about the size of the tank for the water pump, adding constants and variables to the values of equations for all devices, and adding information about the daily temperature. The average temperature of one day in the summer was adopted, as shown in Figure 2, as a case study.
The program functions as a dashboard for users to control their device conditions, household power consumption, water level, room temperatures, demand limit, consumption of the device, demand cost, total cost, and related comfort settings preferences. The dashboard can be used for changing the priority settings and preferences. Every displayed parameter on the dashboard is updated at specific intervals to provide the most accurate up-to-date information.

Home Energy Management System Strategy by Electrical Device Type
A mathematical home appliance model is needed to conduct a residential DR. In addition, it is essential for determining the features and operating conditions of household appliances to achieve optimum scheduling for the residential DR application.
We investigated the power load scheduling of four electrical appliances using the utility under DR to decrease residential electricity costs. The model includes the following appliances: The program functions as a dashboard for users to control their device conditions, household power consumption, water level, room temperatures, demand limit, consumption of the device, demand cost, total cost, and related comfort settings preferences. The dashboard can be used for changing the priority settings and preferences. Every displayed parameter on the dashboard is updated at specific intervals to provide the most accurate up-to-date information.

Home Energy Management System Strategy by Electrical Device Type
A mathematical home appliance model is needed to conduct a residential DR. In addition, it is essential for determining the features and operating conditions of household appliances to achieve optimum scheduling for the residential DR application.
We investigated the power load scheduling of four electrical appliances using the utility under DR to decrease residential electricity costs. The model includes the following appliances:

Inverter Air Conditioner (IAC)
The inverter air conditioner's compressor speed changes depending on the changing frequency of power supply through a frequency convertor to control compressor power. Therefore, inverter air conditioners (IACs) can provide excellent user comfort, low power loss, and seamless temperature control. The inverter's active power consumption during the temperature maintenance stage is close to 30% that of a fixed speed air conditioner.
Depending on the room temperature, the IAC is controlled by the HEMS. The IAC is operated by the HEMS when the room temperature is more than 26 • C. The IAC stops working when the room temperature is below than 20 • C. The HEMS automatically controls the peak hours if the room temperature is between 20 and 26 • C. The IAC is maintained in accordance with the comfort preferences of the customer: where N IAC,k denotes to the condition of the appliance at time k (0 = switched off and 1 = switched on) [42] and T IAC,k denotes to the room temperature at time interval k.
The power consumption of IAC in watts is related to the operating frequency of the appliance and can be written as: [14] W_(IAC, k) = k_p where k_p and M_p are the constant coefficients of the IAC. f c is the total frequency, it can be regulated in a range, as seen below.
f _c_min ≤ f c ≤ f _c_max (3) Figure 3 shows the IAC power consumption parameters that were used to develop the proposed HEMS. We applied the proposed optimization technique and used the IAC in an experimental case study to improve load management.
Information 2020, 11, x FOR PEER REVIEW 5 of 18

Inverter Air Conditioner (IAC)
The inverter air conditioner's compressor speed changes depending on the changing frequency of power supply through a frequency convertor to control compressor power. Therefore, inverter air conditioners (IACs) can provide excellent user comfort, low power loss, and seamless temperature control. The inverter's active power consumption during the temperature maintenance stage is close to 30% that of a fixed speed air conditioner.
Depending on the room temperature, the IAC is controlled by the HEMS. The IAC is operated by the HEMS when the room temperature is more than 26 °C. The IAC stops working when the room temperature is below than 20 °C. The HEMS automatically controls the peak hours if the room temperature is between 20 and 26 °C. The IAC is maintained in accordance with the comfort preferences of the customer: where , denotes to the condition of the appliance at time k (0 = switched off and 1 = switched on) [42] and , denotes to the room temperature at time interval k. The power consumption of IAC in watts is related to the operating frequency of the appliance and can be written as: [14] _( , ) = _ + , + _ * , where _ and Ϻ_ are the constant coefficients of the IAC. is the total frequency, it can be regulated in a range, as seen below. Figure 3 shows the IAC power consumption parameters that were used to develop the proposed HEMS. We applied the proposed optimization technique and used the IAC in an experimental case study to improve load management.

Water Pump (WP)
Residents are often faced with the challenge of inadequate water supply and availability. As a result, they use of roof-top tanks to store water, which needs to be driven from the basement to the tanks with the aid of a water pump. A systematic method of solving the problem of water insufficiency is by setting up an automatic water pump. Because of their home energy management system, smart water pumps are completely self-operational. Since water pumps are known to

Water Pump (WP)
Residents are often faced with the challenge of inadequate water supply and availability. As a result, they use of roof-top tanks to store water, which needs to be driven from the basement to the tanks with the aid of a water pump. A systematic method of solving the problem of water insufficiency is by setting up an automatic water pump. Because of their home energy management system, smart water pumps are completely self-operational. Since water pumps are known to consume large amounts of energy, we decided to find a solution to this problem. Before switching itself on, the water pump first checks if the water level in the basement tank is adequate, then it checks the rate of energy consumption at that particular time. If the water level in the basement tank is low but the energy consumption rate is high, the pump will not turn on. After checking the state of the energy consumption rate, the water pump will turn on if the water level falls below 20% and will turn off if the water level is more than 80%. Sometimes, when the water level is below 20%, the pump will turn on if the energy consumption rate is low.
The power consumption of wp in watts (W_(wp, k)) and can be determined by [43], where ξ is the motor efficiency, Dm_k is the water demand (m3/(hr)), u_(wp) is the tank diameter (m3), W_wp, k is the energy consumption in watt, and L is the head of water level (m). Figure 4 illustrates the WP power consumption parameters.
Information 2020, 11, x FOR PEER REVIEW 6 of 18 energy consumption rate, the water pump will turn on if the water level falls below 20% and will turn off if the water level is more than 80%. Sometimes, when the water level is below 20%, the pump will turn on if the energy consumption rate is low. The power consumption of wp in watts ( _( , )) and can be determined by [43], where is the motor efficiency, _ is the water demand (m3/(hr)), _( ) is the tank diameter (m3), _ , is the energy consumption in watt, and is the head of water level (m). Figure 4 illustrates the WP power consumption parameters.

Washing Machine (WM)
In the residential sector washing machine (WM) electricity consumption accounts for around 7.2% of total energy consumption [44]. A WM can turn on/off and need a minimum period of 90 min to complete its work. When the total time arrives at the desired time, the WM turns off the motor.
where , is the condition of the appliance at time k (0 = switched off and 1 = switched on) and , is the time period k. _( , ) is the power consumption of the WM in watt and can be determined by a set time period [43], where _( , ) is the amount of watt-rated WM power.

Inverter Refrigerator (IREF)
The inverter refrigerator (IREF) contains a compressor. The compressor component typically has power consumption within a range of several hundred watts. The IREF works all the time and

Washing Machine (WM)
In the residential sector washing machine (WM) electricity consumption accounts for around 7.2% of total energy consumption [44]. A WM can turn on/off and need a minimum period of 90 min to complete its work. When the total time arrives at the desired time, the WM turns off the motor. WM condition (N wP ) is where N wm,k is the condition of the appliance at time k (0 = switched off and 1 = switched on) and k wm,k is the time period k. W_(WM, k ) is the power consumption of the WM in watt and can be determined by a set time period [43], W_(WM, k) = W_(WM) * N wm,k , where W_(WM, k) is the amount of watt-rated WM power.

Inverter Refrigerator (IREF)
The inverter refrigerator (IREF) contains a compressor. The compressor component typically has power consumption within a range of several hundred watts. The IREF works all the time and consumes energy according to the internal IREF temperature: if the temperature is high, it consumes more energy, and if the temperature is low, it consumes less energy. As soon as the internal temperature reaches to the upper limit, the compressor switches on, which causes the temperature to decrease.
The IREF is operated by the HEMS when the internal IREF temperature is more than 8 • C. Lastly, the IREF stops working when the internal IREF temperature is below 4 • C. The HEMS automatically controls the peak hours if the internal IREF temperature is between 4 and 8 • C. The IREF is maintained in accordance with the comfort preferences of the customer: where T IREF,k denotes to the internal IREF temperature at time period k and ∆T IREF,k is the internal IREF temperature comfort level.
The power consumption of IREF in watts (W_(IREF, k)) is related to the operating frequency of the compressor and is seen as [45] where K_ f and M_ f are constant coefficients of the IREF. The IREF power consumption parameters are illustrated in Figure 5. The IREF's novel feature is the easy regulation of the internal temperature, which improves food storage and regulates power consumption. This task was applied in this study.
where , denotes to the internal IREF temperature at time period k and , is the internal IREF temperature comfort level.
The power consumption of IREF in watts ( _( , )) is related to the operating frequency of the compressor and is seen as [45] _( , ) = ( _ + ƒ_ ( ) + Ϻ_ ) * , where _ and Ϻ_ are constant coefficients of the IREF. The IREF power consumption parameters are illustrated in Figure 5. The IREF's novel feature is the easy regulation of the internal temperature, which improves food storage and regulates power consumption. This task was applied in this study.

Proposed HEMS
Several challenges must be faced in finding the best schedule for home appliances and the proper changes in consumer rules using basic rules to minimize electrical power usage in DR events. Thus, advanced optimization techniques should provide optimum schedules for home appliances. As shown in Figure 6, the DR signal is sent from the utility to the smart meter and, finally, to the HEMS, which shows duration and load amount. The HEMS controller sends DR signals to every home appliance.

Proposed HEMS
Several challenges must be faced in finding the best schedule for home appliances and the proper changes in consumer rules using basic rules to minimize electrical power usage in DR events. Thus, advanced optimization techniques should provide optimum schedules for home appliances. As shown in Figure 6, the DR signal is sent from the utility to the smart meter and, finally, to the HEMS, which shows duration and load amount. The HEMS controller sends DR signals to every home appliance.
Several challenges must be faced in finding the best schedule for home appliances and the proper changes in consumer rules using basic rules to minimize electrical power usage in DR events. Thus, advanced optimization techniques should provide optimum schedules for home appliances. As shown in Figure 6, the DR signal is sent from the utility to the smart meter and, finally, to the HEMS, which shows duration and load amount. The HEMS controller sends DR signals to every home appliance.   Table 1 indicates that the first target is IAC, where the room temperature should be maintained within the 20-26 • C range. The second target is WP, with the level of water tank maintained within the appropriate 20-80% range. In the case of a washing machine, a homeowner may specify full time, maximum OFF heating coils, and minimum ON heating coils time (90 min) to complete its work. For the IREF, it operates at 24 h. Before implementing the HEM algorithm, homeowners first need to set their load priority and comfort preferences, as shown in Table 1. The HEMS algorithm determines the status of each appliance according to the parameters of customer preference and a requested demand limit. Parameters of consumer choice vary with different types of appliances. Figure 7 shows the proposed HEMS algorithm with schedule controller conditions for electrical loads.
Before implementing the HEM algorithm, homeowners first need to set their load priority and comfort preferences, as shown in Table 1. The HEMS algorithm determines the status of each appliance according to the parameters of customer preference and a requested demand limit. Parameters of consumer choice vary with different types of appliances. Figure 7 shows the proposed HEMS algorithm with schedule controller conditions for electrical loads.

Start
Read customer appliances priorities from Table 1 Read

Objective Function and Constraint
The energy consumption is used as the objective function to enhance the HEMS efficiency by reducing the 24-hour energy consumption, which contributes to a reduction in the electricity bill. The objective function this problem is as follows.
where k is the time in hour and Wt is the total power consumption in Watts. And the constraints of this problem can be written as follows.

Binary Back Tracking Search Algorithm (BBSA) Optimization
The binary backtracking search algorithm (BBSA) is an efficient optimization algorithm proposed by CIVICIOGLU that solves optimization problems. It is an evolutionary algorithm that focuses on serving the population as an energy consumption minimizer. However, there is already a new BBSA that is being studied [46]. The algorithm has a basic structure and only calculates one control parameter while updating equations. Mutation and crossover occur. BBSA leads the search for the best use of populations and it works in the domain to obtain the use, having very robust exploration capabilities [47]. It was used in many studies and is commonly used to solve optimization problems. It consists of the following processes: Initialization: In BSA's initialization process, the search-space randomly generates the individuals in populations. BSA initializes the population q ij : where i = 1, 2, 3, 4 . . . . . . , M; j = 1, 2, 3, 4, . . . D; M and D are the size of the population and the problem dimension of the data set, respectively; rand is a random number; and the target person in the initial population is up j and low j. Selection: The first selection specifies the old q ij historical population, which is used to measure the direction of search. old q ij is calculated by Equation (19) before iteration and will be redefined and modified in Equation (20) and with a random variable in Equation (21) at the beginning of each iteration procedure.
old q ij = rand * up j − low j + low j (19) I f a < b then old q ij = q ij (20) old q ij = permuting old q ij (21) Mutation: The mechanism of mutation by BBSA generates the trail population via Equation (22), where the F value controls the amplitude of the search-direction (oldq ij − q ij ).
The conditions for the schedule controller are implemented by following the BBSA flowchart shown in Figure 8 and the priority of load given in Table 1. The algorithm and its binary version have considerable potential to find near-optimal high-dimensional scheduling control and non-continuous optimization problems. Information 2020, 11, x FOR PEER REVIEW 11 of 18

Results
In this study, we considered weekends and weekdays as the two cases for the DR scenario. The Convert ( ) to Binary values by Equation (24) Calculate the objective function for every population ( ) using Equation (9) Executed schedule controller condition using Figure 7 Run the proposed schedule controller of the home After the schedule controller requirements are enforced, the proposed home appliances schedule controller based on BBSA is implemented for each population (q ij ). Afterward, the objective function is calculated for each population.
MAYTHAM [38] implemented a BBSA algorithm to solve the optimization of discrete parameters. In BBSA, the population individuals are represented as a binary vector, and by the sigmoid function g i , the population value is converted to 0 or 1.
PB is the value of the population. The value of the binary population is updated as:

Results
In this study, we considered weekends and weekdays as the two cases for the DR scenario. The DR event runs at around 9:30 a.m._12:30 p.m., 4:30 p.m._6:30 p.m., and 9:30 p.m._11:30 p.m. on weekends, while it starts on a weekday from 4:30 p.m. until around 11:30 p.m. The BBSA and schedule controller implementation was aimed at minimizing the energy consumption, which was the predefined objective function. We assumed that the value of the electrical demand limit was 1250 W, and this value should be greater than the overall energy consumption. The values of the overall power consumption were found to be 189,22.71 W on weekends and 18,191.57 W during the weekdays.
To verify the accuracy of the HEM system controller, we compared the BBSA and binary PSO for weekdays. To determine the best energy savings as well as achieve the optimal schedule for the home appliances under consideration, the BBSA was used as a schedule controller for the HEMS. For proper comparison, the maximum iteration and population size for BBSA schedule algorithm controllers were fixed at 30 and 900, respectively.

Optimal Weekend Controller Schedule
The BBSA schedule was implemented to minimize the energy consumption, which was the predefined objective function. After applying the BBSA schedule controllers, the power consumption of each device and the overall power consumption, and the daily cost are shown in Figures 9 and 10, respectively. For the weekend case, a demand limit of 1250 W was imposed on the DR signal, and there were three various time intervals consisting of 9:30 a.m._12:30 p.m., 4:30 p.m._6:30 p.m., and 9:30 p.m._11:30 p.m.
Information 2020, 11, x FOR PEER REVIEW 12 of 18 schedule controller implementation was aimed at minimizing the energy consumption, which was the predefined objective function. We assumed that the value of the electrical demand limit was 1250 W, and this value should be greater than the overall energy consumption. The values of the overall power consumption were found to be 189,22.71 W on weekends and 18,191.57 W during the weekdays.
To verify the accuracy of the HEM system controller, we compared the BBSA and binary PSO for weekdays. To determine the best energy savings as well as achieve the optimal schedule for the home appliances under consideration, the BBSA was used as a schedule controller for the HEMS. For proper comparison, the maximum iteration and population size for BBSA schedule algorithm controllers were fixed at 30 and 900, respectively.

Optimal Weekend Controller Schedule
The BBSA schedule was implemented to minimize the energy consumption, which was the predefined objective function. After applying the BBSA schedule controllers, the power consumption of each device and the overall power consumption, and the daily cost are shown in Figures 9 and 10, respectively. For the weekend case, a demand limit of 1250 W was imposed on the DR signal, and there were three various time intervals consisting of 9:30 a.m._12:30 p.m., 4:30 p.m._6:30 p.m., and 9:30 p.m._11:30 p.m. The total power consumptions of IAC, WP, WM, and IREF were found to be 5679, 4250, 6050, and 2943, respectively, and the total power consumption was 18,922.7 W without BBSA, which is above the demand limit. In contrast, with BBSA, the power consumptions were 4898, 5100, 0, and 2521 W for IAC, WP, WM, and IREF, respectively, and the total power consumption was 12,519.7 W during a DR event (33.84%). Figure 9 shows that the overall energy consumed and cost were reduced during the DR periods, where the 1250 W demand limit is greater than the overall power From Figure 10, the BBSA schedule controllers in the HEMS switched the four household appliances OFF or ON, which included the IAC, WP, WM, and IREF according to the customer lifestyle, priority of appliances, and the DR condition, ensuring that the appliances operate within the demand limit value. Since the IAC has higher priority than the WP, the WP is placed on hold as soon as the IAC begins to keep the total household consumption below the 1250 W demand limit.

Optimal Weekday Controller Schedule
To verify the accuracy of the algorithms and the performance appliances, the BBSA and binary PSO were compared. The weekday data for power consumption and cost were collected over a period of 24 h. Without using the schedule controller, the overall power consumption and the cost for every home device (which included IAC, WP, WM, and IREF) were also collected from the HEMS, as presented in Figures 11 and 12 for BBSA and binary PSO respectively. From 4:30 to 11:30 p.m., a 1250 W demand limit was imposed on the DR event during a weekday.
The total power consumptions of IAC, WP, WM, and IREF were 5866, 5950, 3300, and 3074, respectively, and the total power consumption was 18,191.57 W without BBSA. With BBSA, the power consumptions were 5531, 4250, 0, and 2879 W for IAC, WP, WM, and IREF, respectively, and the total power consumption was 12,661.5 W during a DR event (30.40%) every day, as shown in Figure 13. The total power consumption with binary PSO was 12.8 W during a DR event (29.24%) every day, as shown in Figure 14. When the overall energy consumption exceeds the demand limit, as shown in Figure 13, the lower priority device is turned off and scheduled to an off-peak hour by the BBSA schedule controller, which tries to keep the overall energy consumption under the demand limit. The BBSA schedule controller enhances energy savings by 5.5 kWh (30.4%) every day. Conversely, the PSO algorithm controller reduces energy consumption by 5.3 kWh or (29.24%) every day. The results showed that the BBSA schedule controller is better than the binary PSO. The results illustrate the capability of the proposed HEMS algorithm to maintain total energy consumption below the demand limit by reducing the peak load and scheduling the home appliances during the week without denying homeowners the comfort of using their appliances. The total power consumptions of IAC, WP, WM, and IREF were found to be 5679, 4250, 6050, and 2943, respectively, and the total power consumption was 18,922.7 W without BBSA, which is above the demand limit. In contrast, with BBSA, the power consumptions were 4898, 5100, 0, and 2521 W for IAC, WP, WM, and IREF, respectively, and the total power consumption was 12,519.7 W during a DR event (33.84%). Figure 9 shows that the overall energy consumed and cost were reduced during the DR periods, where the 1250 W demand limit is greater than the overall power consumption value.
When the overall energy consumption exceeds the demand limit, as seen in Figure 9, the lower-priority device is turned off and scheduled to an off-peak hour by the BBSA schedule controller which tries to maintain the overall energy consumption under the demand limit.
From Figure 10, the BBSA schedule controllers in the HEMS switched the four household appliances OFF or ON, which included the IAC, WP, WM, and IREF according to the customer lifestyle, priority of appliances, and the DR condition, ensuring that the appliances operate within the demand limit value. Since the IAC has higher priority than the WP, the WP is placed on hold as soon as the IAC begins to keep the total household consumption below the 1250 W demand limit.

Optimal Weekday Controller Schedule
To verify the accuracy of the algorithms and the performance appliances, the BBSA and binary PSO were compared. The weekday data for power consumption and cost were collected over a period of 24 h. Without using the schedule controller, the overall power consumption and the cost for every home device (which included IAC, WP, WM, and IREF) were also collected from the HEMS, as presented in Figures 11 and 12 for BBSA and binary PSO respectively. From 4:30 to 11:30 p.m., a 1250 W demand limit was imposed on the DR event during a weekday.     The total power consumptions of IAC, WP, WM, and IREF were 5866, 5950, 3300, and 3074, respectively, and the total power consumption was 18,191.57 W without BBSA. With BBSA, the power consumptions were 5531, 4250, 0, and 2879 W for IAC, WP, WM, and IREF, respectively, and the total power consumption was 12,661.5 W during a DR event (30.40%) every day, as shown in Figure 13. The total power consumption with binary PSO was 12.8 W during a DR event (29.24%) every day, as shown in Figure 14. When the overall energy consumption exceeds the demand limit, as shown in Figure 13, the lower priority device is turned off and scheduled to an off-peak hour by the BBSA schedule controller, which tries to keep the overall energy consumption under the demand limit.
The BBSA schedule controller enhances energy savings by 5.5 kWh (30.4%) every day. Conversely, the PSO algorithm controller reduces energy consumption by 5.3 kWh or (29.24%) every day. The results showed that the BBSA schedule controller is better than the binary PSO. The results illustrate the capability of the proposed HEMS algorithm to maintain total energy consumption below the demand limit by reducing the peak load and scheduling the home appliances during the week without denying homeowners the comfort of using their appliances.

Conclusions
In this study, we aimed to determine the household electric power consumption and cost based on the BBSA. With the proposed BBSA schedule controller, the highest energy consumption during DR can be reduced by 30.4%, or 5.5 kWh, daily during the weekdays and by 33.84%, or 6.4 kWh, daily during the weekend. This intelligent HEMS can accurately determine scheduling and can shift domestic load operation during peak-hour energy consumption by seamlessly scheduling electrical appliances at specified intervals without making users uncomfortable. The BBSA results were compared with the PSO schedule controller and the results showed that the BBSA schedule controller is better than the PSO. The results revealed that the BBSA schedule controller performs better in minimizing the energy consumed by household devices during both weekends and weekdays. The

Conclusions
In this study, we aimed to determine the household electric power consumption and cost based on the BBSA. With the proposed BBSA schedule controller, the highest energy consumption during DR can be reduced by 30.4%, or 5.5 kWh, daily during the weekdays and by 33.84%, or 6.4 kWh, daily during the weekend. This intelligent HEMS can accurately determine scheduling and can shift domestic load operation during peak-hour energy consumption by seamlessly scheduling electrical appliances at specified intervals without making users uncomfortable. The BBSA results were compared with the PSO schedule controller and the results showed that the BBSA schedule controller is better than the PSO. The results revealed that the BBSA schedule controller performs better in minimizing the energy consumed by household devices during both weekends and weekdays. The

Conclusions
In this study, we aimed to determine the household electric power consumption and cost based on the BBSA. With the proposed BBSA schedule controller, the highest energy consumption during DR can be reduced by 30.4%, or 5.5 kWh, daily during the weekdays and by 33.84%, or 6.4 kWh, daily during the weekend. This intelligent HEMS can accurately determine scheduling and can shift domestic load operation during peak-hour energy consumption by seamlessly scheduling electrical appliances at specified intervals without making users uncomfortable. The BBSA results were compared with the PSO schedule controller and the results showed that the BBSA schedule controller is better than the PSO. The results revealed that the BBSA schedule controller performs better in minimizing the energy consumed by household devices during both weekends and weekdays. The results indicated that the proposed HEMS is effective. In addition, the model can control the appliances and keep total consumption of residential energy below the given demand limit.