Optimal Scheduling of Residential Home Appliances by Considering Energy Storage and Stochastically Modelled Photovoltaics in a Grid Exchange Environment Using Hybrid Grey Wolf Genetic Algorithm Optimizer

The transformation of a conventional power system to a smart grid has been underway over the last few decades. A smart grid provides opportunities to integrate smart homes with renewable energy resources (RERs). Moreover, it encourages the residential consumers to regulate their home energy consumption in an effective way that suits their lifestyle and it also helps to preserve the environment. Keeping in mind the techno-economic reasons for household energy management, active participation of consumers in grid operations is necessary for peak reduction, valley filling, strategic load conservation, and growth. In this context, this paper presents an efficient home energy management system (HEMS) for consumer appliance scheduling in the presence of an energy storage system and photovoltaic generation with the intention to reduce the energy consumption cost determined by the service provider. To study the benefits of a home-to-grid (H2G) energy exchange in HEMS, photovoltaic generation is stochastically modelled by considering an energy storage system. The prime consideration of this paper is to propose a hybrid optimization approach based on heuristic techniques, grey wolf optimization, and a genetic algorithm termed a hybrid grey wolf genetic algorithm to model HEMS for residential consumers with the objectives to reduce energy consumption cost and the peak-to-average ratio. The effectiveness of the proposed scheme is validated through simulations performed for a residential consumer with several domestic appliances and their scheduling preferences by considering real-time pricing and critical peak-pricing tariff signals. Results related to the reduction in the peak-to-average ratio and energy cost demonstrate that the proposed hybrid optimization technique performs well in comparison with different meta-heuristic techniques available in the literature. The findings of the proposed methodology can further be used to calculate the impact of different demand response signals on the operation and reliability of a power system.


Introduction
The increasing costs of energy and environmental contamination are major concerns in today's world [1]. As most of the power plants rely on fossil fuel resources for electricity production, they are depleting at a fast rate. Moreover, the increased utilization of fossil fuels is resulting in global warming, which is a challenging issue to deal with. These seminal drivers have led to the belief that the need for public and private decision-makers to transition toward green and sustainable energy is inexorable. The integration of renewable energy resources (RERs), especially solar and wind, is a handy option for generating green electricity with reduced global warming effects [2,3].
These factors lead us to the concept of a smart grid, which is a digital, bidirectional network of distributed generators. Due to installed sensors, it has the capabilities of self-monitoring, self-healing, remote control, and pervasive control [4,5]. A smart grid offers opportunities for maximum energy savings by organizing energy management systems (EMSs) and their functions. It relies on intelligent control devices to establish an efficient communication between the consumer and utility provider.
Mutual coordination between electric grids, utility operators, and smart homes is the main point that allows a smart grid to work accurately. A major part of electrical energy is being utilized for serving residential communities. According to Lior [6], 30-40% of the overall supplied energy is used in residential houses. Therefore, energy management in residential homes plays an important role in reducing the consumption of electrical energy supplied by the grid to diminish the peak load on grids. With the improvement in control and communication methodologies, home energy management systems (HEMSs) are playing an important role in reducing electricity consumption in residential buildings. An optimal collaboration between smart homes and the utility provider due to HEMS decreases electricity consumption cost [7].
Moreover, an optimum collaboration between smart homes and a smart grid saves 10-30% of electrical energy consumed from the grid [8]. Electricity providing utilities introduced different dynamic tariff structures to encourage the electricity customers to decrease their consumption in high-tariff time slots [9,10]. Based on this information, a smart grid utilizes supply-side management (SSM) and demand-side management (DSM) tools for energy conservation. The optimization activities covered in SSM are implemented regarding the generation, transmission, and distribution sides of the energy chain, while in DSM, the consumer side load management is performed based on the demand response. The electricity consumption charges may be reduced by shifting household appliances from a peak tariff time to an off-peak tariff time.
The users can get maximum benefits in terms of a decrease in electricity consumption charges, reduction in the peak-to-average ratio (PAR) and avoiding energy blackouts due to two features of DSM, namely the demand response (DR) and load management (LM) [11]. DR programs play a significant role in a smart grid operation by scheduling household appliances from away from high-tariff time slots to low-tariff time slots according to time-based electricity tariffs, which are explained in References [9,12].
DR programs are further classified into two types, i.e., incentive-based (IB) and price-based (PB) DR programs. Figure 1 represents the classification of DR programs. In IB DR programs, the utility wirelessly shifts home appliances to an OFF state by sending a short notice to consumers whenever a peak demand occurs in any time slot [13]. Using the PB DR programs, the electricity utilities encourage the electricity users to adopt efficient scheduling strategies such that they can minimize their electrical energy consumption and reduce their electricity consumption costs [14].
This paper focuses on PB DR programs with the integration of RERs, and energy storage system (ESS), and a smart meter at each home. The smart meter continuously provides information related to hourly tariffs that are declared by the electricity provider to the consumer. Due to this, the electricity users schedule their hourly load according to the declared utility tariffs. This hourly electricity load management is useful for both electricity consumers and electricity providers in terms of reducing electricity consumption costs and improving the stability of the power system.
In the proposed HEMS scheme, an ESS and photovoltaic (PV) generation system were further integrated to improve the performance of the primitive HEMS. Three optimization algorithms, i.e., a genetic algorithm (GA); grey wolf optimization (GWO); and the proposed hybrid technique based on GWO and GA, named a hybrid grey wolf genetic algorithm (HGWGA), that considers real-time pricing (RTP) and critical peak pricing (CPP) tariff schemes, were used to solve the scheduling problem. Simulation results demonstrate that the proposed hybrid optimization technique performed well at reducing the PAR and consumption costs of electricity. However, there is always a trade-off between consumer electricity consumption cost and consumer appliance waiting time (AWT). Whenever the consumer electricity consumption cost was at a minimum, the consumer AWT was at a maximum and vice versa.

Contributions
The main contributions of this paper are: i.
The application of a hybrid optimization technique (HGWGA) to effectively solve the appliance scheduling problem. ii.
The integration of stochastic models of ESS, a PV system, and loads for optimal scheduling. iii.
The investigation of RTP and CPP tariffs using the proposed model for optimal scheduling.
The rest of the paper is organized in the following manner. Section 2 presents a technological review of the literature, while in Section 3, mathematical models of a HEMS are discussed. Section 4 formulates the load scheduling problem by discussing issues regarding consumer energy consumption, electricity consumption cost, PAR, AWT, and the objective function. The heuristic In IB DR programs, the utility wirelessly shifts home appliances to an OFF state by sending a short notice to consumers whenever a peak demand occurs in any time slot [13]. Using the PB DR programs, the electricity utilities encourage the electricity users to adopt efficient scheduling strategies such that they can minimize their electrical energy consumption and reduce their electricity consumption costs [14].
This paper focuses on PB DR programs with the integration of RERs, and energy storage system (ESS), and a smart meter at each home. The smart meter continuously provides information related to hourly tariffs that are declared by the electricity provider to the consumer. Due to this, the electricity users schedule their hourly load according to the declared utility tariffs. This hourly electricity load management is useful for both electricity consumers and electricity providers in terms of reducing electricity consumption costs and improving the stability of the power system.
In the proposed HEMS scheme, an ESS and photovoltaic (PV) generation system were further integrated to improve the performance of the primitive HEMS. Three optimization algorithms, i.e., a genetic algorithm (GA); grey wolf optimization (GWO); and the proposed hybrid technique based on GWO and GA, named a hybrid grey wolf genetic algorithm (HGWGA), that considers real-time pricing (RTP) and critical peak pricing (CPP) tariff schemes, were used to solve the scheduling problem. Simulation results demonstrate that the proposed hybrid optimization technique performed well at reducing the PAR and consumption costs of electricity. However, there is always a trade-off between consumer electricity consumption cost and consumer appliance waiting time (AWT). Whenever the consumer electricity consumption cost was at a minimum, the consumer AWT was at a maximum and vice versa.

