Conditional Value-at-Risk Model for Smart Home Energy Management Systems

This paper presents a self-scheduling framework, using a risk-constrained optimization model for the home energy management system (HEMS), considering fixed, controllable, and interruptible loads, as a new contribution to earlier studies. The objectives are reducing the electricity bill and managing the risk of purchasing energy over on-peak hours and prosumer’s discomfort index (DI) due to shifting load to undesired hours. In this regard, the problem formulation is represented as a mixed-integer linear programming (MILP) model. Afterward, the proposed HEMS is promoted to a conditional value-at-risk (CVaR) model. The prosumer is equipped with an energy storage system and a solar photovoltaic (PV) panel. A substantial fraction of the load demand is controllable, and there is an inverter-based heating, ventilation, and air conditioning (HVAC), where HVAC is modeled as a variable-capacity interruptible load. The optimal scheduling of the loads is supposed to be done by the proposed HEMS, and the time-of-use (TOU) mechanism is utilized, including three price steps over the day. The results, obtained from thoroughly simulating the problem using household data, validate the performance of the presented HEMS in mitigating the amount of the electricity bill, while keeping the discomfort index of the prosumer at a desired level.


Sets
, Index/total number of scenarios , Index/total number of time intervals , 1. Introduction

Background and Motivation
Today, demand response (DR) programs can be effectively implemented together with the advancements in the area of home energy management systems (HEMSs) and smart appliances, manufactured recently. These home appliances have been manufactured with respect to the protocols of the internet of things (IoT) [1]. Accordingly, the application of IoT in smart homes has captured attention. To this end, one important objective is the minimization of the amount of the energy bill of such smart homes, while simultaneously keeping the discomfort level of the prosumer at the desired level.
Simultaneously with the advancements in the home appliances and adding the interaction capability between the residential customers and electrical grid, HEMSs have been introduced to effectively and efficiently modify the load profile of such consumers [2]. This concept has already been comprehensively investigated. In this regard, a mixed-integer nonlinear programming (MINLP) model was introduced in [3] while the discomfort level of the consumer has been characterized by applying a penalty to the final schedule. The studied system comprised of 10 home appliances, enabling the consumer to choose the desired operational strategy.
Moreover, a penalty would be applied in case the operation time of these assets is shifted to time intervals other than those preferred by the consumer. The obtained results verified a 25% reduction in the daily energy bill of the customer.
Ref. [4] utilized a risk-oriented model on the basis of the conditional value-at-risk (CVaR), addressing the uncertainties related to the energy storage system, solar power generation, energy price, and load demand. In this respect, incentive-based programs have been deployed to attract the end-users and it has been concluded that a saving in the bill equal to 18% can be obtained. Ref.
[5] presented a day-ahead scheduling framework for home appliances by using a new optimization method and applying different tariffs.
A Comprehensive analysis of risk-based energy management has been proposed in [6] while CVaR technique has been adopted to make an efficient scheduling for cost minimization for dependent microgrid under normal and emergency operations. Ref. [7] proposed a multi-objective mixed-integer linear programming (MILP) framework for the self-scheduling of a HEMS, equipped with a battery, while applying the time-of-use (TOU) tariff. The results show the effectiveness of the model in reducing the energy bill of the consumer and alleviating the peak load demand.
Furthermore, [8] employed the epsilon-constraint technique [9]- [10], as an efficient multi-objective optimization tool to tackle the self-scheduling problem of the HEMS in a MILP framework. The uncertainties, caused by the intermittent renewable power generation within the scheduling problem of a HEMS, have been addressed in [10]. The obtained results indicate that the presented model can effectively mitigate the monthly energy bill of the customer by 42%, despite the results are case-sensitive. A tri-objective optimization framework for microgrids energy management has been developed in [11]. The proposed multi-objective model has been investigated to evaluate the effect of demand response on operation costs and peak to average ratio (PAR). In addition, the customers' comfort index has been selected as one of the objective functions. The results confirm that an increase in DR penetration reduces the PAR and operating costs and leads to a decrease in the customers' comfort. Ref. [12] presented a stochastic optimization based model, aimed at minimizing the electricity bill and thermal discomfort level of consumers by using an HEMS, taking into consideration the load demand of the heating, ventilation and air conditioning (HVAC) system. In this regard, the uncertain parameters, relating to the outdoor temperature, local power generation, load demand, energy price, and the number of occupants have been modeled. The authors in [13] presented a scheme for the optimal energy management of commercial buildings in microgrids. This scheme aimed to increase the resilience and minimize the operating costs of these buildings, while making use of the CVaR methodology to assess the potential risk of various uncertainties within the scheme. The uncertainties were associated with the electricity price and solar photovoltaic (PV) power generation.
A multi-objective MILP model was developed by the authors of [14]. In this model, both the thermal and ocular comfort of the consumers were considered. The ocular comfort was assessed through the illuminance in the model home considering both daylight as well as artificial lighting. Uncertainty regarding the solar PV generation and the energy price was considered in the time averaged stochastic model using the expected value on the objective function. This model did not consider a risk measure to account for variation, which is a novel contribution of our proposed model.
A framework for the coordinated operation of several residential HEMS to maximize the use of locally produced electricity while considering grid constraints was produced by [15]. The authors used a ADMM model and introduced both global and individual incentives to help increase load modification by the consumers.
consumers and considered uncertainties related to the energy price, load demanded and PV generation.
Ben Slama incorporated V2G into a HEMS model and used a scenario scheduling algorithm to meet the daily demand of a HEMS. The model did not consider HVAC units or risk management strategies. However, the model did consider travel times for the electric vehicle and climatic conditions [17].
In [18] a multi-objective robust optimization approach, incorporating CVaR as a risk measure, was formulated for residential buildings. The uncertainties addressed were demand and supply fluctuations. A MILP model was developed to minimize the system's total day-ahead operating cost, including the generation costs for both heat and power, as well as the costs associated with emissions. The model considered various domestic appliances, plug-in hybrid electric vehicles (PHEVs), wind turbine, energy storage systems, combined heat and power (CHP) units, and a boiler in order to satisfy the energy demand. A model was developed by [19] for the HEMS in order to optimally manage thermostatically-controlled loads (TCLs), PV, and battery systems. The aim was to minimize the operating costs of the TCLs, while maintaining the indoor temperature at certain set points and using the TOU tariff.
A dispatch strategy for the optimal management of HVAC systems within smart buildings, considering the CVaR approach, has been developed in [20]. The strategy used a two-stage model to plan the dispatch for the day-ahead operation of HVAC systems to minimize the electricity consumption, while the second stage of the model sought to reduce the power transaction with the utility grid in real-time. The model addressed uncertainties, relating to both power output of units and outdoor temperature. The model considered the HVAC system of the building as well as PV and energy storage systems. Thermal comfort constraints were taken into account through the predicated mean vote framework.
The authors in [21] presented an energy management system for residential buildings, considering the energy hub concept. The model aimed to balance the performance and the resilience of the system, addressing different uncertainties. The authors made use of a flower pollination algorithm. The authors used the TOU tariff and considered natural gas-fired units, PV systems, CHP units, and PHEVs. Residential demand response programs with distributed PV generation was developed by [22]. The model used a dynamic electricity tariff and considered both consumer's cost and comfort as objectives. The non-dominated sorting genetic algorithm II (NSGA-II) was used, and the consumers were classified into several categories to ensure that a wide range of different consumers' preferences were investigated.
An optimization approach for the robust day-ahead operation of a HEMS, using the CVaR model, was presented in [23]. The model aimed to reduce the risk, associated with the uncertainty around the real-time energy plan and PV power generation. The model used PV, PHEV, various domestic appliances within the smart home, and the TOU tariff.
An optimal control strategy for energy storage systems within microgrids considering the CVaR was developed in [24]. The authors applied two methods based on the online rolling horizon control strategy, and considered the uncertainty related to the electricity price and demand profiles. The online rolling horizon model predictive control strategy repeatedly solved the optimization problem over a rolling window to increase the robustness of the developed strategy. The authors considered both commercial and residential buildings and used a TOU pricing regime.
A model was designed in [25] for the optimal energy management of a smart home using a differential evolution algorithm.
The model used PV systems, energy storage systems, and domestic appliances to maximize the user's comfort and minimize the peak-to-average ratio. The authors considered a TOU tariff and demand-side uncertainties, as well as the volatile PV power generation. It is noteworthy that no risk mitigation tool was used. The authors of [26] implemented a dynamic energy management system, which used the real-time pricing and power generation forecasts from renewable energy systems to minimize the operating cost of a smart home, as well as to maximize the amount of renewable energy used. The power consumption of various domestic appliances, the electricity tariff, and the renewable power generation were taken into account in the model.
A HEMS was proposed in [27] based on the voltage control for a smart home to reduce the on-peak demand, and increase the energy efficiency of the home. The objective was the minimization of the shifting of appliances operation time. The model incorporated a PV system, wind turbine and electric vehicles (EVs). The authors of [28] devised a HEMS to help optimally schedule appliances, energy storage systems and generation units to reduce the operating cost as well the operating emissions. The authors used the CVaR risk management approach and optimized the system using a modified flower pollination algorithm combined with a MILP method.
A hybrid energy management system was presented in [29] for industrial buildings located in microgrids. The objectives were to minimize the operating cost and the associated emissions. The hybrid method consisted of a flower pollination algorithm and a MILP approach. The model addressed internal combustion engines, fuel cells, PV systems, EVs and energy storage systems for both deterministic and stochastic conditions. The authors used a TOU tariff as well the CVaR approach.
The most relevant literature consulted for this paper is summarized in Table 1 below. This table provides a means to directly compare the existing literature and the proposed model. It can be seen that while several papers investigate aspects of the problem, none of them comprehensively address the problem as is done in the proposed model.

