Two-Stage Energy Management Strategy of EV and PV Integrated Smart Home to Minimize Electricity Cost and Flatten Power Load Proﬁle

: The efﬁcient use of the incorporation of photovoltaic generation (PV) and an electric vehicle (EV) with the home energy management system (HEMS) can play a signiﬁcant role in improving grid stability in the residential area and bringing economic beneﬁt to the homeowner. Therefore, this paper presents an energy management strategy in a smart home that integrates an electric vehicle with/without PV generation. The proposed strategy seeks to reduce the household electricity costs and ﬂatten the load curve based on time-of-use pricing, time-varying household power demand, PV generation proﬁle, and EV parameters (arrival and departure times, minimum and maximum limit of the state-of-charge, and initial state-of-charge). The proposed control strategy is divided into two stages: Stage A, which operates in three operating modes according to the unavailability of PV power generation, and Stage B, which operates in ﬁve operating modes according to the availability of PV generation. In this study, the proposed strategy enables controlling the amount of energy absorbed by the EV from the grid and/or PV and the amount of energy injected from the EV to the load to ensure that the household electricity costs are minimized, and the household power load proﬁle is ﬂattened. The ﬁndings show that both household electricity costs reduction and ﬂattening of the power load proﬁle are achieved. Moreover, the corresponding simulation results exhibit that the proposed strategy for the smart home with EV and PV provides better results than the smart home with EV and without PV in terms of electricity costs reduction and power load proﬁle ﬂattening.


Introduction
Fossil fuel shortage and the increase of environmental pollution caused by the transport and power sectors have become serious global issues [1,2]. Therefore, the need for a more effective way to reduce fuel dependency and environmental pollution reduction has led to the emerging of renewable energy technologies and electric vehicles (EVs) in the power and transport sectors, respectively [3][4][5]. However, production instability of variable renewables such as wind power and solar photovoltaics and intermittent charging patterns of EVs can lead to several problems in the power grid such as growing demand peaks, voltage fluctuations, high load variability, and over-generation [6,7]. These challenges require effective energy management to adapt between electric vehicles charging patterns and renewable energy generation [8,9]. As a result, recent studies have focused on developing effective energy management to integrate renewable energy and EVs into homes and grid. With the advent of the smart grid concept and thanks to bi-directional communication technologies provided by was designed for a smart home equipped with a rooftop photovoltaic system, electrical appliances, ESS, and EV to reduce electricity costs [23].
Considering the valuable contributions introduced by the studies mentioned above, however, it is notable that the integration of the home energy management system (HEMS) with PV and EV focused on reducing the energy cost ignored the importance of flattening the load curve. The studies that focused on reducing energy cost and flattening the load curve has not included PV generation as part of its system. Besides, some literature focused on flattening the load curve by charging the electric vehicle to fill the valley and discharging to shave the peak load based on the daily household load curve only and ignoring the change of electrical price with time, and this will lead to an increase in the electric energy costs at the home. Therefore, it is interesting to develop a novel energy management strategy for a smart home equipped with an electric vehicle EV and PV. The main objective is to control the amounts of energy flow to/from electric vehicle flexibly to minimize the electricity cost and flatten the load curve with satisfying the system power requirements. As the main contribution of this study, the system is monitored through two stages, each stage activated by several modes according to the following restrictions: daily PV power generation profile, real-time price signal, daily power load curve for household appliances, arrival and departure time of electric vehicle, and minimum and maximum limit state-of-charge of the electric vehicle battery.
The proposed strategy is applicable for any home equipped with PV and EV which can bring economic benefits to the homeowner and can provide support for the residential area grid by charging the EV from the grid and PV generation when the electricity price and consumption are low and PV generation greater than the load to be covered by PV generation respectively. Besides, the energy stored from the grid and PV in EV battery can be used later at peak time.
This paper discusses the home energy management system (HEMS); it is the most important issue that helps to reduce electricity costs, enhance the energy efficiency, and flatten the load curve. The main advantage of the proposed strategy lies in the flexibility of the power flow from grid-to-vehicle (G2V), PV-to-vehicle (PV2V), and vehicle-to-home (V2H). Indeed, the control of EV charge/discharge and EV utilization as energy storage provides the possibility of transmitting valley electricity and PV generation to the peak hours through the vehicle-to-home (V2H), which is one of the modern technologies that help decrease electricity cost and flatten the load curve.
The remaining of the paper is arranged as follows: Section 2 presents the studied system description and modeling. The proposed home energy management strategy is illustrated in Section 3, and the economic analysis is detailed in Section 4. Simulation results are discussed in Section 5. Finally, Section 6 elaborates the conclusion of this paper.