Contributions
The main contributions of this paper are: i.
The application of a hybrid optimization technique (HGWGA) to effectively solve the appliance scheduling problem. ii.
The integration of stochastic models of ESS, a PV system, and loads for optimal scheduling. iii.
The investigation of RTP and CPP tariffs using the proposed model for optimal scheduling.
The rest of the paper is organized in the following manner. Section 2 presents a technological review of the literature, while in Section 3, mathematical models of a HEMS are discussed. Section 4 Javaid et al. [29] applied a GA, BPSO, and a Cuckoo search optimization algorithm (CSOA) to develop an optimal scheduling strategy for residential appliances in the presence of an ESS and RERs. The objective of the implemented idea was to reduce the consumers' electricity cost under a ToU tariff scheme and minimize the PAR.
Basit et al. [30] presented a model to solve an appliance scheduling problem by using the Dijkstra algorithm and reducing the system complexity. Integration of the ESS and RERs were not considered in their proposed model.
The minimization of the consumption cost of electricity in a smart grid environment using an evolutionary technique was discussed in Mary and Rajarajeswari [31] through the integration of an ESS. During a low electricity tariff time, energy was stored in the ESS and it was utilized during the peak-tariff time. Charging and discharging limits of the battery per time slot were also defined by the authors to avoid battery damage. However, the authors did not consider the installation cost of the storage system.
An innovative technique was proposed in Bharathi and Vijayakumar [32] to keep the supply demand balance in residential, commercial, and industrial areas. The authors compared the electrical consumption of different residential consumer's datasets via a GA-assisted DSM and a simple DSM. Simulation results demonstrated that a DSM with a GA (DSM-GA) gave better results than a DSM without GA. The PAR and consumer comfort were not considered by the authors in their proposed model.
Asgher et al. presented a strategy for residential load management with the integration of RERs [33]. Their proposed scheme used a GA to optimally schedule the load demand using a day-ahead pricing (DAP) tariff to meet the cost-minimization and PAR-reduction objectives.
Sharifi and Maghouli [34] proposed a novel scheduling mechanism for home appliances to reduce the consumption costs and the PAR. The scheduling model is implemented in inclined block rate (IBR) and real-time pricing schemes to avoid a peak demand during low-tariff times, which would improve the PAR index as well. A non-dominated sorting genetic algorithm (NSGA) was adopted to solve the optimization problem in a MATLAB simulation environment.
Aslam et al. [35] proposed a scheduling technique for minimizing the residential consumer electrical energy consumption and reducing the PAR with the help of the heuristic techniques of a GA, CSOA, and a Crow search algorithm (CSA) under RTP and CPP tariff schemes. However, the integration of RERs was not considered in their proposed model.
Hafeez et al. [36] formulated a scheduling problem for residential consumer home appliances using a GA, BPSO, wind-driven optimization (WDO), and hybrid framework of a GA and WDO. The minimization of the electricity consumption cost and the decrease in the PAR were the main objectives in the RTP and inclined block rate (IBR) tariff schemes. The simulation results demonstrated that the above-mentioned methodology achieved the defined objectives in an effective way. However, in the proposed scheme, the authors did not consider the H2G energy exchange environment.
Tsui and Chan [37] developed a scheduling scheme for residential consumer home appliances using convex programming (CP) to minimize the electricity consumption cost and decrease in the PAR. In this model, the RTP tariff scheme was used for the calculation of the electricity consumption cost. It can be concluded from the results that the proposed model is able to effectively achieve the objectives.
To maintain the balance between the residential electrical energy demand and supply, a fuzzy logic (FL)-based model is presented in Wu et al. [38]. An ESS and PV system are also integrated in their scheduling scheme. The proposed scheme has the ability to schedule the home appliances, ESS, and PV in an optimal way. Naz et al. [39] applied an enhanced differential evolution algorithm (EDEA), GWO, and a hybrid framework of EDEA and GWO to develop an optimal scheduling strategy for residential appliances in the presence of an ESS and RERs. The implemented idea was to minimize the consumer electricity cost and reduction in the PAR under RTP and CPP tariff schemes.
Khan et al. [40] designed a scheduling problem for residential consumer home appliances by using a harmony search algorithm (HSA), EDEA, and a hybrid framework of HSA and EDEA. The minimization of the electricity consumption charges and decrease in the PAR were the main objectives. In this model, the RTP tariff scheme was used for the electricity consumption cost calculation. Simulation results demonstrated that the above-mentioned methodology achieved the defined objectives in an effective way.
Setlhaolo et al. [41] developed a model for residential consumers to diminish their electricity consumption charges under a ToU tariff scheme. They applied a mixed-integer non-linear programming (MINLP) scheme without considering the PAR in their proposed model.
An integer linear programming (ILP) scheme was proposed for residential areas in Zhu et al. [42] to meet the supply-demand balance objective while reducing the consumption cost of electricity. Since the proposed scheme could schedule the home appliances in an optimal way, the supply-demand balance goal was achieved after the optimal scheduling of household appliances for several consumers. This study ignores the users' comfort in the modeling.
A dynamic programming (DP)-based appliance scheduling model is proposed in Samadi et al. [43] for the optimal shifting of consumers' household appliances in a defined time interval by considering the appliance preferences set by the consumers. The main aim of this scheduling strategy was to decrease the consumer electricity consumption charges by rescheduling consumer home appliances from a high-tariff time interval to a low-tariff time interval according to their preferences.
Keeping in mind the above literature, it can be summarized that the design of a HEMS has been optimized by various algorithms: MILP, EDA, linear programming (LP), PSO, DP, convex programming (CP), bacterial foraging algorithm (BFA), score-based intelligent home energy management algorithm, ILP, Dijkstra algorithm, and MINLP. Nevertheless, in some scenarios, these techniques are unable to deal with the volatile nature of different appliances. Furthermore, the convergence rate in some cases was found to be extremely slow because these algorithms were often stuck in local minimum solution. Some important practical constraints, such as the maximization of user comfort, dynamic pricing scheme, and the integration of an ESS and RERs, are somehow rarely considered while using such techniques. In addition, previously proposed models were based on the deterministic modeling of the load, ESS, and RERs. As RERs, such as solar and wind, are weather-dependent, the energy produced by these resources is variable and uncertain. This variability is generally modeled through stochastic or probabilistic approaches. Therefore, this paper presents an optimal design of a HEMS incorporated with the probabilistic modeling of the loads, ESS, and PV by considering RTP and CPP tariff schemes to provide a reduced consumption cost and a better consumption pattern, which indicates reduction in PAR using a GWO, GA, and the proposed hybrid (HGWGA) technique.

System Architecture
The proposed architecture of a HEMS consists of an energy management controller (EMC), smart meter, display system, smart scheduler unit (SMSU), PV system, ESS, power electronic converter, and a set of appliances. A power electronic converter serves the purpose of a rectifier and inverter. The smart appliances, PV system, and ESS are connected to the EMC and SMSU through a wireless system in this research. The smart meter is connected to the SMSU and receives RTP and CPP tariff signals through an advanced metering infrastructure (AMI). Based on the received tariff signals and the operating preferences set by the user regarding appliance operations, the SMSU employs heuristic optimization algorithms to find the optimal scheduling of appliances that results in reduction of energy cost as well as the peak demand. These scheduling results are transmitted to an EMC, which schedules the home appliances without compromising the consumer's comfort. The architecture of the proposed model is shown in Figure 2. It is assumed that the H2G energy exchange through a smart meter is allowed. These types of tariffs are normally termed as net-metering or net-billing.

Smart Homes Appliance Models
For the performance evaluation of the proposed methodology, smart home appliances were classified in three different categories. These categories included deferrable appliances, base load