Novel Contribution and Paper Outline
This paper presents a MILP model for the inverter-based HVAC, assigned to the problem as an interruptible load. The HVAC is responsible for controlling indoor temperature in the day-ahead self-scheduling framework, handled by the HEMS.
The novel contribution of this paper is related to developing a MILP model for the risk-constrained self-scheduling problem of a residential prosumer, seeking to mitigate the electricity bill by managing the electrical energy consumption. Besides, the selfgeneration assets would be utilized to reduce the end-user's need to purchase energy during peak hours. This paper proposes a MILP model for all types of loads, in a comprehensive manner, and for the energy storage system.
The remainder of this paper is structured as follows: The background and foundations of HEMSs are shown in Section 2.
Section 2 also contains a discussion of the three load types studied. Section 3 presents the mathematical formulation of the self-scheduling HEMS using a MILP framework. The results, obtained from simulating various case studies, are discussed in Section 4. Lastly, Section 5 presents some relevant conclusions from the study.

Home Energy Management System
The concept of HEMS can be effectively implemented in smart homes due to the recent developments in smart appliances and smart meters. There are various home appliances in the house, each associated with an individual functionality. All these appliances are categorized into three general types of load demands. Fixed loads are the first type, showing the load demand that cannot be shifted to other time slots. Hence, they should run without any interruption, like a refrigerator.
Fixed loads are associated with different consumption patterns over the day with respect to the type of the compressor.
However, the end-user would not be able to change the consumption by shifting it to other time slots.
The second category relates to those loads that can be controlled during the day with respect to the priorities of the consumer.
It is noteworthy that once these loads are plugged in, it would not be possible to interrupt them during the operation. Controllable loads in the residential sector mainly include dishwashers, spin dryers, and washing machines. Such loads can be used in predetermined time intervals, according to the preferences of the consumer.
The third load type corresponds to the interruptible loads, having the capability to turn on/off several times a day. The HVAC is regarded as an interruptible load. The HVAC is supposed to control the indoor temperature and provide the end-user with thermal comfort. This device can turn on/off several times a day thanks to its technology. It should be noted that the HVAC systems with thermostat are not categorized into interruptible loads. On the contrary, inverter-base HVAC systems are capable of providing enhanced controllability, enabling the user to set the temperature at different values, resulting in different power consumptions.
Accordingly, an inverter-based HVAC system has been considered in this study, such that the temperature can be kept within a pre-given desired indoor temperature range. The HEMS is illustrated in this paper in Fig. 1, showing most of the described devices. The HEMS is generally supposed to optimally schedule home appliances, while taking into consideration the preferences of the end-user. In this respect, the operating status of the home appliances is determined by using the HEMS through a self-scheduling framework. The decision variables of the problem are the binary variables, specifying the operation statuses of the appliances. The proposed self-scheduling problem is modeled in the subsequent section.

