Energy Optimization in Smart Homes Using Customer Preference and Dynamic Pricing

Muhammad Babar Rasheed 1, Nadeem Javaid 1,*, Ashfaq Ahmad 1, Mohsin Jamil 2, Zahoor Ali Khan 3, Umar Qasim 4 and Nabil Alrajeh 5 1 COMSATS Institute of Information Technology, Islamabad 44000, Pakistan; babar_mehr@yahoo.com (M.B.R.); ashfaqcomsats@gmail.com (A.A.) 2 School of Mechanical & Manufacturing Engineering, National University of Science and Technology, Islamabad 44000, Pakistan; mohsin@smme.nust.edu.pk 3 Internetworking Program, Faculty of Engineering, Dalhousie University, Halifax, NS B3J 4R2, Canada; zahoor.khan@dal.ca 4 Cameron Library, University of Alberta, Edmonton, AB T6G 2J8, Canada; umar.qasim@ualberta.ca 5 Department of Biomedical Technology, College of Applied Medical Sciences, King Saud University, Riyadh 11633, Saudi Arabia; nabil@ksu.edu.sa * Correspondence: nadeemjavaidqau@gmail.com; Tel.: +92-300-579-2728


Introduction
In order to meet the ever-increasing energy demand, researchers investigate new research areas [1]: discovering new energy sources, distributed and renewable energy integration and energy saving programs by encouraging customers through demand side management (DSM) and demand response (DR) programs.Utilities participate in DSM programs to improve power system stability.On the other hand, end users participate in DR programs to minimize their electricity bills.Cost-sensitive customers can take monetary benefits by taking into consideration time varying prices and efficient scheduling techniques [2,3].DR-based load shifting is helpful in reducing the electricity cost of end users, however, at the cost of user comfort.Similarly, the utility-based direct load control (DLC) technique improves power system stability [4], while disturbing user comfort.Thus, both cost reduction and comfort maximization cannot be achieved at the same time.
We identify that inconsideration of user activities in DSM and DR programs is the major cause of the earlier-mentioned trade-off.Furthermore, to utilize the available energy efficiently, unnecessary energy consumption must be reduced.Motivated by these considerations, this paper presents a new energy optimization technique to minimize the end user electricity bill while not compromising user comfort.In this paper, our contributions are listed as follows: 1. Initially, we categorize different homes and appliances by considering electricity prices, person occupancies and environmental conditions to manage energy consumption.Then, we propose mathematical optimization models of major household appliances to manage the energy consumption of all types of appliances.To maximize end user comfort, user-dependent appliances are introduced, which take into consideration human activities.2. We propose a centralized energy optimization algorithm, which considers different constraints to minimize the overall energy consumption and electricity bill up-to h homes (Section 4, Figure 1).However, prior to the selection and implementation of an optimization algorithm, different algorithms are tested and validated using the fmincon and lsqnonlin solvers (Table 3).3. The influence of external temperature and variations in energy demand on DR programs is also analysed (details are given in Section 5.3).From this analysis, it is concluded that weather has a great impact on the energy consumption and DR programs based on which utilities and consumers manage their schedules.4. Finally, extensive simulations have been performed to evaluate the effectiveness of the proposed algorithm in different scenarios.
The rest of the paper is organized as follows.Section 2 discusses the related work along with in-depth analysis of the state of the art work.The system model and appliance classification are discussed in Section 3. We then present the energy demand optimization in Section 4. Simulation results are discussed in Section 5. Initially, the simulation set-up and the solver users are discussed.Then, in-depth discussions of the obtained results and seasonal impacts on the energy consumption are discussed.Conclusions and future work are given at the end of the paper.

Related Work
In this section, we discuss the latest and relevant research work in two broader categories: (i) price based DR programs; and (ii) comfort-aware DR programs.