Smart Homes Appliance Models
For the performance evaluation of the proposed methodology, smart home appliances were classified in three different categories. These categories included deferrable appliances, base load appliances, and non-deferrable appliances. The total number of user appliances was represented by A n . Deferrable appliances, base load appliances, and non-deferrable appliances were represented by A d , A b , and A nd , respectively. According to the user requirements and preferences, all user appliances were scheduled with a 24-h time horizon, as expressed in Equation (1).
The execution period for each appliance should be within the earliest starting time (ὰ) and least finishing time (β), as represented in Figure 3. The difference between the earliest starting time and the actual starting time is known as the waiting time of the individual appliance.ὰ andβ for individual appliances were circumscribed by the consumer, as described in Table 1. In the proposed home appliance scheduling scheme, twelve different rudimentary appliances were considered for a smart home, which are mentioned in Table 1. appliances, and non-deferrable appliances. The total number of user appliances was represented by . Deferrable appliances, base load appliances, and non-deferrable appliances were represented by , , and , respectively. According to the user requirements and preferences, all user appliances were scheduled with a 24-h time horizon, as expressed in Equation (1).
The execution period for each appliance should be within the earliest starting time (ἀ) and least finishing time ( ), as represented in Figure 3. The difference between the earliest starting time and the actual starting time is known as the waiting time of the individual appliance. ἀ and for individual appliances were circumscribed by the consumer, as described in Table 1. In the proposed home appliance scheduling scheme, twelve different rudimentary appliances were considered for a smart home, which are mentioned in Table 1.

Base Load Appliances
Base load appliances are in the first category of appliances and run as a base load in a smart home. Their operating time cannot be changed; however, these appliances can be scheduled between their starting and ending time as defined by the consumer.
∈ represents any appliance belonging to the base load category of appliances. The total energy consumption utilized by base appliances belonging to set during any time slot ℎ is given by in Equations (13) and (14).

Deferrable Appliances
The household appliances in this category can be interrupted or shifted in any allowable time range according to their requirements for achieving the optimal scheduling in a smart home. The set of deferrable appliances is represented by , and ∈ denotes each appliance in this category. The total energy consumed by all the appliances of this category is represented by in Equations (13) and (14).

Non-Deferrable Appliances
The category of household appliances that cannot be interrupted after the beginning of their operation are non-deferrable appliances. However, these appliances can be shifted in their allowable time range before starting their action in such a way that their operating cycle could be complete after shifting. The set of non-deferrable appliances is represented by , ∈ represents each appliance in this category, and the total electricity energy consumed by non-deferrable appliances at any hour h of a day is given by in Equations (13) and (14).

Electric Storage System Model
These days, the electrical energy storage devices are playing a significant role in maintaining the   Base load appliances are in the first category of appliances and run as a base load in a smart home. Their operating time cannot be changed; however, these appliances can be scheduled between their starting and ending time as defined by the consumer. a b ∈ A b represents any appliance belonging to the base load category of appliances. The total energy consumption utilized by base appliances belonging to set A b during any time slot h is given by E b in Equations (13) and (14).

Deferrable Appliances
The household appliances in this category can be interrupted or shifted in any allowable time range according to their requirements for achieving the optimal scheduling in a smart home. The set of deferrable appliances is represented by A d , and a d ∈ A d denotes each appliance in this category. The total energy consumed by all the appliances of this category is represented by E d in Equations (13) and (14).

Non-Deferrable Appliances
The category of household appliances that cannot be interrupted after the beginning of their operation are non-deferrable appliances. However, these appliances can be shifted in their allowable time range before starting their action in such a way that their operating cycle could be complete after shifting. The set of non-deferrable appliances is represented by A nd , a nd ∈ A nd represents each appliance in this category, and the total electricity energy consumed by non-deferrable appliances at any hour h of a day is given by E nd in Equations (13) and (14).

Electric Storage System Model
These days, the electrical energy storage devices are playing a significant role in maintaining the system reliability, enhance the power quality (PQ), and achieve green energy goals. Therefore, an ESS was installed for storing electrical energy in the proposed model to improve the performance of the HEMS. When the electricity prices were low, the ESS stores form the utility or excess PV energy.
In this section, the battery ESS was modelled and integrated with the proposed system. The stored energy of battery E bat (h) in any time interval is presented in Equation (2). A positive value of E bat (h) represents the charging state of the battery and its negative value denotes the discharging state. The battery charging and discharging efficiencies are represented by η ch and η dch , respectively. To avoid the rapid charging and discharging of the battery, the constraints given in Equations (3) and (4) should be meet. Equation (3) represents the maximum charging limit and Equation (4) represents the minimum discharging limit of a battery in any scheduling time interval. S bat is a binary variable to represent charging state (S bat = 1) and discharging state (S bat = 0) of the battery during any hour h of a day.
Equation (5) indicates the battery state of charge SOC and Equation (6) represents the maximum and minimum limits of battery SOC in each time slot. E ch bat (h) and E dch bat (h) signify the charging and discharging state, respectively, of a battery in time slot h.

PV Generation Model
RERs like wind, tidal biogas, geothermal, and biomass are costly and are not available everywhere. However, PV energy is less expensive and available everywhere. Therefore, the smart home considered in this study was assumed to have its own rooftop PV generation system.
This study used an already developed probabilistic model based on a beta distribution for the modeling of solar irradiance and PV pattern generation, as reported in References [44,45]. Historical irradiance data for a complete year was used for the modeling and generation of PV patterns, and then, these generated patterns were used as the input in this study. The probability density function (PDF) of the solar irradiance is described by the following Equation (7):     : The output power of the PV panel installed in the proposed smart home was calculated using Equations (10)- (12), as reported in Sajjad et al. [46]: where P n , (h), NOCT, η DC−AC , and γ represent the rated power of the PV system (1-100 kW p ), solar irradiance, temperature of the cell operating under normal conditions (45 • C), efficiency of the inverter (95%), and coefficient of the power temperature (0.007), respectively.

Problem Formulation
This section describes the mathematical model of the proposed scheme to achieve the optimal scheduling of home appliances with the integration of PV and an ESS in an H2G energy exchange environment. The prime objective of this work is the minimization of the purchasing cost of electricity from the grid and reduction in the PAR.

Appliance Energy Consumption
In the proposed system model, the consumer appliances were classified as: deferrable appliances A d , base load appliances A b , and non-deferrable appliances A nd . The total number of user appliances is represented by A n . According to the user requirements and preferences, all user appliances are scheduled in 24-h time horizon. The total energy consumed by consumer appliances can be mathematically represented as: where , and E nd (h) are the energy utilized by base load appliances, deferrable appliances, and non-deferrable appliances, respectively, in each time interval. A b , A d , and A nd represent the set of base load appliances, deferrable appliances, and non-deferrable appliances respectively. P b , P d , and P nd denote the power rating of appliances belonging to the base load, deferrable, and non-deferrable appliances, respectively. S b , S d , and S nd represent the on/off status of the appliance belonging to the baseload, deferrable, and non-deferrable appliances, respectively, during any hour h of a day. ON status is represented by 1 while a 0 value denotes an OFF status of an appliance. An additional constraint, represented by Equation (15), should also be added for non-deferrable appliances to ensure the completion of their entire operating cycle after the beginning of their operation in the predefined interval: where k a represents the required time for an appliance to complete its operation or task and γ a demonstrates the required number of time intervals for each appliance to complete its operation. Therefore, if any non-deferrable appliance starts its operation at time t + 1, then it will complete its task in at least k a hours.ὰ a shows the earlier starting time of any appliance andβ a represents its least finishing time.

Energy Exchange with the Grid
The per-hour total energy import from the grid or export to the grid is calculated using Equation (16): where E T (h), E PV (h), and E bat (h) represent the per-hour total energy import from the grid or export to the grid, energy generated by the PV in each time slot, and the charging and discharging energy of a battery in each time interval, respectively. A positive sign of E bat (h) is used to represent charging while a negative sign represents discharging.