HEMS Problem Formulation
This section presents the mathematical model of the self-scheduling problem of the HEMS. The problem is first modeled as a conventional stochastic optimization problem, and then it is developed into a risk-oriented optimization problem, using CVaR. It is noteworthy that both problems are modeled as a MILP problem.

Stochastic Optimization Model
The objective in this case is to minimize the expected value of the daily electricity bill of the end-user. The objective function is comprised of two items, namely the cost due to transacting energy with the electrical grid, and also the penalty applied due to shifting the load demand to other intervals. In other words, the end-user's discomfort is modeled and added to the objective function as a cost item.
The presented self-scheduling problem is tackled as a stochastic MILP problem, aimed at minimizing the electricity bill of the end-user for one day, as follows: As expression (1) shows, the first term is related to the costs due to importing energy from the utility grid. The second item stands for the costs due to the potential discomfort occurring to the end-user for shifting the load demand to undesired time intervals. In (1) the probability the scenario occurring is shown by . The power imported from the grid to the home is shown by , and the power exported from the home is depicted by , . The prices of electricity from the grid to the home and the home to the grid are shown by and . The discomfort penalty parameter is shown by . The discomfort for each asset before the baseline operation is shown by , while the discomfort after the baseline operation is shown by , .
It is worth noting that for controllable loads the end-user is able to change the plug-in time and, accordingly, mitigate the electricity bill. The mentioned problem is subject to different constraints as described hereafter in detail.
It is noteworthy that the HEMS operator is supposed to optimally schedule the home appliances with respect to the preferences of the end-user and the TOU tariff. It should also be noted that the baseline time slots are characterized by using binary parameters, Bi,t, and the operating time slots, shifted, are characterized by using binary variables, Si,t.
In this respect, the binary string should be in accordance with the time slots, determined by the consumer for the operation.
Thus, the value of the baseline binary operation status Bi,t should be equal to "1" for the mentioned time slots and "0" for the remaining time slots, as shown in (2). The lower and upper bands of each controllable assets for the baseline case are shown by , and , respectively. The plug-in duration, relating to every controllable appliance, can also be specified by using (4)-(5).
However, it should be noted that the total number of non-zero binary parameters and binary variables should meet the operation duration of the devices, denoted by Ti. Equation (6) represents the controllable load demand, taking into account the total plug-in statuses, relating to the controllable devices, with the power consumption of the controllable asset is shown by , , ℎ . Equation (7) indicates a straightforward relationship to model the on/off statuses of the controllable loads. Switching on/off would be realized by using the changes in the status of the devices, e.g. from "1" to "0". Shifting the operation duration of controllable loads to before the baseline slots can be observed in (8), while (9) corresponds to shifting the operation duration of controllable loads to after the baseline slots. It is noteworthy that the Euclidian distance metric is used to model these equations. The DI would take the value "0" for the baseline slots, while for the slots, over which it is shifted, it takes the value other than zero. The total plugged in time for each asset is shown by .
The hourly operation of the electrical energy storage (EES) system has been modeled through relationships (10) The HVAC based on the inverter, studied in this paper, is modeled by using the relationships (16)- (20). In this respect, the constraint modeling the dynamic indoor temperature is stated in the relationship (16), taking into consideration the impacts caused by the outdoor temperature, i.e. θ t out , the impacts of insulation, i.e. µ, the building's thermal coefficient, i.e. , as well as the power consumed by the HVAC [34]. Inequality (17) determines the convenience temperature range. The minimum and maximum indoor are shown by and , respectively.
Constraint (18) shows the value of the initial indoor temperature. Relationship (19) shows the precise power consumption, , , , of the HVAC system. It is worth mentioning that the studied inverter-based HVAC system is capable of operating at different power levels shown by , ( ) . As constraint (20) emphasizes, the HVAC should strictly work in one of the operating intervals, provided that it is turned on [35].

