Smart Home Battery for the Multi-Objective Power Scheduling Problem in a Smart Home Using Grey Wolf Optimizer

: The power scheduling problem in a smart home (PSPSH) refers to the timely scheduling operations of smart home appliances under a set of restrictions and a dynamic pricing scheme(s) produced by a power supplier company (PSC). The primary objectives of PSPSH are: (I) minimizing the cost of the power consumed by home appliances, which refers to electricity bills, (II) balance the power consumed during a time horizon, particularly at peak periods, which is known as the peak-to-average ratio, and (III) maximizing the satisfaction level of users. Several approaches have been proposed to address PSPSH optimally, including optimization and non-optimization based approaches. However, the set of restrictions inhibit the approach used to obtain the optimal solutions. In this paper, a new formulation for smart home battery (SHB) is proposed for PSPSH that reduces the effect of restrictions in obtaining the optimal/near-optimal solutions. SHB can enhance the scheduling of smart home appliances by storing power at unsuitable periods and use the stored power at suitable periods for PSPSH objectives. PSPSH is formulated as a multi-objective optimization problem to achieve all objectives simultaneously. A robust swarm-based optimization algorithm inspired by the grey wolf lifestyle called grey wolf optimizer (GWO) is adapted to address PSPSH. GWO has powerful operations managed by its dynamic parameters that maintain exploration and exploitation behavior in search space. Seven scenarios of power consumption and dynamic pricing schemes are considered in the simulation results to evaluate the proposed multi-objective PSPSH using SHB (BMO-PSPSH) approach. The proposed BMO-PSPSH approach’s performance is compared with that of other 17 state-of-the-art algorithms using their recommended datasets and four algorithms using the proposed datasets. The proposed BMO-PSPSH approach exhibits and yields better performance than the other compared algorithms in almost all scenarios.