System Description
The schematic representation of the smart home is shown in Figure 1, which consists of household appliances, an electric vehicle (EV), a photovoltaic system (PV), daily load curve, daily solar insolation curve, daily price signal, grid utility, smart meter, and HEMS to manage and control the power flow among the utility grid, PV, household appliances, and EV. The smart home term in this study indicates that the home can provide two-way data communication and bidirectional power flow, which conforms to the smart grid concept.

Solar Photovoltaic Panel
The PV cells convert the sunlight (photons) into electrical energy through a photovoltaic effect. Then, the PV cells are connected in series or/and parallel to obtain the required value of the current and voltage at PV panel output [24]. The relation between the PV cell current I pv and voltage V pv can be represented in Equation (1) [25].
where I pc is the photovoltaic current (A), I s is the reverse saturation current of the cell (A), q is the electron charge (1.602 × 10 −19 C), n is the ideality factor of the cell, k is the Boltzmann constant (1.381 × 10 −23 J/k), T is the operating temperature (K), N s is the number of PV cells connected in series, R se is the series resistance of cell (Ω), and R sh is the shunt resistance of cell (Ω). The photovoltaic sizing can be described by Equation (2) [26].
where L d is the load to be covered by PV generation (kWh); I d is the peak sun shines hours, which is equal to 5.7 h per day in the target region; and d is the de-rating factor, which is assumed to be equal to 85%.

Electric Vehicle Modeling
Recently, lithium-ion batteries (Li-ion) have become commonly used in hybrid electric vehicles (HEVs) and electric vehicles (EVs) due to their high specific energy, high energy density, low rate of self-discharge, safety, high capability in the rate of charge and discharge, and long lifetime compared to other types of batteries [27]. Thus, in this study, we used an electric vehicle equipped with a Lithium-ion battery called Chevrolet Spark EV. The battery can be modeled and expressed as in Equation (3) [28].
where V batt is the terminal voltage of the battery (V); V oc is the battery open-circuit voltage (V); R i is the internal resistance (Ω); i batt is the actual load current of the battery (A), which is negative at the charge and positive at discharge; and V D is the voltage drop due to polarization process (V) or polarization voltage. The battery state of charge SOC (%) can be described by Equation (4), which is called the ampere-hour integral (Coulomb counting) [29].
where SOC 0 (%) is the initial state of charge, C N is the rated capacity (Ah), and η is the Coulomb efficiency. According to EV battery capacity constraints, SOC will change due to charge from the grid and PV or discharge to feed the load. Then, SOC can be reformulated as defined in Equation (5).
where SOC (t) represents the state of charge at the time t, I PVEV (t) represents the current from the PV-to-vehicle, I GEV (t) represents the current from the grid-to-vehicle, and I EVL (t) represent the current from the vehicle-to-load. The deep charge/discharge cycles are minimized to extend the battery lifespan by setting a minimum and maximum limit for the state of charge [30]. Therefore, to prevent over-charge/discharge of the EV battery, SOC (t) is set by following constraint as defined in Equation (6).
where SOC min and SOC max are the minimum and maximum limit for the EV battery state of charge, respectively.