Electricity Consumption Cost
Different utility companies are providing unique tariff schemes such as RTP, CPP, ToU, etc., for their consumers related to their energy import or export in a grid exchange environment. In this work, it was assumed that the tariff for per-hour H2G energy export was half of the rate of the energy import from grid to home (G2H), as mentioned in Yang et al. [27]. This difference was justified by the utility provider by stating that a consumer utilizes the infrastructure of the utility to sell its surplus energy. The total electricity cost per day C T is calculated using Equation (17). Here, S represents the energy import and export states during any hour h of a day. Whenever, the value of S is 1, it denotes the importing state of energy from the grid and a 0 value denotes an exporting state of energy to the grid.

PAR
The PAR is defined as the ratio of the consumer peak demand to the mean demand utilized during a specific time interval. The PAR provides information related to the behavior of consumer energy consumption and the requirement of extra generating units for utility providers regarding the peak demand occurrence. Therefore, it is useful for both utility providers and consumers. The PAR is calculated using Equation (18): Here, during the permissible scheduling time interval, the numerator and the denominator of Equation (18) represent the consumer peak load and average load, respectively, and E T unsch represents the total energy consumption in the unscheduled load case.

AWT
User comfort can be defined in terms of the allowable AWT. In the described methodology, the consumption cost and user comfort are the two quantities among which a trade-off exists. A customer needs to look for off-peak hours to turn a specific appliance ON in order to reduce the consumption cost. This implies a direct relation between user comfort and the consumption cost [47]. When there is no optimal scheduling, consumers can turn a device ON at their will instantly without waiting for the off-peak hours. Hence, waiting time is zero in this case. However, in an optimal scheduling situation, the consumers are bound to sacrifice their comfort to achieve cost minimization.

Formulation of the Appliance Scheduling Problem
The minimization of the electricity consumption cost and reduction in the PAR are basic objectives for the appliance scheduling problem, which were briefly explained in the literature review section. The objective function of the proposed scheme for the residential appliance scheduling problem can be mathematically expressed as: subjected to: where E g (h) denotes the grid capacity in each time slot, while E T sch represents the total energy consumption in the scheduled load case. Besides the constraints presented in Equations (20) and (21), a few other constraints pertaining to non-deferrable appliances, battery, irradiance, etc., expressed in Equations (3), (4), (6), (7), and (15) are also considered for the scheduling problem.

Heuristic Optimization Techniques
As compared to other mathematical and differential optimization techniques, heuristic algorithms have a greater potential to solve complex optimization problems. Various applications of heuristic algorithms in green and sustainable energy systems are reviewed in References [15,16]. Some of the main characteristics of heuristic algorithms are summarized as: i.
These techniques are independent of the nature of the objective function, i.e., such techniques can solve linear-, nonlinear-, continuous-, and discrete-time complex problems, which is usually not possible by conventional techniques. ii.
Such techniques are nature-inspired, and efficiently exploit and explore the search space. iii.
These techniques can be tuned to increase their performance and can be used as part of a hybrid with other algorithms in complex situations. iv.
These optimization techniques exhibit a mature convergence at fast rates; therefore, the computational time required to find the solution is less than that needed in conventional optimization techniques.
Since heuristic techniques usually generate a random initial population, the solution obtained can be sub-optimal, which may slightly vary while testing techniques in multiple runs. Sometimes, these algorithms become stuck in a local optimum and are unable to generate a promising solution. Normally, these drawbacks are handled by: (i) running the algorithm multiple times and selecting the most optimal solution and (ii) a proper tuning of the heuristic algorithm parameters could resolve premature convergence and help reach near-optimal solutions with less computational effort. Considering the benefits and tackling the drawbacks through proper tuning with multiple runs, the multi-objective household appliance scheduling optimization problem, which is discrete in nature, was solved by using three heuristic techniques in this work. At first, two nature-inspired heuristic algorithms-GA and GWO-were used to solve the problem. Then, a hybrid of these algorithms (HGWGA) was proposed to improve the results. A brief discussion of these search algorithms is given below.

Genetic Algorithm
A GA is a meta-heuristic optimization technique that is based on Darwin's theory of "survival of the fittest." A GA is based on the nature-inspired phenomenon of genetic mutation. John Holland was the first to develop the basic GA in 1975 [48], and more explanations are given in References [49][50][51]. Unlike conventional techniques, which work on a single solution, a GA works on several possible solutions in each iteration. Due to its heuristic nature, it can solve complex problems in an effective way. Population initialization, fitness evaluation, and new population generation are the three main steps to attain the best solution in this algorithm. This work used a GA to solve the optimal appliance scheduling problem formulated in the preceding section. Table 1 presents the input parameters for the GA to optimally solve the residential appliance scheduling problem [35]. Some details related to these parameters are given in Section 5.3.

Grey Wolf Optimization
Grey wolf optimization, developed by Seyedali Mirjalili in 2014, is a swarm intelligence optimization technique based on the hunting behavior and leadership hierarchy of wolves [52]. To understand the leadership hierarchy of wolves, the wolves are divided into four categories named: alpha (α), beta (β), delta (δ) and gamma (γ). The α category of wolves is the leader category of the whole group, which guides other wolves in the hunting process. β and then δ wolves can act as leaders in this hierarchy if α wolves are not acting as leaders. γ is the weakest category of wolves, and therefore, they do not have leadership attributes. In an optimization problem for HEMS, the α category of wolves is considered to be the fittest member, which reduces the objective cost function. Therefore, the minimum cost corresponding to the α is the desired solution. The initialization of the population, searching and encircling of prey (exploration of search space), attacking (exploitation), and hunting are the main steps of GWO. The various GWO parameters, along with their values used in this study, are given in Table 2 [53]. A brief description of these parameters is given in the next subsection.

Proposed Hybrid Gray Wolf Genetic Algorithm
HGWGA, as the name implies, is a hybrid model combining the attributes of the GWO and GA. Figure 4 shown below represents the flowchart of its two-stage process. The first stage involves the implementation of GWO, and the second stage involves implementation of the GA operators (crossover and mutation), which are applied on the best candidate solutions obtained from GWO. These operators are also recognized as genetic operators. Results are considerably improved because the genetic operators are implemented on the best candidate solutions obtained in the first stage rather than applying them on the randomly generated values. The following steps are involved in the proposed HGWGA optimizer for HEMS.

Population Initialization
At first, an initial population matrix Z is generated randomly as represented in Equation (22): where D denotes the total number of home appliances and POP represents the total population of grey wolves.

Evaluating the Fitness
In the second step, the fitness value of the entire population is evaluated. The α, β, and δ wolves' are identified according to their fitness value and the best candidate solution is determined to be the α.

Encircling Operation
In this step, the grey wolves are searching for prey. Whenever they find the prey, they encircle it before hunting. Equations (23) to (30) are used to formulate the mathematical model of this searching and encircling mechanism: where → r 1 and → r 2 are random vectors and chosen between the range of 0 and 1.
The encircling operation of any wolf is represented by  (23) and (25), respectively. Equation (27) can be written as three Equations (33)- (35) for the wolves belonging to three different categories (α, β, δ). Then, → z α , → z β , and → z δ are identified as the first-, second-, and third-best solutions according to their fitness, which are obtained during the t th iteration. The subscripts 1, 2, and 3 represent the corresponding quantities of Equation (27) for the respective wolf category.

Hunting Operation
In the fourth step, the hunting operator is applied to find the new generation. The hunting mechanism is guided by the α category of wolves, whereas the β and δ wolves help α wolves in the hunting process. α wolves have the best information about the current position of the prey; therefore, β and δ wolves follow the α wolves. All the wolves update their positions according to the best solution represented in Equation (31):

Crossover
In the fifth step, the individuals are selected according to their fitness values using a roulette wheel selection method and the crossover operator is applied on them. Several methods are used for the crossover to generate the new offspring for the generation of a new population. In this work, a single-point crossover is used. In a single-point crossover, two parents are selected using a roulette wheel selection method from the binary strings of chromosomes according to their fitness value. Parent 1 = 101100011101 Parent 2 = 000110011001 A point after bit 5 from the left-hand side of the parents' string is selected and interchanged with the parents' chromosomes after the selected point. Offspring 1=101100011001 Offspring 2=000110011101