Risk-based Stochastic Optimization Model
The main objective of the risk-based stochastic self-scheduling of the HEMS is to minimize the total operating cost, taking into account the risk of the studied scenarios. Hence, the objective function is comprised of the expected value of the total cost, Z, considering the item relating to the risk.
The function F1 states the expected value of the costs due to the power transaction with the utility and the penalty for the DI of the end-user. The function F2 shows the risk due to the incremental power purchase from the utility grid and the DI.  is the weighting factor in the CVaR model, interpreting the significance of the risk.
In case =0, the model would turn into a risk-neutral optimization model, similar to that of the base case. In case =1, the model focuses on minimizing the risk. In this way, the problem would be tackled as a risk-averse model. In other words,  indicates the trade-off between the expected value of the cost and the cost variability for the studied scenarios.
Another key parameter in the CVaR is α, showing the confidence level. The higher the value of α, the more conservative the model would be. The value of α is considered as 90% in this paper. By taking into consideration α ∈ (0, 1), the CVaR model would be tackled as the expected value of the cost more than the (1−α)-quantile of the cost distribution. In case all scenarios of the cost have the same probability, the CVaR can be obtained as the expected value of the cost in the (1− α) ×100% worst scenarios.
The objective function in this case is modeled by using relationships (22)- (24).
It is noted that the constraints are similar to those of the base case, i.e., relationships (2)- (21). Constraints (25) and (26)  The next section presents the comprehensive results obtained from simulating two case studies.

