Dynamic Time- and Load-Based Preference toward Optimal Appliance Scheduling in a Smart Home

In this paper, the household appliance scheduling based on the user predefined preferences is addressed. Previous works generally deal with this problem without integration of renewable energy sources (RESs) in smart home. *e present paper proposes a new demand side management (DSM) technique considering time-varying appliance preferences and solar panel generation. *e branch and bound (B&B) algorithm is developed based on three postulations that allow the time-varying preferences to be quantified in terms of timeand load-based features. Based on the input data including the load’s power rating, the absolute comfort derived from timeand load-preferences, the total energy available from the solar panels as well as the energy purchased from the utility grid, the (B&B) algorithm is run to generate the optimal energy consumption model that would give maximum comfort to the householder based on the mixed-integer linear programming (MILP) technique. To test the performance of the proposed mechanism, three scenarios are considered with local energy production and limited budget for purchasing the energy from the utility grid to cover the user needs. *e simulation results reveal that the proposed DSMmechanism based on the MILP method offers maximum level of comfort for all the scenarios within the available energy limitation.


Introduction
To face today's power system issues, changing the traditional grid by a smart one has become a necessity. Smart grid takes advantage of smart metering infrastructure, advanced communication technologies as well as intelligent control systems to keep the balance between the supply and the demand while ensuring a reliable communication between the utility grid and the end user [1,2]. In this context, efforts at this time are oriented towards energy management according to two sides: supply side management (SSM) and demand side management (DSM) [3,4]. e first category deals with efficient energy production, transmission, and distribution to the user at a low cost. However, DSM mainly relies on planning, controlling, and scheduling the use of the home appliances.
Since the main target behind DSM is to reduce the user's electricity bills while guaranteeing the user comfort, several DSM techniques and algorithms including artificial intelligence (AI) and optimization algorithms are used in the literature. AI has recently immersed in the field of DSM to tackle its various challenges, among the most used methods: artificial neuron network, multiagent system, machine learning, and nature-inspired AI [5]. However, the optimization algorithms are used to solve a mathematical problem. ese algorithms are classified into deterministic methods such as linear programming (LP), nonlinear programming (NLP), and mixed-integer linear programming (MILP). However, the second class is about stochastic methods; it includes genetic algorithm (GA), tabu search, and particle swarm optimization [6].
In fact, home energy management (HEM) is gaining more attention in terms of scheduling the home appliances in order to achieve the DSM objectives. Among these, the critical objective is to maximize the user comfort at a predefined available energy. Most of the research studies relate the comfort to static and dynamic preference choices assigned to the usage of the home appliances. e static preferences are time-independent where the user can attribute some preference level over a day. e appliances with a high preference level must operate the first [7]. In dynamic preference, i.e., time-dependent preference, the user can modify his preference level with respect to time. For instance, a householder gives preference to the water heater in the morning, and at night, he changes its preference since he needed to have his shower at the same time in the morning [8].
Given the foregoing considerations of the user comfort in the field of load energy management, the present work considers the user comfort according to time-and loadbased preference to evaluate the user absolute comfort. e aim of the proposed load comfort management technique is to maximize the user comfort level at a predefined available energy based on mixed-integer linear programming (MILP) technique. is study also develops available energy per unit comfort index (I AE/uc ), which relates the total energy available (TEA) with the achieved comfort (AC).

Contributions.
In the assessment of the previous research, this study proposed an exact method to solve the home appliance scheduling problem with user comfort. Moreover, absolute comfort based on time variation preferences with solar panel integration and daily budget limitation over a day is treated in this work. In time-based preference, time-varying preferences are assigned to an appliance by the user at different time intervals in a day. In load-based preferences, the user assigns relative preference to the load in each operating time interval (OTI). It can change in various time intervals within a day. us, the main contributions of the present research work can be listed as follows: (i) Dynamic user comfort model is used to solve the home appliance scheduling problem taking into account time-and load-based preferences. (ii) Mixed-integer linear programming (MILP) technique is developed to generate an optimal energy consumption model that would yield a high level of comfort to the user. (iii) e proposed load comfort management scheme meets the energy constraints and the daily budget limitation under several scenarios with solar panel integration. (iv) Available energy per unit comfort index which links between the total energy available from the solar panels and the utility grid and the total achieved comfort is taken into account in this work.