Mutation
After the crossover, a mutation is performed on the offspring generated by the crossover process. That mutated offspring is also included in the new population. Different methods are used for the mutation to generate the mutated offspring. In this work, a flip-bit mutation is performed in which a single bit or multiple bits are randomly selected and inverted. Here, in offspring 1, the 3rd and 11th bits from left-hand side are flipped, and in offspring 2, the 2nd and 10th bits are flipped. The mutated offspring are also included the new population.

Termination
If the termination criteria are satisfied, then the process is stopped; otherwise, the fitness is evaluated again and the next iteration is performed.
The flow chart of the proposed HGWGA technique is shown in Figure 4. Table 3 presents the input parameters for the HGWGA to optimally solve the residential appliances scheduling problem.

Mutation
After the crossover, a mutation is performed on the offspring generated by the crossover process. That mutated offspring is also included in the new population. Different methods are used for the mutation to generate the mutated offspring. In this work, a flip-bit mutation is performed in which a single bit or multiple bits are randomly selected and inverted. Here, in offspring 1, the 3rd and 11th bits from left-hand side are flipped, and in offspring 2, the 2nd and 10th bits are flipped. The mutated offspring are also included the new population.

Termination
If the termination criteria are satisfied, then the process is stopped; otherwise, the fitness is evaluated again and the next iteration is performed.
The flow chart of the proposed HGWGA technique is shown in Figure 4. Table 3 presents the input parameters for the HGWGA to optimally solve the residential appliances scheduling problem.

Case Study
In this paper, a residential consumer load was comprised of multiple appliances with an ESS, and PV generation was considered for the implementation of the proposed methodology. We considered 12 household appliances in this study. Seven base loads were considered, which could complete their operating time in single or multiple cycles. These cycles may be consecutive or split within the consumer's preferred time span. For example, an electrical car can be charged in any consecutive 3 h from 18:00 to 06:00. In addition, it can also be charged in two separate cycles summing to 3 h of charging, e.g., 20:00 to 22:00 and 05:00 to 06:00. Another option may be to charge the car in three disconnected hours, e.g., 19:00 to 20:00, 23:00 to 24:00, and 04:00 to 05:00 can be possible hours that are not continuous but sum to an operating duration of 3 h. Such different possible combinations are tested by the proposed algorithm and the optimal operating schedule of the appliance was generated. An additional operating constraint for non-deferrable appliances, such as interior lighting, was that their operation could not be shifted, while deferrable loads could be shifted in terms of their allocated time. Three deferrable and two non-deferrable appliances were considered in this study. Different consumer load parameters with respect to their operating preferences are given in Table 4. The solar irradiance data used in the study was collected from Khan [48] and characteristics of this data was modeled by using the beta-probability-distribution-based model to generate daily solar irradiance patterns. The daily solar irradiance patterns of original dataset and scenarios generated after the beta distribution modeling are presented in Figure 5. In this study, the generated solar irradiance data was used for calculating the PV generation by randomly selecting a pattern for each run of the simulation. The output power of the PV generation was calculated using Equations (10)- (12). Limits and other capacity restrictions of the different system components, such as the PV, grid, and battery, are given in Table 5. Two different pricing schemes-RTP and CPP-were considered in this study. Both schemes had the same prices of energy except from 08:00 to 11:00, where the CPP scheme charged more than RTP. The peak price in both schemes was observed between 10:00 to 11:00, as shown in Figure 6. Furthermore, it was assumed that the tariff for the H2G energy export was half of the pricing charged in the energy import from the G2H [27]. Three different scenarios considering PV generation, the ESS (battery), and grid supply were analyzed in this study. The details considered regarding these scenarios are given in Table 6. These scenarios depict the impact of the optimal appliance scheduling on the operating cost of the electricity by considering the absence and presence of PV or/and an ESS.

Simulations and Results
The simulation results and discussions are presented in this section to evaluate the performance of a DSM in the presence of utility, ESS, and PV units. The three different scenarios given in Table 6   0  4  8  12

Simulations and Results
The simulation results and discussions are presented in this section to evaluate the performance of a DSM in the presence of utility, ESS, and PV units. The three different scenarios given in Table 6 Figure 6. Price data.

Simulations and Results
The simulation results and discussions are presented in this section to evaluate the performance of a DSM in the presence of utility, ESS, and PV units. The three different scenarios given in Table 6 have been simulated in the MATLAB version R2016a environment using a seventh generation Intel core m3-7Y30 with a processor @ 1.61 GHz and 8 GB RAM. To tackle with the sub-optimality issue of heuristic techniques, the optimal scheduling problem was solved by running the simulation 50 times for each algorithm. All the results presented in the following subsections are the average cost calculated based on the 50 runs. The results of the proposed HGWGA in all three scenarios were compared with the two different heuristic algorithms (GA and GWO) to validate the effectiveness and better performance of the proposed algorithm. All algorithms used in this paper considered the residential load for the optimal appliance scheduling in the presence of utility, ESS, and PV units. The proposed algorithm was also compared with the unscheduled case where an EMC and SMSU were not installed.

Scenario 1: HEMS with Grid Only
In this scenario, a conventional home without an ESS or PV integration was considered. The electricity consumers of such conventional homes do not have their own ESS and PV generation. Therefore, such consumers can only import energy from the grid to fulfill their daily load requirements without any provision for H2G energy export.

Cost using the RTP and CPP
In the unscheduled case, the appliances completed their operations according to consumer preferences by blindly importing electricity from the utility without considering the electricity purchase tariffs. In this case, the peak load occurred from 10:00 to 11:00 when both the RTP and CPP tariffs of energy purchase were at a maximum, as shown in Figure 7. Therefore, the overall cost of the electricity consumption was increased in this case. However, in the scheduled case, when the GWO, GA, and the proposed HGWGA optimally scheduled the consumer loads by considering the RTP scheme, the costs were 474.06 cents, 462.67 cents, and 449.35 cents, respectively. In comparison with the unscheduled case, the optimal scheduling cost using the GWO, GA, and the proposed HGWGA was reduced by 10.25%, 12.41%, and 14.93%, respectively. Similarly, when the CPP signal was used, the respective electricity consumption costs were 541.45 cents, 523.96 cents, and 508.35 cents, which showed that the electricity consumption costs were reduced by 20.28%, 22.85%, and 25.15%, respectively, as shown in Table 7. The total electricity consumption cost for the unscheduled and scheduled cases for scenario 1 using the RTP and CPP signals is presented in Figures 8 and 9, respectively. the respective electricity consumption costs were 541.45 cents, 523.96 cents, and 508.35 cents, which showed that the electricity consumption costs were reduced by 20.28%, 22.85%, and 25.15%, respectively, as shown in Table 7. The total electricity consumption cost for the unscheduled and scheduled cases for scenario 1 using the RTP and CPP signals is presented in Figures 8 and 9, respectively.

PAR Using RTP and CPP
In the proposed architecture of the HEMS, an EMC and SMSU were used. Using these units, all appliances were optimally controlled in a way to avoid peaks. Therefore, the PAR in the optimally scheduled cases was reduced with respect to the unscheduled case. Both for the RTP and CPP tariffs, the PAR for the unscheduled, GA, GWO, and our proposed HGWGA was observed to be 4.44, 3.629, 3.774, and 3.108, respectively. The GA, GWO, and the proposed HGWGA diminished the PAR as compared to the unscheduled case by 18.25%, 15%, and 30%, respectively, as presented in Table 7. The PAR of the unscheduled load and scheduled load of this scenario is shown in Figure 10. In the proposed architecture of the HEMS, an EMC and SMSU were used. Using these units, all appliances were optimally controlled in a way to avoid peaks. Therefore, the PAR in the optimally scheduled cases was reduced with respect to the unscheduled case. Both for the RTP and CPP tariffs, the PAR for the unscheduled, GA, GWO, and our proposed HGWGA was observed to be 4.44, 3.629, 3.774, and 3.108, respectively. The GA, GWO, and the proposed HGWGA diminished the PAR as compared to the unscheduled case by 18.25%, 15%, and 30%, respectively, as presented in Table 7. The PAR of the unscheduled load and scheduled load of this scenario is shown in Figure 10.