Introduction
Old power grids are encountering several difficulties in reducing the power demand of users, particularly in peak periods, where they cannot face the increment in power demand because of the primitive nature of their infrastructures. Accordingly, the old power grids' stability and safety became not guaranteed. Therefore, the smart grid (SG) has emerged instead of the old power grid to face its difficulties and meet the users' requirement of power [1].
SG upgrades and improves the old power grid's management, control, and distribution systems. The SG communication system is playing the primary key to this improvement, where it is considered the backbone of SG. The communication system allows power supplier companies (PSCs) to transfer power to the users and get their feedback [2].
SG's primary goals are to make power usage more efficient, diminish users' demand for power during peak periods, and optimize the cost of power production [3]. Optimizing users' power demand plays the leading role in attaining SG goals and making its power system more efficient [4,5]. Furthermore, this kind of optimization provides benefits for users, such as reducing electricity bill (EB) and improving their comfort level. However, the power demand of users can be optimized by scheduling the operations of appliances in a smart home or Internet-of-Things at suitable periods in accordance with a dynamic price scheme(s) (i.e., the electricity prices vary dynamically over time) [6][7][8][9][10].
PSCs generate dynamic pricing schemes on the basis of the cost of power generation and power demand, where electricity prices are high during peak periods and low during off-peak periods. These pricing schemes are generated to incentivize users to shift most of their home appliances operation time from peak periods to off-peak periods [6]. The most popular dynamic pricing schemes that can be generated by PSCs are real-time price (RTP), time-of-use price (TOU), critical period price (CPP), and inclining block rate (IBR) [9,[11][12][13][14].
The problem of scheduling the smart home appliance operation time at suitable periods in accordance with a dynamic pricing scheme(s) is called the power scheduling problem in a smart home (PSPSH). The primary objectives of addressing PSPSH are reducing EB of users, reducing power demand at peak periods by minimizing the ratio between highest power demand and average power demand (peak-to-average ratio (PAR)), and improving user comfort (UC) level [12,[14][15][16].
PSPSH can be addressed through a smart home system, known as the home energy management system (HEMS) [15]. HEMS is mainly comprising hardware and software, which allows users to efficiently manage their power consumption by controlling and monitoring smart home appliances. HEMS enables users to set the parameters of their appliances such as appliances' allowable periods to be scheduled (operation time period (OTP)), the appliances' time required to finish their operation cycle (length of operation cycle (LOC)), and power needed by the appliances to be operated [12,[14][15][16].
Several studies have proposed different architectures of HEMS and discussed how it provides benefits in addressing PSPSH and improves the efficiency of the power system of SGs. Most of these studies formulated PSPSH objective function only to reduce EB [17][18][19][20][21]. In contrast, a few of these studies formulated PSPSH as a multi-objective optimization problem (MOP) to reduce EB and improve UC level without considering PAR's effect in the scheduling processes [15].
Additional sources can be considered to improve the appliances' operation schedules, such as a smart home battery (SHB). SHB is a kind of electrical storage battery capable of charging and discharging numerous times on the basis of its settings. SHB is equipped with a management system to manage its operations [45].
The SHB was modeled using different settings and purposes. The authors of [16,[46][47][48][49] have modeled SHB to store power generated by renewable energy sources (RESs). SHB can be charged when RESs generate power more than what users need and can be discharged at peak periods or when the RESs are not able to meet users' power demands. The authors of [50,51] have modeled an SHB that can be charged, discharged, and floated without considering any RESs. This SHB is considered as an SA during the charging operations and as an additional power source during the discharging mode. The authors of [52] have modeled SHB to store power generated by RESs at periods of high electricity generation and from PSC during low electricity price periods. The proposed SHB can discharge the stored power during peak periods and when the grid is unable to meet users' power demand. However, these SHB models have several drawbacks, such as users are not able to know the exact amount of power that will be stored in the SHB ahead of time, and the SHB cannot discharge all stored amounts of power at the end of the time horizon.
In this paper, PSPSH is formulated as MOP (MO-PSPSH) that considers all PSPSH objectives, including EB and PAR, and UC level, to achieve them simultaneously. Moreover, MO-PSPSH approach is formulated alongside smart home battery (SHB) (BMO-PSPSH) to obtain an optimal achievement for PSPSH objectives. A new formulation for SHB is considered to reduce the amount of power consumed by smart home appliances at unsuitable periods that conflict with PSPSH objectives by storing power at suitable periods and discharging the stored power by appliances at the inappropriate periods. GWO is adapted to address PSPSH due to its high performance in exploring rugged and deep search spaces [12]. Besides, GWO efficiently maintains the balance between local and global optima in finding the optimal solution [12,53]. In the evaluation results, up to 23 types of home appliances are used for seven scenarios. The effect of the SHB is studied and compared with the approach without considering SHB to show its improvement to achieve better schedules. For comparative evaluation, the results obtained by GWO is compared with that of GA using the same datasets to show its performance in improving the outcomes.
The structure of this paper is organized as follows. Sections 2 and 3 discuss the PSPSH formulations and the multi-objective approach. In Section 4, the mathematical formulation of the SHB is provided and illustrated. A complete description of the inspiration and adaptation of GWO for PSPSH are illustrated and presented in Section 5. Section 6 presents the experimental results of the proposed approaches and Section 7 concludes the paper.

Power Scheduling Problem in Smart Home Formulation
In this section, the formulation of PSPSH is discussed. The section begins with the formulation of power consumption on the basis of smart home appliances classification. EB, PAR, and UC parameters are formulated in Sections 2.2-2.4.

Power Consumption
Generally, any smart home contains two types of home appliances, including shiftable appliances (SAs) and non-shiftable appliances (NSAs). SAs are operating automatically, where users can predefine their time parameters, including OTP and LOC. For example, users can predefine these parameters for the clothes dryer to be operated within a suitable period. NSAs are operating manually, where users cannot predefine their time parameters. For example, users cannot set periods to run the TV in advance.
This study's primary aim is to achieve PSPSH objectives optimally by scheduling SAs at convenient periods with respecting user satisfaction levels to operate NSAs manually.
We let S and NS be SAs and NSAs vectors, respectively, as shown in Equations (1) and (2).
where s 1 denotes the first SA in S, and s m is the last SA in S. m is the total number of SAs. NS = [ns 1 , ns 2 , . . . , ns q ], (2) where ns 1 denotes the first NSA in NS, and ns q is the last NSA in NS. q is the total number of NSAs. The power consumption of each SA in smart home can be formulated as follows: where ps j i is power consumed by s i at time slot t j . t j is a time slot in time horizon T which is presented in Equation (4). n is the total number of time slots in T As discussed previously, users can predefine the time parameters for SA including OTP and LOC. For OTP, users can define starting time (OTP s ) and ending time (OTP e ) of OTP as presented in Equations (5) and (6).
where OTP s1 and OTP e1 denote the starting and ending time of the first appliance period, respectively, and OTP sm and OTP em is the starting and ending time of the last appliance period, respectively. For the second time parameter, LOC of SAs is presented as follows: where l 1 denotes the LOC of the first SA, and l m is the LOC of the last SA. Furthermore, starting and ending time of SAs operations are presented in vectors St and Et, respectively, as shown in Equations (8) and (9). The aforementioned time parameters are illustrated in Figure 1.
where st 1 and et 1 are the starting and ending operations of s 1 , respectively, and st m and et m are the starting and ending operations of s m , respectively. As discussed previously, users cannot predefine the time parameters for NSAs. Therefore, the power consumption of NSAs (PNS) is formulated without considering T in the formulation as presented in Equation (10) PNS = [pns 1 , pns 2 , . . . , pns q ], (10) where pns 1 denotes the power consumption of ns 1 , and pns q is the power consumption of ns q .

Electricity Bill (EB)
The primary factor that motivates users to optimize their power consumption is reducing EB. EB for SAs can be calculated on the basis of Equation (11). Note that EB for NSAs cannot be calculated due to the unavailability of their operations time.
where pc j denotes electricity price tariff at time slot j. In this study, RTP is used as a dynamic pricing scheme. A combination of RTP and IBR is considered due to the IBR efficiency in dispersing power consumption of SAs and maintain power system stability [15]. The IBR provides two blocks of pricing tariff, including standard and high prices, as shown in Equations (12) and (13).
where a j and b j denote the standard and high prices, respectively, ps j is the power consumed by SAs at time slot j, and C is a threshold between a j and b j .
where λ is a positive number referring to a ratio between a j and b j .

Peak-to-Average Ratio (PAR)
The ratio of the highest power consumption to the average power consumption in T referred to PAR. Reducing PAR value is contributing to balancing power consumption and maintaining the stability of the power system. PAR is formulated as follows: where where PS max is the highest power consumed by SA during T and PS avg is the average power consumed during same time horizon.

User Comfort (UC) Level
Usually, the UC level can be improved by reducing delay time to operate SAs (waiting time rate (WTR)) [15]. A new parameter has been proposed by the authors of [12] to improve UC level by increasing the available power to operate NSAs within C (capacity power limit rate (CPR)). In this study, the two parameters of UC are considered in the scheduling processes to reduce the delay time for SAs and increase the available power for NSAs.
The first UC parameter WTR is formulated as follows: The average WTR for all SAs can be calculated using the formula in Equation (16).
For the second UC parameter CPR is formulated as follows: where ON A is the number of NSAs whose operation power exceeds available power at time slot j and it is formulated as follows: AP j denotes the available power to operate NSAs at a time slot j. AP j is calculated on the basis of power consumed by SAs at any time slot j and C as follows: The average CPR for T is formulated as follows: Note that the range of WTR avg and CPR avg values are between 0 and 1. Therefore, the percentage of UC level can be calculated as follows:

Multi-Objective Approach: Overview
Optimization problems involve finding the best solution(s) from all feasible solutions. The optimization problems can be classified into two classes on the basis of the number of objective functions, including a single objective optimization problem and MOP [54,55]. The single objective optimization problems can be solved using only one objective function, whereas MOP needs to optimize a set of two or more objective functions. Furthermore, these objective functions are usually conflicting with each other. For example, an optimization problem has two objective functions A and B; the obtained solution may be suitable for objective function A and bad for B, and vice versa. Accordingly, finding a suitable solution for such a problem that satisfies all objective functions is difficult [54,56].
Generally, MOP can be formulated as a maximization and minimization function. However, these functions can be transferred to each other by negating one of them as presented in Equation (22) min The general formulation of MOPs can be mathematically formulated as follows: where r is the number of objective functions, and d and p are inequality and equality constraints, respectively. The MOP is called unconstrained MOP if and only if d and p are equal to 0. Two main methods, namely, Pareto optimality and non-Pareto methods (scalarization methods), have been proposed to solve the MOP [57][58][59]. The idea of Pareto optimality is proposed to solve MOPs using non-dominated ranking and selection to move a population toward the Pareto front. The primary idea is to find a set of solutions in the population that are Pareto non-dominated by the rest of the solutions in the population. These solutions are at least as good as the other solutions for all objective function values, and they are better than the other solutions for at least one objective function value [57,60]. Non-Pareto methods (scalarization methods) do not explicitly use the concept of Pareto dominance [57]. These methods usually combine the objective function vector of the MOP into a scalar objective function. The most common scalarization methods are weighted sum and ξconstraint methods [57,61]. The weighted sum method is the simplest and most prominent method, where its formulation has no complexity and is easy to understand. The general procedure is to assign a convenient weight w > 0 to each objective function F c (x). The ξ-constraint method deals with only one objective function and considers the remaining objective functions as constraints.
The different objective functions have varying characteristics and may have varied value range; thus, the normalization must be implemented before applying some of the MOP methods, such as weighted sum method [62]. Several approaches have been proposed for the normalization where the most robust approach is the upper-lower bound approach [55,63]. In this approach, the minimum value (F 0 c ) and the maximum value (F max c ) of the objective functions should be determined in advance. This approach can be formulated as follows: Generally, the value range of F trans c is between 0 and 1. Notably, F 0 c and F max c should be determined before starting the normalization approach. However, this approach is inconvenient with objectives that have unknown F 0 c and F max c . Therefore, another approach has been proposed to tackle such an issue, and this approach is formulated in Equation (25) [12] F trans

Multi-Objective Approach for PSPSH (MO-PSPSH)
Formulating PSPSH as a single objective (EB reduction) may lead to some issues in balancing the power demand and improving the UC level due to the full concentration of the algorithm in reducing only EB while ignoring the other objectives.
The multi-objective approach is proposed for PSPSH (MO-PSPSH) to overcome the gaps in using the single objective. The proposed MO-PSPSH can optimize all the objectives of PSPSH, including (i) minimizing EB, (ii) minimizing PAR and balancing the power demand, and (iii) improving UC level by reducing the values of WTR and CPR simultaneously.
Several formulations for PSPSH as MOP have been done; the authors considered EB and user discomfort level on the basis of WTR in the formulation of multi-objective function using the weighted sum method [15,16,41]. Notably, these studies ignore PAR and CPR in the formulation of the multi-objective function, which results in their unexpected behavior in the evaluation process.
In this section, MO-PSPSH is modeled considering all objectives, including EB, PAR, WTR, and CPR reduction. A non-Pareto method called the weighted sum method is used for MO-PSPSH due to its simplicity, easy implementation, non-complexity, and wide utilization by the PSPSH state-of-the-art methods [55,62,64]. The idea of Pareto optimality is ignored in this study due to its ineffectiveness to optimization problems with more than three objectives, such as the one of MO-PSPSH [65][66][67]. MO-PSPSH has four accumulative parts. The formulation of MO-PSPSH has three main steps, which will be thoroughly discussed below.
Step 1: Choosing a convenient method to address MO-PSPSH.
The first step of formulating MO-PSPSH is to choose a method to solve the problem. As mentioned previously, the weighted sum method is the simplest method because it is easy to implement and has no complexity. Besides, this method is mostly used by PSPSH state-of-the-art methods. Therefore, this method is chosen to address the proposed MO-PSPSH. The procedure of the weighted sum method is to assign a convenient weight w > 0 to each objective function as follows: where w c ∈ [0, 1], and ∑ r c=1 w c is unity. In MO-PSPSH, the function has four accumulative parts, therefore, four values of w including, w 1 , w 2 , w 3 , and w 4 are considered. Note that, w 1 , w 2 , w 3 , and w 4 values are assigning on the basis of the problem and objective importance, where the essential objective should be awarded the highest weight.
Step 2: Normalize the objective function The second step of formulating MO-PSPSH is normalize the fitness values of EB, PAR, WTR, and CPR to equate their value ranges. In PSPSH, the value ranges of WTR and CPR are between 0 and 1, whereas the value ranges of EB and PAR are unknown. EB and PAR have unknown values of F 0 and F max . Therefore, their fitness values can be normalized using Equation (25), as follows: where A and B are two positive numbers.
Step 3: Modeling the MO-PSPSH After choosing a convenient method for MO-PSPSH and normalizing their fitness values, modeling MO-PSPSH is conducted in this step. Based on the objective functions in Equations (11), (14), (16) and (21), PSPSH is modeled in Equation (29) as a MOP.

Smart Home Battery (SHB): Overview
The SHB is a kind of electrical storage battery capable of charging and discharging numerous times in accordance with several constraints. SHB has a built-in battery man-agement system that makes it more flexible in managing the charging and discharging operations [45].
SHB plays an essential role in improving the stability of a power grid during peak periods and balancing the proportion between power generation and power demand [68]. Moreover, SHB can benefit users by optimizing their power usage and providing a power backup for use during unexpected failure periods [46,51,52,[69][70][71][72].
Several studies have proposed and modeled SHB using different terms, such as energy storage system [16,46,51,52], backup storage system [49,73], energy storage [47], battery energy storage system [48], smart battery [43,44], and battery [50]. The main purposes of these models are to improve the stability of the power system and achieve PSPSH objectives optimally.
The authors of [16,[46][47][48][49] have modeled SHB to store power generated by RESs. SHB can only store power and only if the RESs generate more power than what users need. The stored power in SHB can be used at peak periods or when the RESs are not able to meet users' power demands. However, this kind of SHB model has some drawbacks, including the inability to determine the amount of power that will be stored from RESs because the amount of power that will be generated by RESs is also unknown. Therefore, the values of EB, PAR, WTR, and CPR can be known only at the end of the considered time horizon and not ahead. Accordingly, PSC will not receive accurate feedback from users to anticipate the amount of power consumption in upcoming periods. In addition, SHB will be unusable if the RESs do not generate enough power.
The authors of [50,51] have modeled an SHB that can be charged, discharged, and floated without considering any RES. In the proposed model, SHB is regarded as a SA during the charging mode and as an additional power source during the discharging mode. The periods of charging, floating, and discharging modes of the SHB can be defined only by using the proposed scheduling algorithm. However, a drawback of this proposed model is that it does not consider a constraint regarding the balance of power between the charged and discharged amounts in the SHB. For example, the SHB can have a stored amount of power more than the discharged power, as shown in Figure 2. In this regard, at the end of the time horizon, some extra power will be charged in the SHB without discharge. Besides, the proposed model does not consider this extra power in the next time horizon. Therefore, these deficiencies will lead to an ineffective analysis of the obtained schedule because of the remaining power that will be wasted. The authors of [52] have modeled SHB to store power generated by RESs at periods of high electricity generation and from PSC during low electricity price periods. The proposed SHB can discharge the stored power during peak periods and when the grid is unable to meet users' power demand. This model faces the same issues discussed above. Accordingly, users cannot know their power curve in a time horizon ahead, and PSCs are not able to anticipate the amount of power in upcoming periods. In addition, some extra power will be charged in the SHB without any discharge.

Smart Home Battery for MO-PSPSH (BMO-PSPSH)
In this section, SHB is modeled to be charged, discharged, and free during the time horizon T. The proposed model of the SHB considers the charging mode as an SA that can be scheduled using the adapted algorithm, while the discharging mode is considered as an additional power source. In the free mode, the SHB is off. The SHB can be scheduled to charge at any time slot considering the available amount of power that can be discharged (i.e., the amount of power charged should not exceed the available amount of power that can be discharged). Besides, the SHB can be discharged at any time slot considering the charging mode and the amount of power charged (i.e., the SHB cannot be discharged at any charged time slot, and the discharged power must not exceed the power charged in SHB). The SHB is modeled to be fully discharged at the end of the time horizon (i.e., no power will transfer to the next time horizon) to evaluate each scenario separately. The SHB is modeled alongside the MO-PSPSH (BMO-PSPSH) to improve its solution(s) and achieve the objectives optimally. The SHB scheduling algorithm (BSA) is developed in this section to manage the modes of the SHB and control amounts of charging and discharging power. The proposed BSA has four main steps, which will be thoroughly discussed below. The flowchart of BSA is provided in Figure 3. Step 1: Initialize the SHB parameters As discussed previously, the charging operations of SHB will be scheduled as SAs in the smart home. Several SHB parameters should be initialized, including the maximum amount of power that can be stored in SHB, known as the capacity of SHB (Cap B ), the charging and discharging efficiency, known as the round trip of SHB efficiency (µ B ), the number of charging operations (CO) represented as CO = (co 1 , co 2 , . . . , co u ), the beginning and ending OTP of each charging operation OTPsc and OTPec represented as OTPsc = (OTPsc 1 , OTPsc 2 , . . . , OTPsc u ) and OTPec = (OTPec 1 , OTPec 2 , . . . , OTPec u ) respectively, and LOC for each charging operation (LOCc), such that LOCc = (lc 1 , lc 2 , . . . , lc u ). The Cap B and µ B are initialized by users, whereas CO, OTPsc, OTPec, and LOCc are initialized by the proposed BSA.
A constraint of the total number of COs (u) should be considered in this step as follows: where Ach denotes the number of possible time slots for SHB to be charged. Note that Ach is equal to half of T to keep enough time slots for SHB to be discharged. u is generated randomly in [1, Ach].
OTPsc and OTPec for each CO are initialized to be the beginning and ending, respectively, of the available period for SHB to be charged. OTPsc is set to the beginning of T, and OTPec is set to n − 1 to ensure that SHB not charging at the last time slot. For LOCc, each lc is set to be one-time slot (the smallest period to be scheduled).
Algorithm 1 shows the pseudocode for initializing the SHB parameters.

Algorithm 1 Pseudocode of SHB parameters initialization
Parameters initialized by users (Cap B , µ B ) Parameters initialized by BSA (CO, OTPsc, OTPec, LOCc) with respecting the Ach Return SHB parameters; Step 2: Initialize the SHB charging population Each solution of charging operations is represented as a vector containing the starting time for each charging operation (stc). The population of charging operations contains an N number of solutions initialized randomly, as shown in Equation (32).
Algorithm 2 shows the pseudocode for generating the SHB charging population.

Algorithm 2 Pseudocode for generating the SHB charging population
Create a charging operations population matrix of size (u × N) for each solution (y) do for each charging operation (c) do Initialize the values (stc) randomly with respecting OTPsc, OTPec, and LOCc of c end for end for Return SHB charging population; Step 3: Calculate the power consumed by the SHB charging operations In this step, the power charged in SHB by charging operation c at time slot j (PBco j c ) is calculated. PBco can be calculated as follows: where Pch j c is the power consumed by charging operation c at time slot j, which is generated randomly in [0, C − PS avg ] to ensure that it will be within the C or exceed it in the low margin, and µ ch is the SHB charging efficiency. Pch j c should not exceed the maximum allowable charge CH j at time slot j, as presented in Equation (34). where where CH is the maximum allowable charge and h is the length of a time slot in hours. In addition, to ensure that the stored power in SHB will not exceed the capacity of SHB, a constraint is formulated as follows: u and Pch are generated randomly by the BSA to increase their flexibility and allow the adapted algorithm to deal with the four objectives of PSPSH. After the PBco for all COs are calculated, the BSA will send COs to the adapted algorithm to be scheduled. Step 4: Discharge the SHB As mentioned previously, the discharging mode of SHB is considered as an additional source. In other words, discharging operations will not be scheduled by the adapted algorithm. However, the discharging mode is managed by the BSA to discharge power using the roulette wheel method, where the charged power will be discharged on the basis of the sizes of the parts on the wheel assigned for each time slot with considering the amount of power consumed at that time slots. In the roulette wheel method, big parts are assigned to high-pricing time slots and small parts to low-pricing time slots. The reason for assigning the part sizes this way in the distribution is to reduce the amount of power consumed at high-pricing time slots due to its effect on the stability of the power system and EBs. The roulette wheel method is used in this study due to its popularity and its performance in distributing individuals on the basis of their importance. Therefore, it gives a high chance for BSA to reduce the amount of power consumed at high-pricing time slots.
The possible time slots for SHB to be discharged is calculated using Equation (36).
where Adis denotes the available time slots for SHB to be discharged, Adis j is equal to 1 if SHB is able to discharge at time slot j and is 0 otherwise, PBco j can be 0 if SHB is not in the charging mode at time slot j, and ∑ j b=1 PBco b > 0 to ensure that SHB is not empty at time slot j.
After choosing a time slot to discharge SHB using the roulette wheel method, BSA will define the amount of power to discharge PBdo on the basis of the power consumed at that time slot as follows: where Pdis j is the amount of power that will be discharged from SHB at time slot j, which is generated randomly in [0, PS j ], and µ dis is the SHB discharging efficiency.
Pdis j will be released from SHB on the basis of Equation (38). BSA will keep choosing the discharging time slots and update the value of Adis until all of the power stored in SHB is discharged.
subject to: However, if the value of ∑ n j=1 Adis j is equal to 0 and some power is still considered as stored in SHB, then BSA will update the power of the last CO (i.e., PBco u ) to be equal to 0 and release it from SHB. The BSA will repeat this process until all of the remaining power in SHB is released Pdis j should not exceed the maximum allowable discharge DIS j at time slot j as follows: where DIS is the maximum allowable discharge. Note that the capacity of any SHB is defined according to the amount of power that can be discharged and not the amount that can be stored. For instance, the capacity of an SHB is 5 kWh, but the usable power is 4.5 kWh. Therefore, µ ch of the proposed SHB is set equal to µ B , while the µ dis is set equal to 1 [74].
Algorithm 4 shows the pseudocode of the discharging power.

Grey Wolf Optimizer for PSPSH
In this section, a swarm-based meta-heuristic optimization algorithm known as the grey wolf optimizer (GWO) algorithm is illustrated and adapted for MO-PSPSH and BMO-PSPSH. The GWO is adapted due to its powerful operations managed by its dynamic parameters to maintain the exploration and exploitation and avoid stagnation in local optima. Furthermore, GWO has a high ability to explore search spaces on the basis of the behavior of its solutions that allow it to search more deeply to find a better solution [12].

Grey Wolf Optimizer (GWO)
The GWO behavior is inspired mainly by the grey wolves hunting mechanism, and it was mathematically formulated in 2014 by Mirjalili [53].

Social Hierarchy
The pack of grey wolves has an austere social hierarchy, which is classified into alpha (α), beta (β), delta (δ), and omega (ω). Wolves belong to the class alpha are considered as the leader of the grey wolves' hierarchy due to their domination and power to manage the pack. The beta wolves are playing the primary role in support the alpha in leading the pack. Delta wolves are in the third level of the hierarchy, and they in charge of leading the lowest level in the hierarchy. Omega wolves are considered as the lowest level in the hierarchy.
In GWO, the solutions are represented as grey wolves in the social hierarchy, where the best solution is represented as α wolf, β and δ wolves are the second and third best solutions, respectively, and ω wolves are considered as the rest of the solutions.

Encircling Prey
In addition to this deep social hierarchy, the intelligent behavior of group hunting is also procedurally modeled. This behavior involves three main phases: chasing, encircling, and attacking.
The grey wolves can change/update their locations closer to the prey by encircling the prey mechanism. The encircling behavior of grey wolves is formulated as follows: where − → C and − → A denote coefficient vectors, − → X is the grey wolf position vector, − → X p is the prey position vector, and itr is the current iteration.

The coefficient vectors
where − → a is linearly decreased from 2 to 0 throughout iterations and − → r 1 , − → r 2 are random vectors in range of 0 and 1. Based on the values of − → a , the value range of − → A is between −2a and 2a.

Search for Prey (Exploration)
The grey wolves searching mechanism for prey can be done on the basis of the wolves' positions, where the wolves diverge and converge to find the best position to attack prey. The coefficient vectors − → A and − → C manage the divergence (exploration) and convergence (exploitation) of the wolves in GWO. GWO exploit a search space if | − → A | < 1 and explore a search space if | − → A | > 1.
The changing values in − → C is not similar to − → A , where − → C is changing randomly to emphasize exploration/exploitation and local optima stagnation avoidance throughout iterations.

Hunting
As mentioned previously, in GWO, the best three solutions are α, β, and δ wolves, respectively, and ω wolves are the rest of the solutions.
Owing to the domination and leadership of α wolf on the pack, α usually guides the hunting. β and δ wolves occasionally can engage in hunting to help α wolf. ω wolves are usually changing their location according to the three best solutions (α, β, and δ).
The hunting mechanism on the basis of these wolves (solutions) is formulated as follows: To change the location of the ω wolves for hunting in accordance with the α, β and δ wolves, the location of the prey should be estimated by these three wolves.

Grey Wolf Optimizer for PSPSH
GWO is a swarm-based optimization algorithm that emphasizes exploration and exploitation using the two parameters (A, C). Besides, GWO can optimally explore the search space using the best three solutions (α, β, δ). Accordingly, GWO is adapted for MO-PSPSH (MO-PSPSH-GWO) and BMO-PSPSH (BMO-PSPSH-GWO) to find the optimal schedule and achieve all PSPSH objectives optimally with and without using SHB. Each solution is evaluated on the basis of the objective function formulated in Equation (29). The GWO adaptation for the two approaches is illustrated in the sections below. •

GWO adaptation for MO-PSPSH (MO-PSPSH-GWO)
The adaptation of the GWO for MO-PSPSH is discussed in this section. This adaptation contains five main steps, which are illustrated below. The flowchart of the proposed MO-PSPSH-GWO is provided in Figure 4.
Step 1: Initialize MO-PSPSH-GWO parameters The adaptation the MO-PSPSH-GWO is started by initializing the parameters of PSPSH and GWO. The PSPSH parameters are S, NS, T, PS, PNS, LOC, OTPs, OTPe, and pc. The GWO parameters are − → A , − → C , − → a , − → r 1 , − → r 2 , the minimum (lb) and maximum (ub) ranges for the search agent, the maximum number of iterations (I), and the number of search agents in the pack (N).
Step 2: Initialize MO-PSPSH-GWO population Each wolf in the pack is presented as a solution of MO-PSPSH-GWO, and each solution is containing the starting time st for each appliance i, as shown in Figure 5.  Step 3: Fitness function calculation The fitness value of each solution is calculated on the basis of Equation (29).
In the MO-PSPSH-GWO method, the best solution and its fitness value are assigned to X α and f (X α ),respectively, and the second and third best solutions and their fitness values are assigned to X β , X δ , and f (X β ), f (X δ ), respectively.

GWO adaptation for BMO-PSPSH (BMO-PSPSH-GWO)
BMO-PSPSH-GWO has six main steps, which will be thoroughly discussed below. The flowchart of BMO-PSPSH-GWO is provided in Figure 6. Step Step 3: Calculate the power consumed by the charging operations In this step, the power charged in SHB by each charging operation will be calculated as discussed in the third step of designing BSA in Section 4.2.

Step 4: Calculate the fitness values
This step is divided into two parts, namely, discharging the SHB and calculating the fitness values of the solution in the population. As discussed in Section 4.2, the time slots for discharging the SHB are determined using the roulette wheel method and the amount of power chosen randomly on the basis of several equations and constraints. In this step, the processes of discharging the SHB are the same as discussed in Section 4.2. For calculating the fitness values, the three best fitness values and their solutions are assigned as f (X α ), f (X β ), and f (X δ ), and X α , X β , and X δ , respectively.

Experiments and Results
The experiments are designed in this section to evaluate the proposed MO-PSPSH and BMO-PSPSH methods using the GWO. MO-PSPSH-GWO and BMO-PSPSH-GWO are evaluated to show their effect in achieving PSPSH objectives. These approaches are compared to show whether BMO-PSPSH-GWO can obtain a better schedule than MO-PSPSH-GWO. For comparison study, the proposed approaches are compared with 17 state-of-the-arts methods using their recommended datasets. Furthermore, the GWO performance is compared with that of GA and PSO to show its performance in achieving the PSPSH objectives.
The proposed methods are implemented and executed using MATLAB on a PC with Intel Core2 Quad CPU, 2.66 GHz processor and 8 GB of memory (RAM)

Dataset Description
In this study, nine types of SAs are considered for up to 36 operations, where some of these SAs can operate more than once.
The smallest LOC of the SAs is set to 1 minute, where each minute is considered as a time slot in T. Accordingly, the T vector in this dataset is presented as T = (t 1 , t 2 , t 3 , . . . , t 1440 ). Table 1 shows the main characteristics of the SAs, including the LOC and OTP of each SA. As mentioned previously, the RTP scheme is used and combined with the IBR scheme due to the IBR performance in dispersing the power consumption throughout the time horizon. RTP is adopted from the Commonwealth Edison Company between the 1st of June, 2016, and the 7th of June, 2016, for a duration of one week (seven days ⇔ seven scenarios) [12,75].

No.
Appliances Power (kW) For the GWO parameters, the algorithm run 1000 iterations in each run since the 1000 generations are enough for convergence of algorithms [78]. Table 4 presents the parameter setting for the GWO. Table 4. Parameters used in GWO algorithm.

Parameter
Value The same features of Tesla Powerwall 2 are used for the SHB in this study [79]. Table 5 shows the proposed SHB parameters.

Experimental Evaluation
In this section, the simulation results are presented to show whether the BMO-PSPSH-GWO method can obtain a better schedule than considering the MO-PSPSH-GWO method. The performance of BMO-PSPSH-GWO and MO-PSPSH-GWO on EB, PAR, WTR, and CPR reduction is evaluated and analyzed.
As discussed in Section 3, using the MO-PSPSH each objective assigned with a weight that denoting its importance. Therefore, the weight (w 1 ) assigned to EB is the highest, due to its significance in optimizing PSPSH, where it is the main benefit gaining by users [6]. Accordingly, w 1 is assigned by 0.4, and each of w 2 , w 3 , and w 4 assigned by 0.2 (Equation (29)).

Effect of The Proposed Approaches on EB
The effect of BMO-PSPSH-GWO and MO-PSPSH-GWO on EB reduction is presented in this section. The results of BMO-PSPSH-GWO are compared with MO-PSPSH-GWO to investigate whether the proposed SHB can improve the solution in terms of reducing EB. EB obtained by these approaches is compared in Table 6. The table shows EB obtained by the two approaches for the seven scenarios, a comparison between the two approaches in terms of average and total EB is shown in the table as well. BMO-PSPSH-GWO reduces EB better than MO-PSPSH-GWO in all scenarios due to the performance of SHB in reducing EB by scheduling the charging operations of SHB at the best time slots based on Equation (29); i.e., schedule several charging operations at low pricing periods and discharge SHB at high pricing periods.

Effect of The Proposed Approaches on PAR
As shown in the previous section, the proposed BMO-PSPSH-GWO has a high effect in reducing EB because it stores power at low pricing periods and uses the stored power at high pricing periods. In this section, the effect of BMO-PSPSH-GWO on PAR value is presented and compared with PAR value obtained using MO-PSPSH-GWO.
PAR values obtained by the BMO-PSPSH-GWO approach for the seven scenarios are shown in Table 7. Besides, the table presents PAR obtained by MO-PSPSH-GWO to show whether MO-PSPSH-GWO or BMO-PSPSH-GWO can reduce PAR values better. Notably, MO-PSPSH-GWO obtained better PAR values than BMO-PSPSH-GWO in all scenarios due to increasing amount of power consumed by SHB at low pricing period and increase PS max value (Equation (14)); therefore, increase PAR values, as shown in Figure 8.
(a) Power consumption curve for the first scenario Power consumption curve for the second scenario (c) Power consumption curve for the third scenario (d) Power consumption curve for the forth scenario (e) Power consumption curve for the fifth scenario (g) Power consumption curve for the seventh scenario

Effect of The Proposed Approaches on UC level
As discussed previously, the UC level in this study is evaluated on the basis of WTR and CPR. UC level can be improved by reducing the values of the two parameters. The effect of BMO-PSPSH-GWO on UC parameters are presented and compared with MO-PSPSH-GWO in this section. Tables 8 and 9 present WTR and CPR values obtained by MO-PSPSH-GWO and BMO-PSPSH-GWO for the seven days, respectively, to show which approach got a better schedule in terms of improving UC level.   Tables 8 and 9 show the high performance of BMO-PSPSH-GWO in reducing WTR and CPR, where it outperforms MO-PSPSH-GWO in most of the scenarios and their average values. The reduction of WTR is because of BSA's mechanism that schedules SHB to discharge power at suitable time slots (e.g., time slots at the beginning of OTP) that allow SAs to operate at the beginning of OTP using suitable pricing tariffs. For CPR, its values are reduced because of increasing available power to operate NSAs due to reducing some power exceeds or near the threshold.
The UC level is increased using BMO-PSPSH-GWO by up to 2% compared with MO-PSPSH-GWO, as shown in Table 10. In addition, the table shows the UC percentage for the seven scenarios obtained by the two approaches. Bold values indicate the best value in each scenario.

Discussion
The performance of BMO-PSPSH-GWO is evaluated against MO-PSPSH-GWO for seven scenarios (1 week). The evaluation is designed to show the proposed approach's performance in achieving PSPSH objectives. SHB is proposed alongside MO-PSPSH to improve the schedule and mainly enhance the reduction of EB with considering the other objectives reduction. In addition, SHB reduces the amount of power consumed by SAs at unsuitable periods that are conflicting with PSPSH objectives, by storing power at suitable periods and discharge the stored power at the unsuitable periods. The price scheme used in this study is the RTP scheme combined with the IBR scheme. This combination is provided to disperse power consumption throughout the time horizon.
The simulation results show high performance of BMO-PSPSH-GWO, where it outperforms MO-PSPSH-GWO in reducing EB, WTR, and CPR, whereas MO-PSPSH-GWO obtains better result only in reducing the PAR value. However, BMO-PSPSH-GWO does not obtain a better PAR reduction than MO-PSPSH-GWO due to the increasing amount of power consumed at low pricing periods and increase the value PS max (Equation (14)).
Note that the cost of the SHB used in this study is not considered due to the four objectives (i.e., EB, PAR, WTR, and CPR) that are affected by the SHB, where it seems hard and impractical to compare its cost with the four objectives values. In addition, the SHB used in this study has an unlimited life cycle; therefore, it can provide benefits for an extensive time.

Comparative Evaluation
Two types of comparisons are conducted in this study, including comparison with state-of-the-art methods using their datasets, and the most popular metaheuristic optimization algorithms were adapted for PSPSH using the proposed SHB and datasets. The state-of-the-art methods are HSA and BFOA [42], GA, BPSO, and WDO [80], GA and GWO [81], GOA, CSA, ACO, FA, and MFO [82], and GA and DA [83]. The basic metaheuristic optimization algorithms are GA, BFOA, HSA, and PSO [14].

Comparison with State-of-the-Art Methods Using Their Datasets
This section compares the proposed method using SHB with 17 state-of-the-art methods using their recommended datasets. The compared studies used different types of objective functions, including single objective and MO functions. Therefore, the compared studies' objective functions are considered with the proposed SHB (B-PSPSH-GWO) in this comparison study instead of the BMO-PSPSH approach. The evaluation in this comparison is analyzed on the basis of the values of EB and PAR. UC level is not conducted in this comparison because it was used in the studies based on different criteria. Table 11 summarized the features of the compared studies, including the study, method used, number of appliances, pricing scheme used.  Table 12 shows the results obtained by the methods in each study and the proposed B-PSPSH-GWO. The results prove the robust performance of the proposed SHB for PSPSH in reducing EB, where the proposed B-PSPSH-GWO shows a significant reduction in EB compared with all other methods. However, as discussed previously, due to the mechanism of the SHB in using power at low peak periods, the power consumed at these periods are higher than the others. Therefore, the PAR value is expected to be increased, which explains the high values of PAR obtained by the proposed B-PSPSH-GWO compared with the other methods. Bold values indicate the best value in each scenario.

Comparison with State-of-the-Art Methods Using the Proposed Datasets
This section mainly compares the performance of the GWO with that of GA, PSO, HSA, and BFOA using the proposed SHB for PSPSH. The performance of these algorithms is evaluated on the basis of the PSPSH objectives, including EB, PAR, WTR, and CPR.
The datasets used in this comparison study are presented in Tables 1-3.  Table 13 shows EBs obtained by the GWO, GA, PSO, HSA, and BFOA for seven scenarios. In addition, the average EB obtained by these algorithms are presented. The GWO proves its high performance in reducing EB, where it achieves the best EB against the other methods.
PAR values obtained by these algorithms are presented in Table 14. The table shows the robust performance of GWO in dispersing the power consumed through the time horizon, where it achieves the lowest overall PAR compared with the other algorithms. WTR and CPR values achieved by the five algorithms for the same scenarios are compared in Tables 15 and 16. The tables present and prove the robust performance of the GWO in reducing WTR and CPR values, where it obtains the best WTR in all scenarios and the best CPR in five scenarios compared with the other algorithms. In addition, GWO achieves the best overall reduction by obtaining the best average WTR and CPR values. Accordingly, GWO got the highest improvement for UC level, as shown in Table 17.
This comparison study proves the robust performance of the GWO in addressing PSPSH, where it outperforms all other compared algorithms in achieving PSPSH objectives, including EB, PAR, WTR, and CPR.

Conclusions and Future Research
PSPSH refers to a timely schedule of operations of smart home appliances in accordance with a set of restrictions and a dynamic pricing scheme(s). The primary objectives of PSPSH are minimizing EB, PAR, and user discomfort levels. The RTP is combined with the IBR scheme in this study to provide different prices on the basis of time changing and the amount of power consumed. PSPSH is formulated as a MOP (MO-PSPSH) to achieve all objectives simultaneously. SHB can enhance the scheduling of appliances by storing power at unsuitable periods and use the stored power at suitable periods for PSPSH objectives. Therefore, a new formulation for SHB to improve the PSPSH solutions' quality is provided in this paper.
GWO is adapted to address MO-PSPSH (MO-PSPSH-GWO) and BMO-PSPSH (BMO-PSPSH-GWO) approaches due to its powerful operations managed by its dynamic parameters that maintain exploration and exploitation in search space.
Seven scenarios of power consumption and RTP schemes are considered in the simulation results to evaluate the proposed MO-PSPSH-GWO and BMO-PSPSH-GWO. The results demonstrated the efficiency of BMO-PSPSH-GWO compared with MO-PSPSH-GWO, where it obtains better results in minimizing EB, WTR, and CPR, and improving UC level. However, MO-PSPSH-GWO achieves better PAR values than BMO-PSPSH-GWO. For comparison evaluation, the proposed BMO-PSPSH-GWO compared with 17 state-of-the-art algorithms using their recommended datasets and four algorithms using the proposed datasets. The proposed BMO-PSPSH-GWO exhibits and yields better performance than the other compared algorithms in almost all scenarios.
Possible future directions can use more scenarios and standard datasets to evaluate the proposed approaches robustly. In addition, the GWO can be hybridized with another algorithm to address its defects and exhibits better results for PSPSH.

Data Availability Statement:
The data is available from the corresponding author upon reasonable request.

Conflicts of Interest:
The authors declare no conflict of interest.