Household Load Demand
Consider a typical home with a group of appliances used in normal daily life at the house, such as CFL lamps, refrigerators, fans, air conditioners, televisions, cooking appliances, washing machines, etc. These devices consume electricity throughout the day, creating a daily load curve. The daily household appliances power demand can be calculated by the sum of all power consumed by the household appliances during the typical day, as defined in Equation (7) [31]. It is so hard to have a real load profile during the year time. Thus, the designers use the daily averages load for one day. Furthermore, other forecasting techniques can also be used, for example ANN, which can predict the load during a specific time [32]. The U.S. energy information administration (EIA) has collected hourly electricity consumption data in near-real-time from balancing authorities in the lower 48 states since 2015 [33]. They found that the household consumes a low amount of electricity during the night period, while there is high electricity consumption in the morning and evening. Therefore, the studied house is expected to consume high electricity during morning and evening, and low during the night, as depicted in Figure 2.
where W A represents the total energy consumed by the home appliances in the typical day (kWh), and P L (t) is the energy consumed by the home appliances in time slot t in (kW).
In this paper, it is assumed that the EV is a new load to be added to the studied home load. Thus, the average power of the studied home can be calculated as follows where P avg is the average energy consumed by appliances and vehicle (kW) and W ev is the energy required for the electric vehicle trip (kWh). The energy required for EV trip can be defined by Equation (9) [34].
where η V is specific consumption (kWh/km) and D is the trip distance of the vehicle (km). The typical household load curve can be divided into two parts: load above the average load line and the load under the average load line ( Figure 2). In this study, if the sum of load above the average load line divided by ((I d ) peak sun shines hours multiplied by (d) de-rating factor) is less than or equal to the base load of the home, the PV size will be scaled to cover the total load above the average load line. If the sum of load above the average load line divided by ((I d ) peak sun shines hours multiplied by (d) de-rating factor) is greater than the base load of the home, the PV size will be scaled to be equal to the basic load of the home. Therefore, in this study, the electricity cannot be sold to the grid from the PV due to the PV generation being less than or equal to the home base load. The load to be covered by the PV generation can be calculated as follows.
where P B is the base load of the home in kW (continuous load), which represents the minimum electrical demand amount needed during the period of 24-h time.

Proposed Energy Management Strategy for Smart Home Integrated with EV, and PV
Energy management strategies can play an important role in minimizing both electricity costs and the load power curve variance of the homes integrating PV and EV. In this context, this study investigates an energy management strategy for a smart home equipped with EV and PV. The proposed strategy illustrated in Figure 3 allows the power flow from grid-to-vehicle (G2V), PV-to-vehicle (PV2V), and vehicle-to-home (V2H) to minimize daily electricity cost and flattening the power load curve in the smart home. The proposed control strategy consists of two stages: Stage A, which operates in three operating modes according to the unavailability of PV power generation (PV power equals zero), and Stage B, which operates in five operating modes according to the availability of PV power generation (PV power greater than zero). The key function of this strategy is to control the EV charge and discharge times, control the amount of energy that must be absorbed from the grid and/or PV by EV, and the amount of energy that must be injected into the load demand from EV. That will help to reduce the electricity cost and maintain the load curve within the limits of the average load, as well as optimize energy use through achieving the following objectives:

•
Determine the low and high periods of electricity price.

•
Detect the high and low electricity consumption periods in the studied home.

•
Reduce the electricity cost and fill the valley thanks to charging EV from grid utility when the electricity price is low and electricity consumption is low simultaneously.

•
Control the state-of-charge of electric vehicle battery to prevent the overcharge and over-discharge during charging and discharging, respectively.

•
Determine the periods of a negative correlation among PV generation and the load that must be covered by PV generation to charge the electric vehicle from the surpluses PV generation.

•
Reduce the peak load thanks to electric vehicle discharge to feed the load demand during the peak load period.
The Load demand supplied from PV