AWT Using RTP and CPP
In the optimal scheduling problem, the consumption cost and appliance waiting time are the two quantities among which a trade-off exists. In this scenario, the AWT for GA, GWO, and the proposed HGWGA was found to be 1.65 h, 1.543 h, and 1.72 h, respectively. It can be observed that HGWGA had the maximum AWT compared with the other implemented optimization techniques, which meant that the consumers were bound to sacrifice their comfort to achieve the costminimization objective. The AWT of scenario 1 for the GA, GWO, and HGWGA is presented in Figure  11.

AWT Using RTP and CPP
In the optimal scheduling problem, the consumption cost and appliance waiting time are the two quantities among which a trade-off exists. In this scenario, the AWT for GA, GWO, and the proposed HGWGA was found to be 1.65 h, 1.543 h, and 1.72 h, respectively. It can be observed that HGWGA had the maximum AWT compared with the other implemented optimization techniques, which meant that the consumers were bound to sacrifice their comfort to achieve the cost-minimization objective. The AWT of scenario 1 for the GA, GWO, and HGWGA is presented in Figure 11.
Appl. Sci. 2019, 9, 5226 22 of 33 Keeping in mind the different results for scenario 1, the percentage reduction in cost and PAR for both the RTP and CPP tariffs displays the effectiveness of the proposed hybrid technique (HGWGA) as it gives improved results in comparison with the unscheduled and other scheduled cases (GA, GWO).

Scenario 2: HEMS with an ESS
In scenario 2, the electricity consumers had their own ESS in conjunction with the grid supply to fulfill their load requirements without any RERs. In off-peak hours, the consumers stored the energy from grid in their installed ESS. In each time slot, when the dischargeable energy of the ESS was less than the consumer demand, the consumers imported energy from the grid to fulfill their load requirements. On the other hand, when the dischargeable energy of the ESS was greater than the consumer load demand, the consumers neither purchased energy from the grid nor sold their excess energy to the grid. The hourly loads of this scenario are presented in Figure 12.

Scenario 2: HEMS with an ESS
In scenario 2, the electricity consumers had their own ESS in conjunction with the grid supply to fulfill their load requirements without any RERs. In off-peak hours, the consumers stored the energy from grid in their installed ESS. In each time slot, when the dischargeable energy of the ESS was less than the consumer demand, the consumers imported energy from the grid to fulfill their load requirements. On the other hand, when the dischargeable energy of the ESS was greater than the consumer load demand, the consumers neither purchased energy from the grid nor sold their excess energy to the grid. The hourly loads of this scenario are presented in Figure 12.
Appl. Sci. 2019, 9, 5226 22 of 33 Keeping in mind the different results for scenario 1, the percentage reduction in cost and PAR for both the RTP and CPP tariffs displays the effectiveness of the proposed hybrid technique (HGWGA) as it gives improved results in comparison with the unscheduled and other scheduled cases (GA, GWO).

Scenario 2: HEMS with an ESS
In scenario 2, the electricity consumers had their own ESS in conjunction with the grid supply to fulfill their load requirements without any RERs. In off-peak hours, the consumers stored the energy from grid in their installed ESS. In each time slot, when the dischargeable energy of the ESS was less than the consumer demand, the consumers imported energy from the grid to fulfill their load requirements. On the other hand, when the dischargeable energy of the ESS was greater than the consumer load demand, the consumers neither purchased energy from the grid nor sold their excess energy to the grid. The hourly loads of this scenario are presented in Figure 12.

Cost Using RTP and CPP
After obtaining the optimal scheduling through the GWO, GA, and the proposed technique HGWGA by considering the RTP tariff, the electricity consumption charges were 422.42 cents, 410.07 cents, and 399.34 cents, respectively, i.e., the optimal scheduling cost using the GWO, GA, and the proposed HGWGA was reduced by 20.03%, 22.36%, and 24.39%, respectively, in comparison with the unscheduled case. Similarly, when the CPP signal was applied, the electricity consumption costs for the GWO, GA, and the proposed technique HGWGA were 432.30 cents, 435.57 cents, and 409.36 cents, respectively, which demonstrated that consumption cost of the unscheduled case was reduced by 36.35%, 35.87%, and 39.73%, respectively, as shown in Table 7. The total electricity consumption costs for the unscheduled and scheduled cases in the RTP and CPP schemes are depicted in Figures 13  and 14, respectively. After obtaining the optimal scheduling through the GWO, GA, and the proposed technique HGWGA by considering the RTP tariff, the electricity consumption charges were 422.42 cents, 410.07 cents, and 399.34 cents, respectively, i.e., the optimal scheduling cost using the GWO, GA, and the proposed HGWGA was reduced by 20.03%, 22.36%, and 24.39%, respectively, in comparison with the unscheduled case. Similarly, when the CPP signal was applied, the electricity consumption costs for the GWO, GA, and the proposed technique HGWGA were 432.30 cents, 435.57 cents, and 409.36 cents, respectively, which demonstrated that consumption cost of the unscheduled case was reduced by 36.35%, 35.87%, and 39.73%, respectively, as shown in Table 7. The total electricity consumption costs for the unscheduled and scheduled cases in the RTP and CPP schemes are depicted in Figures  13 and 14, respectively.

PAR Using RTP and CPP
When the ESS was incorporated into the proposed architecture, a greater reduction in the PAR was observed since the ESS supplied the stored energy to meet the load demand. In the unscheduled case, the PAR was 4.4 which became 3.580, 3.413, and 3.052 using optimal scheduling with the GA, GWO, and HGWGA, respectively. The percentage reduction in the PAR after the optimal scheduling After obtaining the optimal scheduling through the GWO, GA, and the proposed technique HGWGA by considering the RTP tariff, the electricity consumption charges were 422.42 cents, 410.07 cents, and 399.34 cents, respectively, i.e., the optimal scheduling cost using the GWO, GA, and the proposed HGWGA was reduced by 20.03%, 22.36%, and 24.39%, respectively, in comparison with the unscheduled case. Similarly, when the CPP signal was applied, the electricity consumption costs for the GWO, GA, and the proposed technique HGWGA were 432.30 cents, 435.57 cents, and 409.36 cents, respectively, which demonstrated that consumption cost of the unscheduled case was reduced by 36.35%, 35.87%, and 39.73%, respectively, as shown in Table 7. The total electricity consumption costs for the unscheduled and scheduled cases in the RTP and CPP schemes are depicted in Figures  13 and 14, respectively.

PAR Using RTP and CPP
When the ESS was incorporated into the proposed architecture, a greater reduction in the PAR was observed since the ESS supplied the stored energy to meet the load demand. In the unscheduled case, the PAR was 4.4 which became 3.580, 3.413, and 3.052 using optimal scheduling with the GA, GWO, and HGWGA, respectively. The percentage reduction in the PAR after the optimal scheduling

PAR Using RTP and CPP
When the ESS was incorporated into the proposed architecture, a greater reduction in the PAR was observed since the ESS supplied the stored energy to meet the load demand. In the unscheduled case, the PAR was 4.4 which became 3.580, 3.413, and 3.052 using optimal scheduling with the GA, GWO, and HGWGA, respectively. The percentage reduction in the PAR after the optimal scheduling using the GA, GWO, and HGWGA was 19.38%, 23.13%, and 31.25%, respectively, relative to the unscheduled case. The same PAR values were observed in both the RTP and CPP tariff schemes. The values of the PAR for the unscheduled and scheduled cases are shown in Figure 15.
Appl. Sci. 2019, 9,5226 24 of 33 using the GA, GWO, and HGWGA was 19.38%, 23.13%, and 31.25%, respectively, relative to the unscheduled case. The same PAR values were observed in both the RTP and CPP tariff schemes. The values of the PAR for the unscheduled and scheduled cases are shown in Figure 15.