•
Price-based DR programs: Most of the published articles focus on DSM and direct load control (DLC) strategies to manage the energy demand during critical peak hours [2][3][4][5].
In these techniques, users may pause or turn-off unnecessary load to reduce their electricity cost.However, these techniques may disturb end user comfort.In [6], the authors have proposed a DR model under a dynamic pricing environment to reduce electricity cost and user discomfort.
To maximize end user comfort, appliances are divided into different categories, such as deferrable, curtailable, thermal and critical.To reduce high peaks during low pricing hours, maximum energy consumption limits to restrict the customers to consume energy under the given limits are imposed.Users consuming more energy beyond these limits are charged high prices.In this work, again, the trade-off between user comfort and electricity cost reduction is found.However, the utility gains the benefit in terms of increased system stability.In another similar work, the authors introduce energy consumption limits in each time slot to reduce the electricity cost of end users [7,8].Although this technique has shown a remarkable impact in terms of cost saving, the major drawback associated with this scheme are frequent disconnections and discouragement of consumers in participating in DR programs.In addition, users may feel discomfort while doing their daily life activities, because most of the DR programs are designed for grid stability and peak reduction [5][6][7][8][9].
In [10,11], the authors consider only deferrable appliances, whereas [12] is limited to thermal loads only.In [13], a hybrid technique is proposed, which jointly controls the working of all, thermal, deferrable and non-interruptible, loads.In [14], mathematical models of various types of home appliances are proposed based on their energy demand and operating modes.After appliance classification, the energy management problem is formulated as a mixed integer nonlinear programming (MINLP) problem, which later on is solved using Benders' decomposition approach.This scheme reduces the electricity cost with maximum appliance utility.However, user comfort has not been modelled in an effective way.In [15,16], the energy consumption of different types of appliances is managed, such that the major focus is on appliance scheduling, Peak to Average Ratio (PAR).and electricity cost reduction, as well as comfort management.However, a significant amount of energy is wasted due to unnecessary appliance operation.In [17,18], appliance scheduling schemes based on customer reward (CR) are proposed to avoid high peaks; customers are given incentives to shift load from on-peak hours to off-peak hours.However, comfort-aware customers cannot take full advantage of these types of schemes due to energy limits imposed by utilities.In conclusion, price based DR programs are efficient in reducing the electricity cost of end users along with PAR reduction, however at the cost of user comfort.The reason is the inconsideration of user behaviour in DSM programs.

•
Comfort-aware DR programs: In [19], a user comfort-aware load management algorithm is proposed to schedule the aggregate load of a household.The game theoretic approach is used to solve the optimization problem, aiming at minimizing end user cost while preserving end user comfort.Unlike the other schemes, this scheme gives users the choice to prioritize either comfort or electricity cost reduction.In [20], the authors present a user-aware game theoretic approach for demand management, which considers user preferences.Both hard and soft appliances are considered, including deferrable and non-deferrable categories, where users have options to either choose comfort or cost saving.For this purpose, the authors introduce a weight factor to prioritize comfort over cost.However, users cannot achieve both objectives at the same time.Moreover, appliance scheduling for minimum electricity cost may lead to high peaks during low pricing hours and may disturb user comfort [21].In [22,23], the Markov chain is used to model a very limited set of user activities; using a personal computer, cooking activity and performing no activity.Based on these activities, total energy demand is calculated.Although these schemes prove to be efficient in terms of energy management, without the DR program, it is difficult to reduce end user cost.In [9], the authors schedule background loads, like refrigerator and humidifiers, by using the early deadline first technique.Non-background loads are not involved in the scheduling process, because these may affect user comfort.Each disconnected appliance is assigned a slack time, which is the maximum time for which any appliance remains disconnected from the power source.Afterwards, appliances with minimum slack time are turned-on.The authors also impose a power limit on aggregated power consumed by the background load.Although this scheme is efficient in terms of cost reduction, end user comfort is disturbed due to the high slack time of appliances and energy consumption limits.
Table 1 summarizes the work done by different authors along with their achievements and limitations.In conclusion, the techniques given in Table 1 are efficient in terms of cost reduction, but there management of energy with low electricity cost and high user comfort is not properly considered.These techniques do not consider both active human participation and environmental constraints, which are necessary for realistic scheduling and energy saving mechanisms.Keeping these limitations and trade-offs in view, we propose a demand side energy management algorithm, which takes into consideration dynamic prices, users preferences, weather conditions and active human participation.