PPVL(t)=Ppv (t) & from EV PEVL(t)=(PL(t)-Pavg)-PPVL(t) and the load demand is changed PLnew(t)=PL(t)-(PEVL(t)+PPVL(t))
PV power supplied load To realize the objectives mentioned above, the proposed strategy receives the following information as inputs: the daily photovoltaic power generation profile P pv (t), time-of-use price signal C (t), daily load demand profile P L (t), average power load P avg , average price signal C avg , the arrival time of EV T in , departure time of EV T out , initial state-of-charge of the EV battery SOC (t), maximum state-of-charge SOC max , and minimum state-of-charge SOC min . After that, the power is managed in two stages.

Stage A
When the PV power generation is equal to zero P pv (t) = 0, Stage A will operate to manage the power in three operating modes as follows:

Mode 1
In this mode, the EV will not charge/discharge. This mode is activated through activating one of four cases: (i) the EV is not at home; (ii) the EV is at home, the power load demand P L (t) is less than the average load P avg , the electricity price C (t) is less than the average price C avg , and EV battery SOC has reached its SOC max (EV battery fully charged); (iii) the EV is at home, power load demand P L (t) is less than average load P avg and electricity price C (t) is greater than or equal to average price C avg ; or (iv) the EV is at home, power load demand P L (t) is greater than or equal to the average load P avg and EV SOC has reached its SOC min (EV battery completely discharged). Therefore, the power load demand is unchanged as in Equation (11).
where P Lnew (t) is the new amount of power consumed from the grid (kW).

Mode 2
This mode is detected if the EV is available at home, power load demand P L (t) is less than the average load P avg , the electricity price C (t) is less than the average price C avg , and the EV battery SOC is less than SOC max . Therefore, the EV is charged from the grid to fill the valley as defined by Equation (12), and the power load demand curve is changed according to Equation (13).
P Lnew (t) = P L (t) + P GEV (t) (13) where P GEV (t) is the amount of power drawn from the grid to charge the electric vehicle (kW).

Mode 3
In this mode, the EV is at home, the power load demand P L (t) is greater than or equal to the average load P avg , and the EV battery SOC is greater than SOC min . Thus, the EV is discharged to shaving the peak load demand as calculated by Equation (14), and the power load demand curve is changed as defined in Equation (15).
where P EVL (t) is the amount of power drawn from the electric vehicle to feed the load (kW).

Stage B
When the PV generation is higher than zero P pv (t) > 0, Stage B will operate to manage the power in five operating modes as follows:

Mode 4
In this mode, the EV will not charge/discharge, and the PV power is injected into load demand. This mode is activated through activating one of five cases as follows: (i) the EV is not at home; (ii) the EV is at home, power load demand P L (t) is less than the average load P avg , electricity price C (t) is less than the average price C avg , and the EV battery SOC has reached its SOC max (EV battery fully charged); (iii) the EV is at home, power load demand P L (t) is less than average load, electricity price C (t) is greater than or equal to average price C avg , and the EV battery SOC has reached its SOC max (EV battery fully charged); (iv) the EV is at home, power load demand P L (t) is greater than or equal to average load P avg , PV power P pv (t) greater than the power load demand minus the average load P L (t) − P avg and the EV battery SOC has reached its SOC max (EV battery fully charged); or (v) the EV is at home, power load demand P L (t) is greater than or equal to the average load P avg , PV power P pv (t) less than or equal to the power load demand minus the average load P L (t) − P avg , and the EV battery SOC has reached its SOC min (EV battery completely discharged). Therefore, the PV power is supplied to load demand as in Equation (16), and the power load demand curve is changed according to Equation (17).
where P PVL (t) is the amount of power drawn from the PV to feed the load (kW).

Mode 5
In this mode, the EV is at home, the power load demand P L (t) is less than the average load P avg , the electricity price C (t) is greater than or equal to the average price C avg , and the EV battery SOC is less than SOC max . Therefore, the EV is charged from the PV only due to the high electricity price, it can be expressed by Equation (18). The power load demand is unchanged according to Equation (11). P PVEV (t) = P pv (t) (18) where P PVEV (t) is the amount of power drawn from the PV to charge the electric vehicle (kW).