Simulation Results
This section provides the comprehensive results obtained for the self-scheduling problem of the HEMS. The objectives are the minimization of the total cost and the risk due to purchasing power over on-peak intervals, and the end-user's DI, due to the load shifting to undesired intervals. The data of the fixed and controllable loads are available in [36] for the sake of making a numerical comparison. Furthermore, Tables 2, 3 and 4 represent the data of the controllable loads, EES system, and also the indoor temperature settings, respectively. It should be noted that the time resolution of the scheduling is 30 minutes. Fig. 2 illustrates the per unit (pu) solar PV power generation. Fig. 3 depicts the outdoor temperature scenarios as a function of solar irradiance and other meteorological parameters. The energy price is applied based on the TOU tariff, including three tariffs for the off-peak, shoulder-peak, and on-peak intervals, as reported in [8]. The simulation results are obtained by using the CPLEX solver by IBM, implemented in the general algebraic modeling system (GAMS) software.
A sensitivity analysis has also been carried out to optimally determine the capacity of the solar PV panel to operate together with other assets. The cost relates to the capital cost of the PV panel, and the maintenance of the inverters of the EES system and solar PV panel. The sensitivity analysis results are shown in Fig. 4.
It is noteworthy that the fixed costs of the PV panel and battery are calculated for one day and added to the electricity bill of the end-user. Moreover, it is assumed that the end-user is willing to participate in the DR program and, accordingly, the objective function of the problem is the minimization of the electricity bill. In other words, the electricity bill is obtained in the risk-neutral case, and DI equal to zero. The problem is studied for one year, considering the energy consumption on workdays and weekends in different seasons. The simulation results show that the optimal capacities of the battery and PV panel are 4 kWh and 3 kW, respectively, as shown in Fig. 4.
Two different case studies are addressed to study the self-scheduling problem of the HEMS. The first case proposes a deterministic framework for the problem, while the second case investigates the problem by using stochastic programming and CVaR model.