Paper
Organization. e rest of this work is structured as follows. Section 2 discusses the literature review. Section 3 elaborates the concept of preference and presents the proposed system architecture. In Section 4, the proposed strategy and the used algorithm are presented. Section 5 deals with the results and discussion based on 3 scenarios. Section 6 concludes the work.

Literature Review
Since the 70s of the last century, several research papers are published in the field of DSM and up to now it still a trending topic. Authors in [9] discuss an experimental home appliance scheduling problem while considering the user's predefined preferences. e proposed binary integer linear programming optimization (BILPO) model realizes efficient electricity cost saving in short computation time. However, reference [10] proposes a system architecture and a userfriendly algorithm for DSM with the use of information and communication technology (ICT). Tested under real data, the objective function was reached in terms of minimizing the electricity bills, the peak load, and maximizing the usage pattern. Authors in [11] propose a smart home controller (SHC) to manage the energy consumption in a residential sector with multiple households. e proposed model is formulated as a multiobjective mixed-integer linear programming (MOMILP) to take advantage of lower-cost pricing and at the same time reduce the peak demand. Another work in [12] considers high-power controllable loads in a house such as electric water heater, electric vehicle (EV), heating-ventilation, and air conditioning (HVAC) system. e aim of the proposed model is to optimize the electricity consumption cost based on traditional saving families and modern comfortable families. In [13], the authors address the residential appliance scheduling while considering the consumer's preferences and the reduction of peak load. e problem is formulated as MOMILP, and the numerical experiments show that the proposed model can reduce significantly the electricity cost, the consumer inconvenience, and the peak load. In [14], the authors develop a hybrid technique combining the genetic algorithm (GA) with binary particle swarm optimization (BPSO) for residential load scheduling to minimize the energy consumption cost and the consumer comfort. e performance of the proposed model is evaluated in terms of electricity cost, peak to average ratio (PAR), and user discomfort. However, the authors in [15] develop a load scheduling algorithm based on cost efficiency and consumer's preference to effectively reflect and affect user's consumption behavior and achieve the optimal energy consumption profile. Tested under real data, the proposed method realizes the desired trade-off between economic efficiency and consumer's preference. In the same context, authors in [16] propose a convex optimization problem for scheduling the home appliances under a day-ahead electricity pricing. e proposed power scheduling strategy can achieve a trade-off between the user discomfort and the electricity payment. Similarly, the authors in [17] propose a fractional programming approach to schedule the electrical appliances in a smart house based on cost efficiency and consumer consumption preferences. Tested under four consumption models, the proposed method is proved to be efficient in improving the consumers' consumption and satisfaction while saving costs.
Renewable energy and storage systems have been increasingly integrated in smart houses, which is the subject of several research studies. In [18], the authors propose a model with and without the integration of the renewable energy sources (RESs) to scheduling the home appliances. e proposed model reduces the peaks and the electricity bills using evolutionary algorithms (EAs) such as binary particle swarm optimization (BPSO), genetic algorithm (GA), and cuckoo search. e authors in [19] utilize a stochastic optimization approach to find the optimal schedules for a home energy management system (HEMS) where energy prices and generation from renewable sources are time-varying. e aim of the proposed method is to find the minimum energy cost while taking into account the supply and demand constraints. To balance the residential load curve, the authors in [20] propose a system model based on the coordination of microgrids using a dynamic algorithm. e problem is formulated as a biobjective optimization problem, and the obtained results demonstrate the efficiency of the proposed approach in balancing the load curve. In [21], the authors evaluate the performance of a designed home energy management controller with RES integration based on GA and binary particle swarm optimization (BPSO) in terms of electricity bill reduction, peak to average ratio minimization, and user comfort level maximization.
erefore, the work in [22] proposes a strategy for residential community in smart grid that optimally schedules the home appliances using MILP. Without bringing the user discomfort, the proposed model reduces both the electricity cost and the peak load. With the integration of RESs and smart communication technology in a home, the work presented in [23] develops an intelligent home energy management which ensures effective utilization of the RESs and provides significant savings. Moreover, the work presented in [24] proposes a multiobjective model for managing the residential loads with solar panels and batteries integration. e proposed model proves its efficacy in reducing the user's discomfort, the total electricity cost, and the standard deviation of the consumed power. A mixed-integer linear programming (MILP) model with solar panels and energy storage integration is proposed in [25] to efficiently allocate the load consumption based on a predefined priority of the user's loads.
With insight of the different works discussed before, it can be concluded that the major challenges associated with DSM can be summarized in three main points: minimizing the electricity bills, the PAR, and the discomfort. Both, formal techniques and metaheuristics algorithms are vastly applied to solve the home appliance scheduling problem in an awe-inspiring way. e user comfort is a key indicator that reflects if the user is pleased or not with appliance usage. It depends on the preferences of the users which can vary from a user to another one. Static preferences assigned to the home appliances are commonly applied by the researchers. Incorporating dynamic preferences can better enhance user comfort. Most of the works in the literature associate the user comfort with thermal comfort caused by the power deviation and the delay caused by scheduling the appliance usage. However, the preference of the user is ignored which is the main target of this work.