Mode 6
This mode is operated if the EV is at home, power load demand P L (t) is less than the average load P avg , the electricity price C (t) is less than the average price C avg , and EV battery SOC is less than SOC max . In this case, the EV should be charged from the grid and PV to fill the valley and transfer the PV to peak hours. The modified load demand, power flow from PV-to-vehicle, and grid-to-vehicle are expressed by Equations (13), (19) and (20), respectively.

Mode 7
Mode 7 is activated when the EV is available at home, power load demand P L (t) is greater than or equal to the average load P avg , PV power P pv (t) is greater than power load demand minus the average load P L (t) − P avg , and the EV battery SOC is less than SOC max . In this mode, load demand and EV are fed from PV power. The power flow from PV-to-load, PV-to-vehicle, and modified power load are expressed as in Equations (21)-(23), respectively. P PVL (t) = P L (t) − P avg (21) P PVEV (t) = P pv (t) − P PVL P Lnew (t) = P L (t) − P PVL (23)

Mode 8
Mode 8 is selected when the EV is at home, power load demand P L (t) is greater than or equal to the average load P avg , PV power P pv (t) is less than or equal to power load demand minus the average load P L (t) − P avg , and the EV battery SOC is greater than SOC min . In this mode, the EV is discharged to feed the load demand. The power flow from PV-to-load, vehicle-to-load, and modified power load are expressed as in Equations (24)-(26), respectively.

Proposed Energy Management Strategy for Smart Home Integrated with EV without PV
The proposed strategy for managing energy in the smart home equipped with EV and PV, shown in Figure 3, can also be employed to manage the energy in a smart home equipped with EV only. The proposed strategy receives the time-of-use price signal, daily load demand profile, average power load, average price signal, the arrival time of electric vehicle, departure time of electric vehicle, initial state-of-charge, the state-of-charge of the electric vehicle battery, maximum state-of-charge, and minimum state-of-charge as inputs. Then, the power is managed in Stage A of proposed strategy throughout the day, which operates in the first three modes only, as explained in Section 3.1.1.

Economic Analysis
In this section, three different cases are considered for a cost-benefit analysis to measure the profitability of proposed energy management strategy (EMS) for smart home includes PV and EV.

Case A: Home Equipped with EV and without EMS
In this case, the grid supplies the load demand, and the EV is considered as an electrical load at home, which is charged from the grid in the uncontrolled regime. Therefore, the total daily electricity costs can be calculated as follows.
where C A total is the total daily electricity cost of Case A in $/day and C (t) is the electricity price in $/kWh.

Case B: Home Equipped with EV and EMS
In this case, the EV is considered as energy storage. The energy is stored by charging the EV at off-peak period associated with a low price, and the V2H mode is used to supply the load at peak period, which contributes to reducing the total daily electricity costs. Thus, the equations obtained when the proposed strategy is employed to manage the energy in a smart home equipped with EV and without PV, as discussed in Section 3.2, were used to calculate the total daily electricity cost at home as follows.
where C B total is the total daily electricity cost in $/day.

Case C: Home Equipped with EV, PV, and EMS
In this case, household Load demand is fed from the grid and PV beside EV through V2H mode. The EV is charged from the grid at the off-peak period associated with a low price and charged from the PV when the PV power is greater than the power load that required to be covered by PV power. Moreover, the EV discharges to feed the load during peak period, which will contribute to minimizing the total daily electricity costs. Thus, the equations obtained when the proposed strategy is employed to manage the energy in a smart home equipped with EV and PV, as discussed in Section 3.1, were used to calculate the total daily electricity cost at home as follows.
where C C total is the total daily electricity cost in $/day and PV day C is the PV installation cost per day in $/day.
The total PV cost includes the total capital cost and operational and maintenance costs, which can be represented by Equation (30) [35].
where PV TC is the total PV cost in $/kW; PV cap is the total PV capital cost in $/kW, which includes system hardware (module price, inverter price, electrical BOS, and structural BOS), direct labor (electrical, mechanical, and general construction), indirect labor (design, engineering, and permitting), supply chain, overhead, and margin; and PV om is the operational and maintenance cost in $/kW-year and also includes the inverter replacement cost. The annual cost concept is used to convert the non-annually PV capital cost to annually PV capital cost as in Equation (31) [35].
where PV capann is the annual PV capital cost in $/kW-year, r is the annual interest rate in percent, and N is the lifetime of the system in years. Then, the total PV cost becomes annually as described by Equation (32).
PV TCann = PV capann + PV om (32) where PV TCann represent the annually total PV installation cost in $/kW-year. In this paper, the objective is to reduce electricity costs within 24 h or minimize total daily electricity costs at home, so the annual cost of solar photovoltaic must be converted into a daily cost to be combined with the other daily costs. The annual cost PV TCann is converted into daily cost PV day C as expressed by Equation (33) [36].
where R C represent the rated capacity of the PV system in kW.