System Model
We consider a home grid network, which consists of multiple residential units γ connected with a central Energy Management Controller (EMC) (Figure 1).In each residential unit γ, h number of homes is considered, such that each home is equipped with a smart meter to deliver the customer's energy demand and preferences to the utility.The utility provides back the DR signal necessary for load scheduling and optimization.The smart meter can communicate directly with the centralized EMC and the utility.In each house, various types of appliances (e.g., human dependent, interactive schedulable and unschedulable) that have variable energy demand and operating time requirements are considered.The EMC aggregates operating schedules of household appliances and communicates with appliances using advanced communication technologies (e.g., Wi-Fi, ZigBee and Bluetooth).The EMC receives the information about human presence, weather conditions, price signals and appliance energy consumption requirements, based on which control decisions are made (Figure 2).In order to better schedule the load, we categorize home appliances based on operating time and energy consumption requirements (Table 2).Table 2. Appliance data [24,25].

Total Appliances
Appliance Name Power Rating (kWh)

User Dependent
Major requirements of user dependent x ud appliances are to reduce end user cost, increase user discomfort and minimize uneven energy consumption [26,27].An important aspect of this work is to control energy consumption of x ud based on human presence, electricity prices, weather conditions and operating time requirements.Example x ud appliances are: refrigerator, lights with controllable brightness, washing machine and Heating Ventilation and Air Conditioning (HVAC).In x ud , appliance utility function U(E ud (t)) denotes the overall performance when appliances consume E t ud amount of energy in time t.This is due to the fact that the electricity price in time interval t is a function of aggregated energy demand.In order to fulfil energy demand of x ud appliances, users have the following requirements. (1)

HVAC
In HVAC modelling, we aim to design an algorithm that takes into consideration human presence/preference, temperature variations and maximum deviation in room temperature that a customer can bear.In h 1 , the HVAC is turned ON based on temperature difference only.On the other hand, the HVAC in h 2 is turned ON when occupants are present in the house and room temperature exceeds a threshold level (24 • C).In [23], the HVAC is turned on in low electricity pricing hours without considering human occupancy and temperature variations.For realistic scheduling (to achieve maximum user comfort), temperature difference and human occupancy parameters are considered in the proposed algorithm (Figure 3).The temperature of New York City based on which the proposed scheduling algorithm works is shown in Figure 4 [28].Figure 4 shows that the maximum temperature in the month of July is 37 • C. On the other hand, the maximum temperature in October is 26 • C. Thus, the HVAC needs a relatively greater number of duty cycles to maintain room temperature in July due to the high temperature.
To model heat exchange between the HVAC and the outside, thermodynamic system modelling is used.Inside room temperature t r is defined as a state variable that allows us to model the temperature difference of a room in a thermodynamic system.Change in outside temperature t o leads to heat exchange ( dQ (t)  dt ) l between the outside and inside, which is shown in Figure 3.This heat exchange disturbs internal room temperature t r .By using the energy management and control system in smart homes, t r can be controlled by considering user preferences and comfort requirements besides t o only, as used in [3,29].For a given t r , users can change and control the HVAC temperature ( dQ(t) dt ) h set points through t h and then control t r .By using the classical thermodynamics set of equations [26]:

Losses
Initially, r eq of the room is estimated based on the geometrical dimensions of the room, and later on, it is refined based on inside/outside temperature difference t r (t) − t 0 (t).Because r eq can change with varying material (walls and room) conductivity, the HVAC toggle condition is determined by the following condition: where is a small quantity, whose value is 1 • C. In the first part of Equation ( 4), the temperature difference in the room is stable, and the scheduling algorithm will turn OFF the HVAC at time t and vice versa.The minimum and maximum temperature variations of t h are set as follows: Our objective here is to minimize heat losses that may change the room temperature.Due to more temperature variations inside the room, the HVAC needs a greater number of duty cycles to keep the temperature within the desired set points.Therefore, by reducing heat losses, the energy consumption of the HVAC can be significantly minimized.The heat losses minimization objective function is formulated as follows: such that where h p denotes human presence in the room.