Case 1: Deterministic Self-Scheduling model
The mean values of the solar power generation and outdoor temperature are considered as reference values in this case, and simulation is done by using equations (1)- (21). In this respect, ρ ω =1, and the number of scenarios is 1, i.e., N ω =1. The total amounts of energy consumption of fixed loads and controllable loads are 9.96 kWh and 29.05 kWh, respectively. The net solar energy generation by the 3-kW PV panel is 18.89 kWh.
It is worth noting that 78.31% of the solar energy generation occurs during the on-peak intervals, 15.67% occurs during shoulder-peak periods, and 6.02% occurs during off-peak intervals, which can potentially mitigate the cost by $0.66. As the selling price is considered 85% of the purchase price, the revenue of the end-user from selling energy to the grid would be $0.56.
However, saving in the electricity bill would vary with respect to the participation of the end-user in the DR program, the utilization of the battery, and also the energy consumption of the HVAC system. The simulation is done for two scenarios. In the first scenario, the end-user is willing to shift the operation time of the controllable loads and reduce the electricity bill as much as possible. It should be noted that it would not be possible to completely shift the loads supposed to operate over the on-peak intervals. Nevertheless, the reduction in the electricity bill is still substantial.
The electricity bill in this case is equal to 0.44 $/day. Fig. 5 illustrates the power consumptions of the fixed loads, controllable loads, and HVAC system. Moreover, the solar power generation, and charging and discharging power of the battery are shown in Fig. 5. It is noteworthy that the solar power generation and discharging power of the battery have been shown with a negative sign. As can be observed, a significant fraction of the controllable load has been shifted to the off-peak and shoulder-peak intervals. The battery also delivers power to the home during on-peak intervals, and it is charged during the initial hours of the day and late in the evening. In the second scenario, it is assumed that the end-user does not tend to shift the load demand. As a result, the operation statuses of the assets would be in accordance with Table 2.
The energy consumption of the HVAC system is approximately similar to that of the first case. As Fig. 6 shows, controllable loads are used mainly during on-peak and shoulder-peak time slots. On the other hand, the solar power generation reaches its maximum amount over the on-peak intervals. The battery also absorbs the surplus power generation with respect to the lower selling price, compared to the purchase price. Thus, the charging/discharging pattern of the battery would be a little different from the previous case.
If the total load demand is more than 3 kW, the battery discharges power to the system, and in case the power delivered by the battery is lower than the load demand of the end-user, the battery is charged. However, the HEMS sells the surplus power to the grid over on-peak time intervals, as it is economically justified. The electricity bill in this case would be $0.85. It is worth mentioning that the electricity bill will increase to $1.54 if there are no solar PV panel and battery. This cost can be reduced to $1.12 by applying the DR program. Consequently, installing the solar PV panel and a battery, besides participating in the DR program, would provide the end-user with the opportunity to pay the minimum amount for the electricity bill.