Concept of Preference and the Proposed Model Architecture
User preference is the main factor that influences the demand in several areas; it refers to whether the user is pleased or not with a certain product or service. In the field of home energy management, generally, the householder has different types of appliances which demand different power rating to function. Moreover, these appliances have different preference levels that can vary from a user to another according to his situation and attitude throughout a day.

Preference Concept and Postulations.
It is commonly known that the user's main attention is to pay fewer bills while being comfortable. As proposed in this work, the user has a budget limitation to spend on his energy demand during one day. e real challenge involved in the home energy management controller (HEMC) is to determine the time and device usage pattern that may provide maximum comfort at limited energy available. In this concept, the index of available energy per unit comfort is introduced, and it can be expressed as follows: where TEA is the total energy available from solar panels and utility grid according to the budget limitation and TAC is the total achieved comfort. Given that the user's objective is to maximize TAC while keeping TEA fixed; hence, I AE/UC must be the minimum possible. To achieve that target, the following postulations are made: (i) e preference p is quantified and can be numerically evaluated. (ii) e preference p takes values in between complete preference p � 1 and complete indifference p � 0. (iii) e preference is relative and comparative. e two preference levels are defined as load-based and time-based preference.
In time-based relativity, the preference assigned to an appliance #I changes with respect to different time intervals during the day. If there is an appliance #I, then the preference set by the householder in time t 1 can be represented as (p I (t 1 )). is preference is relative, and it can be compared with the preference it provides at time t 2 (p I (t 2 )).
In load-based relativity, if two appliances #I and #J operate at the same time t 1 , (p I (t 1 )) and (p J (t 1 )) can be compared. For example, at 13 pm if the user is hungry and wants to turn on the microwave and at the same time the washing machine but he is under an energy constraint which forbids him from using both. In this situation, he attributes high value to the appliance with the highest preference. Figure 1 demonstrates a graphical representation of the proposed model that performs for scheduling the home appliances. It consists of integrating solar panels and power grid to cover the user energy needs. e proposed smart home is composed of 5 sections; each section is equipped with multiple devices. e specification of the appliances is detailed in Table 1. It is worth mentioning that the electricity tariff (ET) received from the utility thought the smart meter (SM) is fixed at 0.115$/kWh. is ET is used to estimate the total energy available (TEA) at a fixed budget. However, based on daily temperature and solar irradiance, the total energy available from solar panels can be obtained as shown in Figure 2. In case of surplus energy production, the user can sell the energy to the grid utility at the same tariff of 0.115$/ kWh. rough the user interface, the householder can evaluate his preferences based on time relativity and load relativity. e challenge of the home energy management controller (HEMC) is to find the optimal model for the energy consumption of the home appliances to yield maximum comfort to the user under the energy constraint limitations. Advanced communication protocols are installed at home to ensure the communication between the HEMC, SM, and the appliances. Among the various technologies existing in the market, Wi-Fi, Bluetooth, and Z-Wave provide reliable communication at a low cost [26].