Remark 1.
Referring to Algorithm 1, the HVAC turns on based on two conditions: (i) when there is any occupant in the room; and (ii) when there is a deviation in the temperature threshold.The only information required by the HVAC is the electricity price, which is obtained from New York Independent System Operator (NYISO) via the smart meter, room temperature and human occupancy through sensors.
Algorithm 1 Pseudo code of the HVAC working.end for 15: end for 16: end

Refrigerator
We assume that the working of refrigerator can be scheduled throughout the day.In case of h 1 , energy consumption is calculated based on the length of operation time without taking into account the presence of a person [18,29].In case of h 2 , the refrigerator performs on the bases of the total number of ON/OFF cycles and the total number of times the door is opened.Here, the total ON/OFF working cycles further depend on two factors: (i) heat losses when the refrigerator's compressor is OFF; and (ii) the cooling effect when the refrigerator's compressor is ON.On each attempt to open the door, the refrigerator consumes 20 W/h surplus energy to maintain inside temperature.Whereas the open and close operation of the refrigerator's door d o is a random variable normally distributed over time t, so the objective is to maintain the refrigerator temperature within the comfort specified temperature limits along with minimum electricity cost.To achieve the aforementioned objective, the operational constraints of refrigerator are given as follows: where: t r = temperature of the refrigerator t = time interval (t − 1) τ = duty cycle Ψ r = heat losses during the OFF state Φ r = cooling effect during the ON state Υ r d o = heat loss due to d o .Equation (7) shows the relationship of the refrigerator's temperature at time interval t with the temperature at time interval t = (t − 1), h p , heat Ψ r (t) losses and cooling Φ r (t) effects when the refrigerator is ON or OFF; where h p is calculated as follows: Heat losses during the OFF state of the refrigerator are calculated as follows: where t r is a small change in the refrigerator's temperature in time interval t when the compressor is turned OFF.The cooling effect of the ON state of the refrigerator is calculated as: Our objective function here is to minimize the heat losses that may increase or decrease the refrigerator duty cycles.

Washing Machine
It is assumed that the working of the washing machine can be scheduled in 24 h.In γ 1 , the washing machine is turned ON once the low price time slot is found.In both homes, the scheduler adjusts the operating time of the washing machine between 01:00 → 09:00 and 17:00 → 09:00.In γ 2 , we assume that occupants stay home for the whole day.Therefore, the scheduler adjusts the operating time of the washing machine based on the presence of a person, as well as the total number of persons in the home.The following constraint is implemented while formulating the working of the washing machine.
where µ s and µ e denote the start time and end time of the washing machine, respectively.h p (1→6) denotes the total number of occupants in the home, which is a random variable from (1→6).The duty cycles of the washing machine depend on the h p (1→6) parameter in the second unit.

Lights with Controllable Brightness
The lighting of a house usually depends on the user occupancy/activity level and is modelled on the basis of the h p parameter.In both units, lights are assumed to be turned ON only when occupants are present in the home.The minimum and maximum energy consumption is 0 and 100 W, respectively.

Interactive Schedulable
These appliances, denoted by x is , can be flexibly scheduled during the whole time period T. The energy consumption and user satisfaction of x is appliances can be measured by the total E T amount of energy consumed in each time slot.The scheduler adjusts the working of x is appliances in low price time slots.Appliances (dish washer and lights) without controllable brightness are kept in this category.For each appliance in x is , users desire the following requirements to fulfil their needs.
where Equation (14) shows that the total energy consumption of all appliances cannot exceed the given limit ζ (t,x) .

Dish Washer
This appliance operates once in time period t ∈ T. In the first home, it operates during 07:00 → 12:00, because occupants are awake at this time.In order to reduce the electricity bill, the scheduler adjusts the working of the dishwasher in low price hours.In the second home, occupants are assumed to leave home from 09:00 → 05:00.The scheduler adjusts the working cycles of these appliances in low pricing time slots.In Unit 2, occupants are assumed to stay home during the whole day, and the scheduling algorithm calculates the working cycles (hours) of the dish washer based on the total number of persons in the home.The EMC automatically adjusts the working of the dishwasher to low pricing hours.

Lights without Controllable Brightness
For both households in Unit 1, the energy consumption of lights is 100 W. In the first home, the occupants are assumed to be awake from 07:00 → 24:00.In the second home, occupants leave the home from 09:00→ 05:00.In this case, EMC assigns time slots by considering electricity price and user preferences.In Unit 2, we assume that the occupants are present for the whole day.The EMC schedules the ON/OFF cycles based on the user presence at home.