Results and Discussion
The simulation was carried out to verify the performance and effectiveness of proposed strategy regarding the cost reduction and flatness of the load demand curve. In this study, the computerized horizon is set to 24 h. Solar data are taken from [37], which provides the solar irradiation and temperature data from 1981 up to date of accessed on 1 August 2020. For simplicity, the solar data were used over the past five years to evaluate the average output profiles, which can be predicted as in Figure 4. Figure 5 depicts the real-time pricing signals [38], which is based on the residential TOU rates of Southern California Edison (SCE). This figure depicts the electricity price curve with Time-of-use in differentiated periods, in the range 12-40 cents/kWh, with an average price of 24 cents/kWh, which was calculated by summation of the electricity price during the day and dividing it by 24 h in this study. It motivates the homeowners to charge their electric vehicle in the off-peak period (cheap electricity price) and the EV battery discharge to feed load demand in the peak period to achieve economic benefits.
The EV parameter settings are presented in Table 1. The most suitable level for charging the electric vehicle at home is 1.5-3 kW [39]. In this study, the EV daily travel distance is considered the same as the average daily driving in the U.S. according to the U.S. department of transportation, the average daily driving in the U.S. is 40 miles [40].
Moreover, it is assumed that the EV leaves home at 8:00 and arrives home at 12:00, and leaves home for the second time at 14:00 and arrives home at 17:00. The economic parameters associated with the PV system used in this study are presented in Table 2. In the first quarter of 2020, the total capital cost of the U.S photovoltaic system decreased to $2.83 /watt in the residential sector [41]. While the solar Investment Tax Credit (ITC) in the residential sector represents 26% of the total capital cost for projects that started in 2020 [42], the operational and maintenance cost and interest rate were taken from [43].     As shown in Figure 6, the system is operated in Stage A during the time intervals 00:00-06:00 and 18:30-24:00, while, during the time interval 06:00-18:30, the system is operated in Stage B. Figure 7 explains different modes when the proposed strategy is used to control the energy in a smart home equipped with EV without PV. Figure 7 shows that the system is operated in Modes 1, 2, and 3 during the whole day, which means that the system is operated in Stage A only.  Figure 7. Different operation modes achieved by the proposed strategy when used to manage the energy in a smart home equipped with EV without PV. Figures 8 and 9 show an electric vehicle battery state-of-charge curve when the proposed strategy is used to manage the energy in a smart home equipped with EV and PV and a smart home equipped with EV without PV, respectively. Figures 8 and 9 confirm that the battery is in charging and discharging modes, in addition to proving that the state-of-charge is within the upper and lower limits during charging and discharging operations.   19:55 indicate that the EV is discharged to feed the load. Periods 08:00-12:00 and 14:00-17:00 indicate that the EV is outside the home, thus the EV is not charged or discharged. Furthermore, the no change in the EV power curve in the period 19:55-21:06 indicates that the power load demand is less than the average load, and the electricity price is greater than or equal to the average price, so the EV is not charged or discharged.   Figure 10. EV charging and discharging power profile when the proposed strategy is used for managing the energy in a smart home equipped with EV and PV. Figure 11 shows the electric vehicle power curve when the proposed strategy is used for managing the energy in a smart home equipped with EV without PV. The negative powers in periods 00:00-04:30, 06:48-07:38, and 21:06-24:00 indicate that the EV is charged from the grid. The positive powers in periods 04:30-06:48, 07:38-08:00, and 17:00-18:45 indicate that the EV is discharged to feed the load. The time intervals 08:00-12:00 and 14:00-17:00 indicate that the EV is outside the home. No change in the EV power curve in periods 12:00-14:00 and 19:55-21:06 indicates that the power load demand is less than the average load, and the electricity price is greater than or equal to the average price, so the EV is not charged. The no change in the EV power curve in period 18:45-19:55 indicates that the power load demand is greater than or equal to the average load, but the EV battery SOC has reached its SOC min , so the EV is not discharged to feed the load. From Grid to EV From EV to Load EV Unavailable at Home Figure 11. EV charging and discharging power profile when the proposed strategy was used for managing the energy in a smart home equipped with EV without PV. Figure 12 displays power load curve without the EMS, the power load curve with EV and EMS, and the power load curve with EV, PV, and EMS. Figure 12 shows that the power load curve is flattened in the cases of power load curve with EV and EMS and with EV, PV, and EMS compared to the power load curve without the EMS. However, it is worth noticing that, in the case of using the proposed strategy for managing the energy in the smart home that includes EV and PV, the power load curve is smoother than the case in which the proposed strategy is used to manage the energy in the smart home that includes EV but not PV. The household daily electricity cost is calculated in the three cases mentioned in Section 4. The daily household electricity cost of the three cases are presented in Figure 13. Figure 13 shows that the daily electricity cost is decreased in both Cases B and C compared to Case A. However, it is noticed that the daily electricity cost in Case C is less than the daily electricity cost in Case B, due to the use of PV in Case C. The proposed strategy was compared with other strategies in the existing literature [17,21]. Authors in [17] presented an algorithm for controlling the charging/discharging of EVs in a home that focused on flattening the load curve depending on the daily load curve of household appliances only without taking into account time-varying electricity price. The control algorithm focused on reducing grid stress only and ignored the cost reduction for the homeowner. Authors in [21] introduced a control model based on stochastic optimization in the smart home with PV and EV that focused on reduce consumer energy charges while the flattening of the load curve was ignored. It is worth noting that all the aspects that were not covered in [17,21] are considered in this study.