Absolute Comfort.
In this work, the absolute comfort results from the time-based table preference and the loadbased table preference assigned to the user to fill in with values between 0.0 and 1.0. e input data (i.e., time-based preference and load-based preference) are transmitted from the user interface (UI) to the home energy management controller (HEMC) to calculate the absolute comfort as discussed later on. Table. In the time-based preference table, the householder fills in each box of the table horizontally as follows:

Time-Based Preference
(i) e user takes an appliance #I and decides in which hour of the day t max its usage is highest. (ii) A maximum preference value is attributed to this hour (t max ), p I (t max ) � 1. (iii) For the rest of the day, the user compares his preference from the use of the appliance #I and assigns values between the highest preference level 1.0 and lowest preference level 0.0 as expressed in the following: e previous actions must be repeated for all the considered appliances all over 24 hours. is process is more explained in Figure 3. Table 2 shows the time-based preference table filled by a typical householder. It is noted that these data can be changed according to each user. Here, it can be depicted from Table 2 that the householder attributes maximum time-based preference to TV in time intervals 20 and 21 because it is time for daily news; however, at time 22, 23, and 24, his preference decreases to 0.9, 0.5, and 0.2, respectively; this is based on the second postulate (preferences are comparable). Table. In load-based preference table, the data are filled vertically by the householder following the next steps:

Load-Based Preference
(i) e householder chooses a specific hour t.
(ii) If the appliances #I, #J, and #K are available to be used, then the user sets the maximum preference to an appliance #I because of its maximum utility at that time hour t, p I (t) � 1. (iii) e rest of the appliances are compared with this reference device #I and take values from 0.0 to 1.0. Table 3 shows the load-based preference table of the considered user in this work. It can be seen from the table that at time interval 21, the maximum load-based preference value 1 is assigned to TV, lighting, AC, and phone charger. It indicates that the householder expects using all those appliances at 21 h. e rest of the appliances take relative preferences with respect to this maximum preference value.

Absolute Comfort.
e absolute comfort takes into consideration the two-input data (time-based and loadbased preference). e absolute comfort of an appliance #I at time t i is calculated as follows [27]: where p T I (t) and p L I (t) are, respectively, the time-based and load-based preference of an appliance #I at time t. For normalization purposes, a denominator of � 2 √ is used. So, the AC will take values between 0 and 1. For example, Table 2 reveals that the time-based preference value of the microwave at 6 h is equal to 0.8. However, the load-based preference at the same time in Table 3 indicates a value of 0.5. Using equation (3), the absolute comfort of the microwave can be calculated as follows: For all the appliances during 24 hours, the absolute comfort obtained using equation (3) is represented in Table 4.

Proposed Load Comfort Management
Strategy and the Used Algorithm e proposed load comfort management strategy is composed of three main segments, namely, the input, the process, and the output as shown in Figure 4. e input data include the loads power ratings, the time-based preference, the load-based preference, the total energy available from the solar panels, and the utility grid according to the budget limitation. e HEMC calculates the absolute comfort and finds the optimal scheduling model of the appliances that give maximum comfort which is the output data. e computing method is elaborated hereafter using mixedinteger linear programming (MILP) technique. e detailed process of the proposed strategy is explained in Figure 4.

Objective Function.
e objective of the proposed technique is to schedule the home appliances in such a way the user comfort is maximized at a fixed budget. As it can be observed from equation (1), the available energy per unit comfort I AE/UC is a function of the total available energy TEA and the user's comfort UC. Hence, the objective function can be rewritten as follows:          11 12 13 14 15 16 17 18 19 20 21 22 23 e total energy available is a summation of energy available from the solar panels and the energy purchased from the utility grid: where TEA PV is the total energy available produced locally by the solar panels. Knowing the daily temperature and solar irradiation, the TEA PV can be obtained as follows: where η PV is the energy conversion efficiency of the solar panel system, A PV is the array of the generator, I t r is the solar irradiance (kW/m 2 ), and T t a is the outdoor temperature (°C). TEA grid is the energy obtained from the utility grid. Knowing the budget limitation B, the TEA grid can be calculated as follows: where B is the daily budget and ET is the electricity tariff.