Unschedulable
Appliances having fixed energy consumption, such as entertainment stations (TV, music player, etc.), are kept in the unschedulable x u category.In Unit 1, the operating time of these appliances is from 07:00 → 12:00 and from 05:00 → 07:00, respectively.In Unit 2, we assume that occupants stay home for the whole day, and the EMC schedules the appliances according to their presence.The minimum and maximum energy consumptions of these appliances are 0 and 1500 W, respectively.

Energy Demand Optimization
Our proposed algorithm takes into consideration the energy consumption of x ud appliances (HVAC and lights), such that these are controlled by considering user presence in the home.It is very difficult to predict accurate energy consumption demand in a house.One solution to solve this problem is to consider the real-time activities of occupants, based on which energy consumption can be calculated.The uncertain energy consumption patterns that depend on the daily activities of different users may create complexities in designing dynamic and interactive energy management algorithms.For example, the HVAC must be turned ON whenever the occupant is present in the room.On the other hand, scheduling techniques that is based on the DR signal may cause the wastage of energy.In the proposed work, x ud appliances are activated based on human presence, and the total cost during the ON time interval is calculated for these appliances.For x is appliances, energy consumption is calculated in predefined schedules set by the users.However, these appliances can be scheduled during time slots t ∈ T to reduce the total electricity cost.The dish washer and lights with uncontrollable brightness are kept in this category.In the last category, x u has fixed energy consumption, and users can turn it ON at any time.

The Proposed Scheduling Algorithm
In the proposed model, we consider h ∈ h homes having different types of χ appliances, such that χ = [1, 2, 3, ...N].Energy consumption schedules for all χ appliances are managed by the EMC, which takes price signals from the utility company via the smart meter (Figure 5).We use the Time of Use (TOU) and Real Time Pricing (RTP) signals in our case and divide the total scheduling time horizon T into time slots of the same length.
where t n is equal to 24.The EMC is responsible for determining the starting (t s ) and ending (t e ) time intervals, as well as the total energy consumption E t of χ appliances.Over a given sub-interval of time t 1 , the energy consumption is assumed to be constant.Energy consumption scheduling vector E x for appliance x ∈ χ is given as: x , e t 2 x , e t 3 x , ..., e t n x ], where E x denotes the energy consumption of appliance x at t th time slot in kWh.Considering the TOU price signal, as shown in Figure 5, and appliance classification, the energy consumption value is fixed in each time slot.Each appliance x has a scheduling time interval t sch ∈ [t s , t f − t lot ] in which it can be scheduled.When appliance x is ON, its energy consumption E is bounded between minimum and maximum bounds, E min x and E max x , respectively.
where ψ (x,t) denotes the ON/OFF status of appliance x at time slot t.The appliance ON/OFF mechanism manages the scheduling process more realistically as compared to simple time-based models discussed in [30,31].For example, if a user wants to stop any appliance during high price hours 08:00 → 10:00, the ON/OFF mechanism is easy to model.If a user in need models the time horizon by introducing additional variables, this creates complexity.
The energy consumed by χ number of appliances in time t is calculated as follows: where E t is total energy consumed by x number of appliances in time t.It is also assumed that each appliance has maximum energy consumption limit E t max in time slot t.For example, the washing machine may consume 3.4 kWh of energy in each hour, such that E t x ≤ E t max x .Where E t x denotes the energy consumed by appliance x at time t.Additionally, there is also a total energy consumption limit ζ t on all types of appliances in each time slot t n , which is calculated by the following equation.
Violation of above constraint leads to the possibilities that high peaks will be generated, which may damage the power grid.The scheduling algorithms must follow the capacity constraint (for smooth gird operation) and the generation cost of electricity to fulfil the energy demand during low price hours.After describing appliance energy consumption and capacity limits, we now formulate the energy consumption cost.We use TOU and RTP pricing models in which electricity price varies in each time interval t and is denoted by φ t .We also assume that all electricity unit prices φ t for the scheduling intervals are known to the EMC in advance.The total energy consumption cost C T for all types of appliances is given as:

Load Scheduling
The main purpose of this model is to reduce the energy consumption by taking into consideration human presence, weather conditions and energy prices.In order to reduce the electricity bill and high peaks during low price hours, appliances are scheduled on the bases of energy prices and capacity limits.The final optimization problem for energy consumption minimization is given as follows: such that: where Constraint (22a) shows that t s and t f must be within the total time limit t ∈ T. Constraint (22b) defines the total scheduling time horizon.Constraint (22c) bounds the total energy consumed by all types of appliances not to exceed the available energy capacity.As per Constraint (22e), the appliance has two possible states, ON and OFF.In the case of the ON state, its energy consumption follows (22d).

PAR Reduction
The daily energy consumption of the x-th appliance in time slot t is given as follows: Given the maximum energy load demand vector E t,x , we formulate PAR in terms of average load demand as follows: The PAR reduction optimization problem can be formulated as follows:

Performance Evaluation
In this section, we present the simulation results and discussions of the proposed energy management algorithm.We first describe the simulation set-up and performance metrics and then discuss the proposed algorithm used to solve the optimization problem.Finally, simulation results considering different cases are discussed in terms of selected performance metrics.

Simulation Set-Up
The performance of the proposed energy optimization algorithm is evaluated under TOU and RTP pricing environments.We consider two residential units having two homes in each unit.In Unit 1, occupants stay home for the whole day in h 1 .In h 2 , occupants are assumed to leave for the office from 07:00 → 05:00.In Unit 2, the occupants stay home for the whole day.In h 1 , the working of appliances is scheduled without considering user presence.In h 2 , appliances are scheduled by taking into consideration the customers presence, preferences, total number of persons in the home and weather conditions.
In Scenario 1, we set γ = 2, h = 2 and χ = 7.Furthermore, winter and summer seasons are also considered to evaluate the impact of variable energy demand on the DR program.In Scenario 2, ten different users are considered, and the proposed algorithm is used to evaluate the energy consumption variations based on its usage.In Scenario 3, the total number of houses and appliances is increased to h = 40, and χ = 280, and the robustness of the proposed algorithm is tested.Each appliance has different energy consumption requirements, which mainly depend on the appliance type and power rating, as shown in Table 2.We consider a T = 24 h time horizon, which is further subdivided into different time slots, each one of the same length t l .Alternatively, higher energy demand is observed in the evening because most people return home from offices.On the other hand, lower energy demand is observed at night because most of the people sleep during this interval.We simulate the proposed model considering different scenarios where user preferences, weather conditions and electricity prices vary.Electricity prices are taken directly from [32].We use MATLAB to implement the proposed model and evaluate the performance of the proposed algorithm.To perform optimization, we use the MATLAB solver f mincon to solve the energy management problem.We simulate and analyse the performance of different algorithms used in this solver as shown in Table 3.

Results and Discussion
Figure 6a shows the comparison of the unscheduled energy consumption and electricity cost of both homes.Here, the energy consumption of both homes is almost the same, except time slots 07:00 → 08:00 and 12:00 → 17:00, in which h 1 consumes 4.03% more energy.Figure 6b compares scheduled energy consumption and electricity cost, where h 1 consumes more energy during time slot 08:00 → 11:00, which is comparatively 5.03% higher.In Figure 7b, h 1 consumes more energy during time slot 15:00 → 18:00, because occupants return home after office 09:00 → 05:00, and they are supposed to turn the maximum load ON, such as the HVAC, the TV, the oven, etc. (refer to Section 3).In general, h 2 consumes 23.14% less energy as compared to h 1 .It is clear from Figure 8a that h 1 consumes 14.73% more energy than h 2 in the unscheduled case.Because in Unit 2, appliances are randomly turned ON and OFF in the scheduling time horizon, the EMC adjusts the working cycles of all appliances based on low electricity pricing time slots without considering human occupancy and user preferences.Figure 8b shows the comparison of the scheduled energy consumption and the electricity cost of both homes.During peak hours 09:00 → 11:00, h 1 consumes 7 kW/h in the unscheduled case, and h 2 consumes 5 kW/h in the scheduled case, which is 7.42% less.However, h 1 consumes 2.97% more energy as compared to h 2 .This is because some appliances are turned ON during high price hours due to person presence.Electricity prices from 19:00 → 24:00 are very low.Due to critical peak hours 19:00→ 24:00, Figure 5, the EMC tries to schedule most of its load during low price hours to save on the electricity bill.The low electricity bill in h 2 is due to the fact that the scheduler generates the appliances' ON/OFF patterns on the basis of user presence, the t s and t f parameters.