AWT Using RTP and CPP
In scenario 2, the AWT for the GA, GWO, and HGWGA was computed to be 1.58 h, 1.47 h, and 1.64 h, respectively, which shows that there was a trade-off between the consumer consumption cost and consumer comfort. Figure 16 represents the AWT of the appliance scheduling using the optimization algorithms GA, GWO, and HGWGA.
Keeping in mind the percentage reduction in cost and PAR for scenario 2 via the GA, GWO, and HGWGA with both the RTP and CPP tariffs, the proposed hybrid technique (HGWGA) seems more promising as it gave improved results in comparison with the unscheduled and other scheduled cases obtained using the GA and GWO.

Scenario 3: HEMS with ESS and PV
In this scenario, the electricity consumer had their own ESS and a PV generation system integrated with it. The consumers fulfilled their load demand by getting energy from the PV generation, ESS, and utility. In each time interval, when the output energy of the PV plus ESS discharge energy was less than to the consumer load demand, the consumer imported energy from

AWT Using RTP and CPP
In scenario 2, the AWT for the GA, GWO, and HGWGA was computed to be 1.58 h, 1.47 h, and 1.64 h, respectively, which shows that there was a trade-off between the consumer consumption cost and consumer comfort. Figure 16 represents the AWT of the appliance scheduling using the optimization algorithms GA, GWO, and HGWGA.
using the GA, GWO, and HGWGA was 19.38%, 23.13%, and 31.25%, respectively, relative to the unscheduled case. The same PAR values were observed in both the RTP and CPP tariff schemes. The values of the PAR for the unscheduled and scheduled cases are shown in Figure 15.

AWT Using RTP and CPP
In scenario 2, the AWT for the GA, GWO, and HGWGA was computed to be 1.58 h, 1.47 h, and 1.64 h, respectively, which shows that there was a trade-off between the consumer consumption cost and consumer comfort. Figure 16 represents the AWT of the appliance scheduling using the optimization algorithms GA, GWO, and HGWGA.
Keeping in mind the percentage reduction in cost and PAR for scenario 2 via the GA, GWO, and HGWGA with both the RTP and CPP tariffs, the proposed hybrid technique (HGWGA) seems more promising as it gave improved results in comparison with the unscheduled and other scheduled cases obtained using the GA and GWO.

Scenario 3: HEMS with ESS and PV
In this scenario, the electricity consumer had their own ESS and a PV generation system integrated with it. The consumers fulfilled their load demand by getting energy from the PV generation, ESS, and utility. In each time interval, when the output energy of the PV plus ESS discharge energy was less than to the consumer load demand, the consumer imported energy from Keeping in mind the percentage reduction in cost and PAR for scenario 2 via the GA, GWO, and HGWGA with both the RTP and CPP tariffs, the proposed hybrid technique (HGWGA) seems more promising as it gave improved results in comparison with the unscheduled and other scheduled cases obtained using the GA and GWO.

Scenario 3: HEMS with ESS and PV
In this scenario, the electricity consumer had their own ESS and a PV generation system integrated with it. The consumers fulfilled their load demand by getting energy from the PV generation, ESS, and utility. In each time interval, when the output energy of the PV plus ESS discharge energy was less than to the consumer load demand, the consumer imported energy from the utility, and whenever the output energy of PV plus ESS discharge energy was greater than the consumer load demand, then the consumer exported the extra energy to the utility at 50% of the purchasing electricity cost for both the RTP and CPP tariff schemes. In time slots 7, 8, and 11 to 18, the consumers had extra energy. Therefore, they exported their extra energy to the grid. Due to this, the total cost of the electricity consumption reduced, and the consumer got the benefits of net metering. The hourly load of this scenario is demonstrated in Figure 17.
Appl. Sci. 2019, 9,5226 25 of 33 the utility, and whenever the output energy of PV plus ESS discharge energy was greater than the consumer load demand, then the consumer exported the extra energy to the utility at 50% of the purchasing electricity cost for both the RTP and CPP tariff schemes. In time slots 7, 8, and 11 to 18, the consumers had extra energy. Therefore, they exported their extra energy to the grid. Due to this, the total cost of the electricity consumption reduced, and the consumer got the benefits of net metering. The hourly load of this scenario is demonstrated in Figure 17.

Cost Using RTP and CPP
By considering the RTP tariff, the GWO, GA, and the proposed technique HGWGA optimally scheduled the consumer load in the presence of an ESS and PV, and the electricity consumption costs were 322.65 cents, 315.61 cents, and 299.95 cents, respectively. In comparison with the unscheduled case, the optimal scheduling cost using the GWO, GA, and the proposed HGWGA was reduced by 38.91%, 40.25%, and 43.22%, respectively. Similarly, when the CPP signal was applied, the respective electricity consumption costs were 296.36 cents, 268.79 cents, and 255.04 cents, which indicates that the consumption cost relative to the unscheduled case was reduced by 56.37%, 60.42%, and 62.45%, respectively. The total electricity consumption cost for the unscheduled and scheduled cases for scenario 3 using the RTP and CPP schemes is shown in Figures 18 and 19, respectively.

Cost Using RTP and CPP
By considering the RTP tariff, the GWO, GA, and the proposed technique HGWGA optimally scheduled the consumer load in the presence of an ESS and PV, and the electricity consumption costs were 322.65 cents, 315.61 cents, and 299.95 cents, respectively. In comparison with the unscheduled case, the optimal scheduling cost using the GWO, GA, and the proposed HGWGA was reduced by 38.91%, 40.25%, and 43.22%, respectively. Similarly, when the CPP signal was applied, the respective electricity consumption costs were 296.36 cents, 268.79 cents, and 255.04 cents, which indicates that the consumption cost relative to the unscheduled case was reduced by 56.37%, 60.42%, and 62.45%, respectively. The total electricity consumption cost for the unscheduled and scheduled cases for scenario 3 using the RTP and CPP schemes is shown in Figures 18 and 19, respectively.
Appl. Sci. 2019, 9,5226 25 of 33 the utility, and whenever the output energy of PV plus ESS discharge energy was greater than the consumer load demand, then the consumer exported the extra energy to the utility at 50% of the purchasing electricity cost for both the RTP and CPP tariff schemes. In time slots 7, 8, and 11 to 18, the consumers had extra energy. Therefore, they exported their extra energy to the grid. Due to this, the total cost of the electricity consumption reduced, and the consumer got the benefits of net metering. The hourly load of this scenario is demonstrated in Figure 17.

Cost Using RTP and CPP
By considering the RTP tariff, the GWO, GA, and the proposed technique HGWGA optimally scheduled the consumer load in the presence of an ESS and PV, and the electricity consumption costs were 322.65 cents, 315.61 cents, and 299.95 cents, respectively. In comparison with the unscheduled case, the optimal scheduling cost using the GWO, GA, and the proposed HGWGA was reduced by 38.91%, 40.25%, and 43.22%, respectively. Similarly, when the CPP signal was applied, the respective electricity consumption costs were 296.36 cents, 268.79 cents, and 255.04 cents, which indicates that the consumption cost relative to the unscheduled case was reduced by 56.37%, 60.42%, and 62.45%, respectively. The total electricity consumption cost for the unscheduled and scheduled cases for scenario 3 using the RTP and CPP schemes is shown in Figures 18 and 19, respectively.