Conclusions
In this study, an energy management strategy for a smart home that integrates EV and PV was proposed to minimize the household electricity costs and flatten the household power load curve. Eight different modes of the energy management strategy were developed, divided into two stages: Stage A, which operates in three modes depending on the unavailability of PV generation (i.e., PV power is equal to zero), and Stage B, which operates in five modes depending on the availability of PV power (i.e., PV power is greater than zero). EV parameters, time-of-use pricing, time-varying household power demand, and PV generation profile were used as inputs to the proposed strategy to ensure that both electricity costs and the load power curve variance were minimized while satisfying the system power requirements.
The corresponding simulation results show that, by using the proposed energy management strategy in a smart household containing EV with/without PV, the power load curve is flattened compared to the power load curve without using the proposed energy management strategy. Furthermore, the daily electricity costs were analyzed for the smart home integrated EV with/without PV generation under the proposed strategy, compared to a smart home equipped with EV and without PV generation under the regime of uncontrolled EV charging. It was found that the proposed control strategy can bring significant economic benefits to the homeowner, where the daily electricity costs were reduced from $ 32.7/day to $ 28.1/day through using the proposed strategy for the smart home equipped with EV without PV and to $ 26.4/day by using the proposed strategy for the smart home equipped with EV and PV.
Finally, it can be concluded that the proposed strategy for the smart home with EV and PV provides better results than the smart home with EV and without PV in terms of electricity costs reduction and power load profile flattening.

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