Time of day (hour)
Figure 9 shows the comparison of the unscheduled and scheduled cost and power consumption in the RTP environment.Unscheduled power consumption in both homes is almost 8 kW/h during high price hours 07:00 → 11:00.The scheduled power consumption in h 1 is from 6 to 7 kW/h, which is 23% less than h 2 .In h 2 , the scheduled power consumption during 16:00 → 18:00 is high, as compared to time slots 01:00 → 16:00 and 18:00 → 24:00.The total power consumption of h 2 is 16.11% less than h 1 .The unscheduled energy consumption of h 1 is 5.74% more than h 2 , and the scheduled energy consumption of h 1 is 23.11% more than h 2 , respectively.These savings reflect the effectiveness of human occupancy and user preference parameters, as discussed in Section 3. In the RTP environment, prices vary in each time slot due to real-time data exchanged between the utility and consumers.These variations may create complexities in constructing a cost-effective energy management algorithm.Thus, our proposed algorithm is effective in terms of energy and cost reduction.Tables 4 and 5 show the percentage of total electricity cost and energy saving in both the TOU and RTP environments.The overall cost savings of h 1 and h 2 are 40.57%and 60.92%, respectively.It is clear from the tables that the total electricity cost saving of h 2 is 33.41% more than h 1 due to the incorporation of human presence control and weather condition parameters.