PAR Using RTP and CPP
In the proposed architecture of the HEMS, an SMSU and EMC were used. Using these units, all the appliances connected to the ESS and PV were optimally controlled in a way to avoid peaks. Therefore, the PAR in the scheduled cases was reduced compared to the unscheduled case. Both for the RTP and CPP tariffs, the PAR for the unscheduled, GA, GWO, and our proposed HGWGA was found to be 4.44, 3.588, 3.369, and 2.730, respectively. The GA, GWO, and our proposed HGWGA reduced the PAR compared to the unscheduled case by 19.18%, 24.13%, and 38.5%, respectively, for both the RTP and CPP signals. Figure 20 presents the PAR value of the unscheduled and scheduled cases.

AWT Using RTP and CPP
In present scenario, the AWT for the GA, GWO, and HGWGA was found to be 1.55 h, 1.44 h, and 1.61 h, respectively. It can be clearly observed that HGWGA had the maximum waiting time compared with other implemented optimization techniques, which means that the consumers were bound to sacrifice their comfort to achieve the cost-minimization objective. The AWT for the GA, GWO, and HGWGA is shown in Figure 21.

PAR Using RTP and CPP
In the proposed architecture of the HEMS, an SMSU and EMC were used. Using these units, all the appliances connected to the ESS and PV were optimally controlled in a way to avoid peaks. Therefore, the PAR in the scheduled cases was reduced compared to the unscheduled case. Both for the RTP and CPP tariffs, the PAR for the unscheduled, GA, GWO, and our proposed HGWGA was found to be 4.44, 3.588, 3.369, and 2.730, respectively. The GA, GWO, and our proposed HGWGA reduced the PAR compared to the unscheduled case by 19.18%, 24.13%, and 38.5%, respectively, for both the RTP and CPP signals. Figure 20 presents the PAR value of the unscheduled and scheduled cases.

PAR Using RTP and CPP
In the proposed architecture of the HEMS, an SMSU and EMC were used. Using these units, all the appliances connected to the ESS and PV were optimally controlled in a way to avoid peaks. Therefore, the PAR in the scheduled cases was reduced compared to the unscheduled case. Both for the RTP and CPP tariffs, the PAR for the unscheduled, GA, GWO, and our proposed HGWGA was found to be 4.44, 3.588, 3.369, and 2.730, respectively. The GA, GWO, and our proposed HGWGA reduced the PAR compared to the unscheduled case by 19.18%, 24.13%, and 38.5%, respectively, for both the RTP and CPP signals. Figure 20 presents the PAR value of the unscheduled and scheduled cases.

AWT Using RTP and CPP
In present scenario, the AWT for the GA, GWO, and HGWGA was found to be 1.55 h, 1.44 h, and 1.61 h, respectively. It can be clearly observed that HGWGA had the maximum waiting time compared with other implemented optimization techniques, which means that the consumers were bound to sacrifice their comfort to achieve the cost-minimization objective. The AWT for the GA, GWO, and HGWGA is shown in Figure 21.

AWT Using RTP and CPP
In present scenario, the AWT for the GA, GWO, and HGWGA was found to be 1.55 h, 1.44 h, and 1.61 h, respectively. It can be clearly observed that HGWGA had the maximum waiting time compared with other implemented optimization techniques, which means that the consumers were bound to sacrifice their comfort to achieve the cost-minimization objective. The AWT for the GA, GWO, and HGWGA is shown in Figure 21. The percentage reduction in the consumption cost and the PAR for both the RTP and CPP tariffs displays the effectiveness of the proposed hybrid technique (HGWGA) as it gave better results compared to the unscheduled and scheduled load techniques using the GA and GWO.

Comparison of the Execution Time
To compare the execution time of the GA, GWO, and HGWGA, each of them was run 50 times to find the solution of the scheduling problem, as discussed in Section 4. Different statistics of execution time for different cases using the RTP tariff scheme are shown in Table 8. For all cases, it can be observed that the proposed HGWGA technique required the lowest average execution time for 50 runs to attain the optimal solution compared to the GA and GWO. In addition, as the complexity of the case study increased due to the addition of more system elements, such as PV and an ESS, the execution time required for the simulation also increased irrespective of the algorithm used. From Table 8, it is also evident that the proposed HGWGA was the more time-efficient technique among those used in this study.
The standard deviation can be a good indicator to assess the performance of an optimization algorithm for its consistent optimal solutions. In terms of execution time, the standard deviation was calculated along with its maximum and minimum values, and the results are presented in Table 8. It can be noted that the standard deviation in execution time of the proposed HGWGA was better for all cases in comparison with the GA and GWO, which validates the performance of the proposed technique.  The percentage reduction in the consumption cost and the PAR for both the RTP and CPP tariffs displays the effectiveness of the proposed hybrid technique (HGWGA) as it gave better results compared to the unscheduled and scheduled load techniques using the GA and GWO.

Comparison of the Execution Time
To compare the execution time of the GA, GWO, and HGWGA, each of them was run 50 times to find the solution of the scheduling problem, as discussed in Section 4. Different statistics of execution time for different cases using the RTP tariff scheme are shown in Table 8. For all cases, it can be observed that the proposed HGWGA technique required the lowest average execution time for 50 runs to attain the optimal solution compared to the GA and GWO. In addition, as the complexity of the case study increased due to the addition of more system elements, such as PV and an ESS, the execution time required for the simulation also increased irrespective of the algorithm used. From Table 8, it is also evident that the proposed HGWGA was the more time-efficient technique among those used in this study. The standard deviation can be a good indicator to assess the performance of an optimization algorithm for its consistent optimal solutions. In terms of execution time, the standard deviation was calculated along with its maximum and minimum values, and the results are presented in Table 8. It can be noted that the standard deviation in execution time of the proposed HGWGA was better for all cases in comparison with the GA and GWO, which validates the performance of the proposed technique.

Conclusions
In this paper, a HEMS model was proposed for residential electricity consumers using multiple appliances with an ESS and PV generation including the option of a H2G energy exchange. A new optimization technique called HGWGA was proposed and implemented to solve the residential consumer appliance scheduling problem in the presence of an ESS and PV. The proposed hybrid algorithm was developed by combining the attributes of GWO and the GA to reduce the consumer electricity consumption cost and the PAR while considering RTP and CPP tariff schemes. To substantiate the performance, the strength and effectiveness of the proposed technique, three scenarios were considered, and the obtained results were compared with GWO, the GA, and unscheduled cases. From Table 7, it is clear that for all three scenarios, the total electricity consumption cost was reduced by 14.93%, 24.39%, and 43.22%, respectively, through the optimal appliance scheduling using the proposed HGWGA in case of just the RTP signal being present. Similarly, when the CPP signal was incorporated, the electricity consumption cost decreased by 25.15%, 39.73%, and 62.45%, and the PAR was reduced by 30%, 31.25%, and 38.5%, respectively. For all three scenarios, the percentage reduction in cost and the PAR for both the RTP and CPP tariffs displayed the effectiveness of the proposed hybrid technique. The results of the execution time demonstrated that the convergence rate of the proposed HGWGA for the scheduling of appliances was comparatively fast, and therefore, this technique can be a better choice in real-time applications in SMSUs for load scheduling.
The proposed algorithm for the optimal appliance scheduling strategy can be applied to actual data when and where they are provided. It not only reduced the energy cost, but also increased the stability and reliability of the grid. In addition, the contribution of scheduling results for several HEMSs can be important for an aggregator to manage its resources for a cost-effective and reliable operation of a microgrid.
This work focused on residential loads; however, an increase in the number of appliances and the incorporation of loads of other energy sectors, i.e., industrial and commercial, is planned for future work. In future, RERs including PV, wind, biogas, etc., will be integrated with the conventional energy generation resources to develop a hybrid energy generation system. Battery electric vehicles (BEV) and plug-in hybrid electric vehicles (PHEV) will be considered for the ESS. To improve the performance of the proposed methodology and to diminish the effects of uncertainties, stochastic models of DR strategies can be used. A hybrid of the proposed heuristic technique and fuzzy techniques can be used to further enhance the performance in the future.

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

Abbreviations
In this paper, following acronyms and symbols are used.