Mapping the Comfort Scheduling
Model. Similar to the overall approaches to the solution of the constraint optimization problems, the branch and bound (B&B) algorithm has been established as an intelligent computational tool for solving integer programming, nonlinear programming, traveling salesman, and quadratic assignment [28]. e B&B algorithm searches the complete space of solutions to a given problem for the best exact solution. B&B is based on the observation that the enumeration of integer solutions has a tree structure, and the main idea in B&B is to avoid growing the whole tree as much as possible because the entire tree is too big for real problems. In this work, the problem model is formulated as a mixed-integer linear programming with binary decision variables 0-1. e computing steps are followed to find out the optimal scheduling model: (Algorithm 1)

Results and Discussion
In order to scrutinize the performance of the proposed load comfort management technique, several scenarios are studied in this section based on the daily energy available from the solar panels as well as the user's daily budget limitation. From the desired comfort and the load energy consumption table, the proposed technique is run to find time interval where allocating energy so as to achieve maximum comfort at every budget limitation. e following sections establish the analysis of the results obtained from the three scenarios.

Scenario 1: Considering Just Solar Panel Generation.
In this scenario, only solar panels are used to meet up the household energy needs. Connected with the grid, the solar panels allow the injection of the energy produced in order to bring the necessary energy when required. Since the energy produced from the solar panel is not the same all over the year, in this work we suppose a typical day in December and Read load energy consumption. Read time-based preference. Read load-based preference. Read total energy available from solar panels. Read total energy available from utility grid according to the budget limitation.
Calculate absolute comfort using equation (3) Proceed to HEMC Max comfort achieved?
Appliance scheduling model

Mathematical Problems in Engineering
July in Rabat city in Morocco. Figure 2 represents the daily energy generation from the solar panels. e aim of this proposed load comfort management technique is to determine the energy consumption model that would allow maximum comfort to the householder at the same quality of energy produced locally. e obtained results for the two cases are presented in Tables 5 and 6, respectively. e value of 1 indicates that the corresponding appliance must be turned ON at that time interval while the value of 0 enforces the load to be turned OFF. e performance of the proposed algorithm for this scenario is depicted in Table 7. e total energy available from the solar panels is assumed to be 14.295 kWh in the day of December; however, for the day of July, it is assumed to be 21.81 kWh. From Table 4, the total desired comfort (TDC) is obtained by summing all the user's absolute comfort input for all the considered appliances during the day. It can be expressed as follows: where t represents time interval during one day and i denotes the home appliances. Moreover, the total achieved comfort (TAC) is obtained by adding the user's absolute comfort value outputs derived from Table 5 and Table 6 according to each considered case. e level of comfort (LOC) is the ratio of the TAC to the TDC. It can be calculated as follows: e comparison between the hourly desired comfort and achieved comfort for the two cases is shown in Figures 5 and 6, respectively. e total operating time (TOT) value of all the appliances in the first scenario is given in Table 8. It can be observed that some energy consuming devices like the dish washer and the cloth dryer start operating in the July day. Moreover, other appliances have increased their operating time such as TV, air conditioner, microwave, and laptop which justify the increase value of LOC in the day of July.

Scenario 2: Considering a Budget Limitation of 0.5$/Day.
In this scenario, both solar panels and energy grid are used. A budget limitation of 0.5$/day is considered. Same as the previous scenario, the proposed load comfort management technique is performed in order to obtain maximum comfort according to this budget limitation for the two cases, i.e., a day of December and a day of July. e load allocation patterns obtained for the two cases are shown in Tables 9 and 10, respectively. Table 11 represents the obtained results for the two cases. It is obviously known that an increase in the total energy available will immediately increase the LOC. Its value is getting higher when compared with scenario 1 while considering the same cases. e highest value of LOC is 81.51% on the day of July. Meanwhile, in December, the LOC has increased from 71.4267% in the previous scenario to 75.5413% in the current one. Besides, the I AE/UC index is also higher in case of July day, i.e., 0.48 because the HEMC can afford consumption of high-power rated loads which were kept OFF in the previous scenario. Another justification of the increase in the I AE/UC index is that the appliances may be operated for a long period of time.
(4) For i � 1 to n do (5) For t � 1 to 24 do (6) Evaluate the following optimization expression: where AC is the absolute comfort matrix, P is the appliance power matrix, δ represents the length of the boxes where the user's absolute comfort is different from 0, and x is the decision variable output, and it takes 0/1 if the load is OFF/ON. (7) End for (8) End for (9) Return x (i, t) the decision variable output (10) Calculate the level of comfort using equation (10) (11) End procedure ALGORITHM 1: Optimal mapping model.