Impact of Seasons on the Energy Optimization
In order to analyse the impact of energy consumption trends on the DR program, we consider summer and winter seasons.The average outside temperatures in the months of July and October 2015 are shown in Figure 4 [5].The outside temperature has significant impact on DR programs due to energy demand variations, especially due to HVAC systems, which consume almost 60% of the overall energy.The energy consumption schedules of household appliances in summer are shown in Figure 10.It is clear from Figure 10a that almost a constant amount of energy is consumed by both households during 01:00 → 12:00.From 13:00 → 23:00, h 1 consumes more energy as compared to h 2 due to energy demand variations.h 2 consumes 14.69% less energy in comparison to h 1 .This reduction is due to x ud appliances, which are only turned ON when occupants stay home.Figure 10b clearly shows that the EMC shifts some load from 13:00 → 19:00 to other time slots to reduce cost and peak load due to capacity limits (Equation ( 13)).The energy consumption of h 2 is relatively less due to the activity recognition system.In h 1 , the working of the HVAC is controlled on the basis of inside/outside room temperature differences given in [3,[29][30][31][32][33].In h 2 , human presence along with outside/inside temperature difference is also incorporated in controlling the temperature set points of the HVAC. Figure 11 shows the energy consumption analysis of different homes based on the DR signal for October 2015.It can be analysed from Figures 12 and 13 that occupants consume 5.51% more energy in October as compared to July.However, the total electricity cost in October is relatively less (6.66%).

Impact of Number of Homes
In this sub-section, we extend our analysis from only one home to 40 homes.Firstly, the proposed algorithm is implemented for 10 users, and its performance is analysed.Figure 14 shows varied electricity cost as the number of homes is increased from one to 10.This is due to the fact that all users have different energy consumption requirements and living patterns, so the electricity prices are different.Secondly, the performance of the proposed algorithm is evaluated for 40 homes, where Figures 15 and 16 show the total electricity cost and energy consumption.The aggregated bill reduction of 40 homes with and without person presence control is 92.85% and 68%, respectively, which is shown in Figures 17 and 18.On the other hand, 11.77% and 5.91% of the total energy consumption is reduced with and without person presence control, respectively.It is clear that our proposed algorithm is able to manage the energy consumption for a large number of homes and variable loads.Some users may get more benefits on the electricity bill if they consume less energy, because the energy consumption of each appliance is considered separately in the proposed algorithm.

Impact of PAR
In this section, we analyse the impact of our proposed energy management algorithm on total PAR reduction, which is an important parameter for electricity providers.The EMC performs appliance scheduling based on Objective (24) to minimize PAR. Figure 19 shows the comparison of total PAR reduction in scheduled and unscheduled cases.It is clear that our proposed algorithm significantly reduces the average PAR of a single home and 40 homes.In the case of a single home with h p = 1, the average PAR reduction is 25%, while the average PAR reduction is 47.62% in the case of 40 homes.

Conclusions and Future Work
In this paper, we have identified that the inconsideration of user activities in the existing scheduling techniques creates a trade-off between energy consumption minimization and user comfort maximization.Direct involvement of user activities in our proposed load optimization technique relaxed the trader-off between user comfort and the electricity bill.Considering this trade-off, optimization models of different household appliances have been proposed and implemented by using the proposed algorithm (Section 4.1).The simulation results are analysed in terms of the reduction in energy consumption, the reduction in cost and occupancy.Table 5 shows that a single home saves electricity cost up to 28.85%, whereas 16.80% of the cost is saved in the case of 40 homes, while 25% and 47.62% PAR reductions are achieved in a single and 40 homes, respectively.The unscheduled energy consumption of h 1 is 5.74% more than h 2 , and the scheduled energy consumption of h 1 is 23.11% more than h 2 .Moreover, the analysis of the impact of seasons on the DR programs is beneficial for utilities in managing electricity generation according to variations in demand.
In the future, we will extend this work for a complete residential unit, where: (i) advanced forecasting techniques will be used to estimate total load demand and the availability/capacity of distributed energy resources (solar and wind); and (ii) energy management algorithms will be developed by integrating distributed energy resources into the local microgrid through multi-agent coordination and control techniques [34,35].

Figure 1 .
Figure 1.Energy management architecture for n-homes.

Figure 4 .
Figure 4. Temperature of New York City.

Figure 6 .Figure 7 .
Figure 6.Electricity cost and power consumption comparison in the TOU pricing environment (Unit 1).(a) Unscheduled power and cost of Households 1 and 2; (b) Scheduled power and cost of Households 1 and 2.

Figure 8 .
Figure 8. Electricity cost and power consumption comparison in the TOU pricing environment (Unit 2).(a) Unscheduled power and cost of Households 1 and 2; (b) scheduled power and cost of Households 1 and 2.

Figure 9 .
Figure 9. Electricity cost and power consumption comparison in the RTP pricing environment (Unit 2).(a) Unscheduled power and cost of Households 1 and 2; (b) Scheduled power and cost of Households 1 and 2.

Figure 10 .Figure 11 .
Figure 10.Electricity cost and power consumption comparison in summer 2015.(a) Unscheduled power and cost of h 1 and h 2 in summer 2015; (b) Scheduled power and cost of h 1 and h 2 in summer 2015.

Figure 12 .
Figure 12.Electricity consumption variations in summer and winter seasons, 2015.

Figure 13 .
Figure 13.Electricity cost variations in summer and winter seasons, 2015.

Figure 14 .
Figure 14.Electricity cost when the number of users increases to 10.

2 Figure 15 .
Figure 15.Electricity cost of 40 homes with and without person presence control and 280 appliances.

Figure 17 .
Figure 17.Total electricity cost of 40 homes without person presence.

Figure 18 .
Figure 18.Total electricity cost of 40 homes with person presence.

Figure 19 .
Figure 19.PAR reduction of a single and 40 homes (h p = 0, without person presence; h p = 1, with person presence).

Table 1 .
Limitations in the state of the art work.DSM, demand side management; DR, demand-response; CR, customer reward; NG, not given; C
if number of occupants ≤ 0 and (t d ∼ = t th ) then 1: begin 2: Initialize parameters: t r , t th , φ t 3: for all h = 1 : h do 4: for all t = 1 : T do 5: if number of occupants > 0 and (t d ≥ t th or t d ≤ t th ) then t = t + 1, go to Step 4; till T

Table 3 .
Comparison of different solvers and algorithms.