CVaR-Constrained Stochastic Self-Scheduling
In this case, the risk-based problem of stochastic self-scheduling of the HEMS is performed. In this respect, the model, proposed through relationships (2)- (21) and (22)- (26), is investigated. The objective of this case is to minimize the total cost, taking into account the risk of the incremental cost due to purchasing power over the on-peak time slots, and the end-user's discomfort. In this regard, a sensitivity analysis has been made on the penalty factor, , and the weighting factor of the CVaR, . Table 5 represents the obtained results, showing that raising the value of  would alleviate the risk due to load shifting.
Moreover, by increasing the penalty factor, related to the end-user's discomfort, the risk due to load shifting is reduced. It is noted that if =0.05, the DI would increase such that the end-user does not tend to shift the load demand. In this case, the cost would be minimized by optimally operating the battery.  Fig. 7 indicates the power consumed by the fixed loads, controllable loads, and the HVAC system in the risk-neutral state.
Since =0 in this case, any variation in the cost shows the tendency of the end-user to participate in the DR program. Hence, the reduction in the cost, resulting from the optimal operation of the battery and load shifting, has been investigated. The simulation results show that if the end-user intends to minimize the electricity bill by participating in the DR program, i.e., =0.00, a substantial fraction of the load demand would be shifted to the shoulder-peak and off-peak intervals at hours 7-9, and 21-24. If =0.01, the end-user is reluctant to shift the load demand during intervals 13-14, and accordingly, the cost would increase, proportionally. also be noted that the risk is due to purchasing power over the on-peak time intervals, and the end-user is willing to minimize the load shifting.
The amount of energy, stored in the battery for different scenarios, is illustrated in Fig. 9. In this regard, =0 and =0.00.
The optimal charging/discharging pattern of the battery is in a way that it absorbs power during the intervals with low prices, and it injects power to the system during time intervals 15-20 to supply the load demand. The energy stored in the battery reaches its maximum value over the hours with peak prices, since the solar power generation is considerably high. As a result, it is not needed to discharge the battery since the HVAC system is supplied by the PV system.

Conclusion
This paper investigated the self-scheduling problem of smart homes, both in deterministic and stochastic frameworks. The home appliances were modeled as fixed, controllable, and interruptible loads, and the operating pattern of each load was modeled as a binary string, facilitating the modeling procedure. The presented model was formulated as a MILP problem, seeking to minimize the daily energy bill of the consumer, while meeting the consumer's preferences for the operation of controllable and interruptible loads. In this respect, the inverter-based HVAC system was characterized as an interruptible load, supposed to keep the indoor temperature within the desired range. The energy price was also determined according to the TOU tariff. The optimization model was risk-oriented and represented based on the CVaR, while the objective function of the problem was promoted with respect to the risk due to the energy purchase and the prosumer's DI, resulting from load shifting. The flexibility of the prosumer to mitigate the operating costs was considerable due to the self-generation and strategic saving by the storage system. A sensitivity analysis was also carried out to optimally determine the capacity of the solar PV panel and storage system of the studied smart home. Afterward, the impacts of different parameters of the CVaR and optimization model on the total cost reduction and prosumer's DI were investigated. The obtained results showed that the HEMS could effectively result in alleviating the electricity bill of the prosumer by taking into account different parameters, related to the prosumer's DI, solar power generation, and the strategic energy storage system. Furthermore, the simulation results showed that the indoor temperature was within the permitted range for every scenario and case studies, and the energy consumption of the HVAC was associated with the minimum variation. In other words, the other appliances can be optimally operated, while maintaining the indoor temperature at a desired level. The sensitivity analysis carried out on the impact of parameters  and  on the DI, verified that any increase in these parameters would lead to a reduction in the expected DI of the prosumer. On the other hand, the electricity bill of the prosumer would increase. The main findings of this paper can be briefly stated as follows: (i) presenting an MILP model for the self-scheduling problem of the HEMS could lead to a computationally-efficient framework, resulting in the optimal solution; (ii) the self-scheduling capability, besides the strategic energy storage and transacting power with the utility grid, could effectively lead to mitigating the electricity bill; (iii) the electricity bill reduction mainly depends upon shifting controllable loads; also, the interruptible load had a relatively fixed performance in different scenarios, while maintaining the indoor temperature at a desired level; (iv) the HEMS could efficiently alleviate the electricity bill of the prosumer through optimally scheduling the charging/discharging plans of the EV and other controllable and interruptible loads.