Mathematical Problems in Engineering
At the same budget limitation, the TOT of all the appliances in the second scenario is given in Table 12. As a comparison between the previous case and the current one in the case of a December day, it can be seen that the TOT of several appliances has increased other appliance like the dish washer which has been switched OFF in scenario 1 start operating in this scenario. Moreover, in the case of July day appliances like the water heater and the refrigerator start operating for the first time and other appliances are used for a long period. Figures 7 and 8 show, respectively, the hourly comparison between the TDC and TAC for the two cases, within the budget limitation of 0.5$/day. It can be seen that the TAC in July case has risen at time intervals 1, 3, 6, 12, 19, and 20 in contrast to December case.

Scenario 3: Considering a Budget Limitation of 1$/Day.
In this scenario, the budget limitation is increased from 0.5$ to 1$ per day. e load allocation patterns obtained for the two cases are shown in Tables 13 and 14, respectively, while the performance of the proposed mechanism is given in Table 15.
It is revealed from Table 15 that within the same budget limitation, the TAC in July day is 56.1030; however, in December day it is assumed to be 52.3586. e highest level          of comfort is achieved in case of July day, the higher value than all the previous scenarios. It is estimated at 84.81% whoever, for the December day the LOC is 79.15%. is increased in the level of comfort while moving from scenario 1 to scenario 3 is caused due to the increasing values of the daily total energy available. It is noted that the value of the I AE/UC index is high in July day, i.e., 0.54 as compared with all the previous scenarios. e TOT value of all the appliances for this scenario is given in Table 16. It is shown in this table that all the appliances are kept ON in July day case; moreover, some highpower rated appliances are used more than one time which  4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23     increase the user comfort in an optimal way. For the December day, it can be seen that some appliances are still kept OFF like the air conditioner and the refrigerator; however, the TOT of other appliances is decreased. Figures 9 and 10 show, respectively, the hourly comparison between the TDC and TAC for the two cases within the same budget limitation. For the day of July, the TAC has increased in time slots 6,8,19, and 12 unlike the day of December.
It is obviously known that an increase in the householder budget immediately results in the increase in the user comfort, i.e., the TAC increases as well while moving from scenario 1 to scenario 3. Simulations with budget 0$/day to 10$/day with a step of 0.5 are done. Figure 11 shows the relationship between the daily budget and the level of comfort for the two cases. As mentioned earlier, an increase in the daily budget correspondingly increases the LOC. In the day of July, complete level comfort is reached at the daily budget of 7.6$. However, in the day of December, total comfort is achieved at the budget of 8.6$.

Conclusions
In this paper, a preference induced DSM mechanism with solar panels integration based on exact technique has been suggested. e time-varying preferences assigned to the home appliances according to time-and load-based preference are made quantifiable, and absolute comfort is derived from these preferences. MILP technique is developed to generate an optimal energy allocation model of the home appliances that would yield to a maximum level of comfort at a limited available energy. e simulation results on three   scenarios with two cases, i.e., day of December and day of July demonstrate the efficiency of the proposed algorithm which successfully maximizes the TAC. e TDC value derived was 66.14. e proposed technique induced HEMC to make the optimal scheduling model resulted in achieving LOC of 71.42%, 75.54%, and 79.15% in the day of December. However, in the day of July, the level of comfort of 78.21%, 81.5%, and 84.8% is achieved for the same daily budget of 0$, 0.5$, and 1$, respectively, while considering the energy produced locally by the solar panels.

Data Availability
All data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that they have no conflicts of interest.