Home Energy Management Considering Renewable Resources, Energy Storage, and an Electric Vehicle as a Backup

: The vehicle-to-grid concept emerged very quickly after the integration of renewable energy resources because of their intermittency and to support the grid during on-peak periods, consequently preventing congestion and any subsequent grid instability. Renewable energies offer a large source of clean energy, but they are not controllable, as they depend on weather conditions. This problem is solved by adding energy storage elements, implementing a demand response through shiftable loads, and the vehicle-to-grid/vehicle-to-home technologies. Indeed, an electric vehicle is equipped with a high-capacity battery, which can be used to store a certain amount of energy and give it back again later when required to fulﬁll the electricity demand and prevent an energy shortage when the main-grid power is limited for security reasons. In this context, this paper presents a comparative study between two home microgrids, in one of which the concept of vehicle-to-home is integrated to provide a case study to demonstrate the interest of this technology at the home level. The considered microgrid is composed of renewable energy resources, battery energy storage, and is connected to the main grid. As the vehicle is not available all day, in order to have consistent results, its intervention is considered in the evening, night, and early morning hours. Two case studies are carried out. In the ﬁrst one, the vehicle-to-home concept is not taken into account. In this case, the system depends only on renewable resources and the energy storage system. Subsequently, the electric vehicle is considered as an additional energy storage device over a few hours. Electric vehicle integration brings an economic contribution by reducing the cost, supporting the other MG components, and relieving the main grid. Simulation results using real weather data for two cities in France, namely Brest and Toulon, show the effectiveness of the vehicle-to-home concept in terms of cost, energy self-sufﬁciency, and continuity of electrical service.


Introduction
Vehicle-to-grid (V2G) could be considered as the biggest technological advancement since renewable energy resources (RER) became commercially viable [1]. With more than 3 million EVs worldwide [2], these EVs are used only about 5% of the time; the rest of the time they are parked when the owners are working or at home [3]. EVs can be used for a secondary role during the 95% of available time. Indeed, electric vehicles (EV) with a large battery can recover energy produced by RER, which would otherwise be lost. In this case, the EV functions as a secondary storage system. In the opposite case, where production is low, the storage systems and the main grid intervene by sending the missing energy, to achieve the production consumption balance. This demand for energy can overload the grid and cause blackouts or voltage and frequency drops. To relieve the grid, the energy it supplies can be limited to a certain amount, the rest being supplied by the EV as it discharges. In some cases, for same precedents reasons, it can be possible to sell the energy four study cases: two during the week with different weather data, and two during the weekend, with different vehicle states of charge. They find that the energy cost decreases significantly in the cases where the RERs are productive. The presence of the vehicle at home during the weekend is very cost effective due to its high storage capacity. In [27], Harun and Seddik developed seven optimal strategies studied on 1000 use cases and with four different daily energy price profiles in order to reduce the vehicle charging cost. A V2G algorithm named Optimal Logic Control based on series of logic commands has been developed. The results show the advantage of this algorithm over the traditional optimal charging strategies available in the literature. The algorithm is mainly made to be very efficient when the selling price/purchase ratio is greater than one, allowing the user to earn money. In [28], Sausen et al. proposed a model for coupling an EV to a smart home containing PV and batteries, having the objective of achieving cost minimization that was conditional on maximizing vehicle efficiency. Four scenarios are considered: in the first one, uncontrolled EV charging was adopted; in the second one, economic charging was applied; in the third one, economic EV charging was adopted, including distributed generation; and in the fourth one, economic EV charging was considered, with distributed generation and V2H operation. The results show that the peak consumption has been reduced thanks to the intervention of the EV and the bill has been decreased. In [29], Xuan et al. proposed a strategy to extend the lifetime of the batteries, such that the batteries operate when there is a surplus of RER production and when electricity prices increase during peak hours. The results show the effectiveness of this strategy, as when the battery discharge cost is higher than the market energy price, no power is supplied by the batteries, and conversely, when the discharge cost is lower than the market energy price, the power demanded is first supplied by the batteries, then, if the load is very high, the grid is allowed to supply the remaining load.
There is a lot of literature on V2G, but the V2H concept is not thoroughly addressed, as most research studies focus on the interaction of electric vehicles with the electric grid. Additional research is needed to address the cost of implementing the V2H concept and its profitability. In this context, this paper presents a sizing and optimization study of a MG operating in a grid-connected mode at the home level. The MG is composed of PVs and WT as RER, a battery as ESS, and a domestic load. The EV is used as a secondary energy storage device, which allows for the enhancement of the overall MG performance. This study concerns two aspects that are related to MG optimal sizing and smart day-ahead energy management. Two case studies are considered in this paper: a first grid-connected MG with only RERS and ESS is investigated; next, a second grid-connected MG with the integration of RERs, ESS, and an EV is implemented and the results are compared. An economic study is performed to investigate the advantages offered by the use of the EV and the interest of V2H technology in terms of energy supply reliability, cost reduction, and grid support during congestion periods. Simulation results are presented using actual weather data from two cities, which are Brest (cold climate) and Toulon (hot climate) in France. Generally speaking, the contributions targeted in this work are threefold: • Optimal sizing of a home MG considering actual weather data, energy price, EV batteries as a secondary ESS and limiting the grid power for enhancing the energy self-consumption; • Energy management system taking into account the availability of the EV; • Investigate the economic profitability of V2H for the users by considering the electric vehicle as backup in order to mitigate the grid congestion.
This article is organised as follows: Section 2 presents the proposed MG architecture, presenting the used renewable energy resources and energy storage devices. Section 3 describes the MG optimal sizing and energy management considering two aspects, which are optimal energy dispatching and economic viability. Section 4 discusses the simulation results for the two considered case studies for two different cities in France. Finally, Section 5 concludes this paper and gives some perspectives for future work.

Microgrid Architecture
A home microgrid, which implements the V2H concept, is designed for the relief of main grid constraints. The MG is operated in grid-connected mode and consists of PV, WT, battery energy storage, and an EV. The architecture of the MG is presented in Figure 1. All components are linked to the DC bus through DC/DC converters (PV, batteries, and EV) or AC/DC converters (WT and grid). The PV and WT produce a quantity of energy depending on weather conditions, which does not always match the load demand. There are two possible scenarios: energy production is insufficient or, conversely, there is surplus energy generation. Energy storage and the main grid allow for the buffering of insufficient or excess power generation. Indeed, the battery and grid can restore the production/consumption balance by supplying the lack of energy or, conversely, by absorbing excess energy. Since the energy absorbed/fed by the battery is limited by its SOC and its maximum power, and since grid power can also limited, an EV can be used as an additional backup energy storage. Indeed, an EV can be charged through public charging stations or when parked at home. In order to support the grid and ensure the continuity of electricity supply, it can have a bidirectional energy exchange with the home MG.

Home MG Components
The choice of MG components is based on the maturity of the distributed energy resources (DER) and the efficiency of the ESS. Currently, the most mature RER is PV, which is the most mastered and used by researchers in projects aiming to achieve autonomous systems, relieve the grid, or produce clean energy. The PV used in this project is monocrystalline panels, which are suitable for cold climates, while polycrystalline panels are more suitable for warm climates [30]. A domestic wind turbine is the second mature renewable technology, known as an individual wind turbine [30]. WT is mainly installed at small-scale residential customers. It can also be used to power larger loads, such as small businesses and agricultural fields. The interest of this installation is to satisfy a part of the load, reducing the dependence on the power grid. Two classes of these wind turbines can be distinguished: vertical-axis wind turbines and horizontal-axis wind turbines. In the considered MG, the installed wind turbine is a horizontal-axis configuration with three blades, a drive train consisting of a gearbox and a generator, and a tower to support the rotor.
The considered battery in this study is a lithium-ion battery. It is lighter than a leadacid battery (five times lighter), has a long lifespan (1500 cycles), and is more resistant to deep discharges. New trends in the use of batteries for energy systems focus on integration with multiple RERs (PV, WT, etc.) and also on the integration with other energy storage systems that complement them [31]. This trend fits perfectly with the proposed MG, which includes PV and WT as well as an EV as an additional energy storage device.
The installed PV and WT maximum power and battery capacity are unknown and are computed by the optimisation program based on the load data, weather data, grid energy cost, renewables and battery investment cost, battery power limits, grid power limits, and battery capacity of the EV. Subsequently, an optimal energy dispatching is computed, which determines the power flows between all components within the battery power and capacity limits, grid limits, RER availability, and EV displacement, considering the economic aspects.

Modeling of the Renewable Resources and Energy Storage Devices
PV panels and wind turbines are considered as energy resources in this study. The following subsections describe these renewable resources modeling for optimal sizing and smart energy management.

PV Panels
The power generated by the PV panels depends on the installed maximum power and weather conditions. The PV output power depends on the irradiance, the efficiency of the generation, the area of the panels and the optimal orientation depending on the location. The chosen PV technology has an efficiency η pv = 15%. The power produced by PV over a day is given as follows: where: • S PV is the PV panels area in m 2 ; • P Irr (t) corresponds to the irradiance in the considered location W/m 2 ; • η PV stand for the chosen PV technology efficiency.

Wind Turbine
A wind turbine has an output power that mainly depends on its radius and the wind speed in the considered area. The other variables are constants, such as air density (ρ = 1.225 kg/m 3 ), or can be considered as constants by setting them to a value given by the control algorithm by implementing maximum power point algorithm (MPPT), such as the power coefficient (C p = 0.4). The electrical power extracted by a wind turbine is as follows: where: • R WT is the wind turbine radius in m; • V Wind corresponds to wind velocity, in m/s.

Energy Storage Devices: Battery and EV
The energy supplied by the battery and the EV depend on their capacity and their state of charge (SOC). Moreover, the output power is limited to enhance the lifespan of energy storage devices. The SOC represents the ratio between the energy contained in the battery (respectively, EV battery) and its maximum capacity (respectively, EV battery capacity). The SOC of the battery (respectively, EV battery) depends on the power supplied or recovered by the battery (respectively, EV battery), the time of application of this power (δt = 1 h), and its maximum capacity (respectively, EV battery capacity). The SOC varies from one hour to another and can increase during charging and decrease during discharging. The SOC for both the battery and the EV battery is given by the following formula: where: • SOC bat (t) and SOC EV (t) correspond to battery and EV battery state of charge at time t; • P bat (t) and P EV (t) stand for power of battery and EV battery. This power can be either positive or negative depending on the operation conditions; • E max bat and E max EV are the maximum battery and EV energy capacity.

Optimal Sizing and Planning of a Home MG with V 2H Technology
A domestic MG with V2H concept optimization is carried out in two steps, which are the optimal sizing and the energy management system (EMS), as shown in Figure 2. MG sizing is performed based on the weather data, the market energy cost, and the investment cost, all while fulfilling the technical constraints. Next, an optimal energy management algorithm is proposed considering that the home MG is optimally designed. In this section, the objective of the proposed energy management system is presented, which is mainly related to the sizing and the minimisation of the energy cost over 20 years of operation of the MG while integrating the V2H technology.

Energy Management Strategy
The objective in this work is to achieve a V2H system with maximum autonomy and minimum energy cost. Figure 3 shows the scheme of the proposed energy management algorithm. Five different layers can be distinguished in this energy management strategy. Indeed, in order to ensure maximum autonomy and favour the use of renewable energy, the load has to be fed by RERs at any time. On-maximum power point tracking (On-MPPT) mode is prioritized. Depending on the value of net power P net = P Load − (P PV + P WT ), there are three possible scenarios as follows: • P net = 0: Renewables fully satisfy the load and there is no need for energy from battery, power grid, and EV; • P net > 0: In this case, the battery, the grid, and the EV are required the complement renewables underproduction. The use of each of these resources depends on batteries state of charge, power limitations, and EV availability; • P net < 0: Battery free capacity is used to store the overproduction. If the battery is fully charged or the required power is higher than the maximum power, the excess power is supplied to the grid. However, if the EV is available or the grid power is not within its power limitations, the EV battery is used as a backup energy supply. Figure 3. Energy management strategy (P net is the net power, P res stands for residual power, and P back corresponds to backup power).
In the renewables underproduction situation, the first element that will intervene is the battery. This step is shown in purple on the algorithm diagram. On one hand, if the battery is sufficiently charged and the power demand does not exceed the maximum discharge power specified by the manufacturer, the battery provides the power required to ensure the generation/consumption power balance. On the other hand, if the discharge power exceeds the maximum acceptable battery discharge power, battery provides its maximum power while the remaining power is provided by the grid, as shown by the yellow stage in the EMS scheme. Even though the grid can be considered as a large energy resource, its power can be limited for security and reliability reasons (to prevent overload, for example). If the power demand does not exceed grid power limitations, the load is supplied by the grid. Otherwise, the EV is used as a backup to ensure the electricity continuity of service, as shown in the pink section of the algorithm. A final situation can occur for which the EV maximum power is exceeded or the EV state of charge does not allow the use of the EV battery. In this case, a load shedding is required as depicted by the grey part of the EMS scheme.
Conversely, in an overproduction situation, the battery is first used to store the excess energy generation, as shown by the purple section of the algorithm. If the battery is fully charged or the required power exceeds the maximum charge power given by the manufacturer, the main grid intervenes to guarantee the generation/consumption balance (yellow part of the diagram). As previously specified, the grid power is limited to enhance the system reliability and improve autonomy, which is the reason why the EV is used to store a part of the produced energy if the grid maximum power is achieved, as described in the pink part of the energy management strategy. Finally, if the EV is not available or the EV battery is fully charged, renewables are operated in off-MPPT mode in order to reduce energy production (grey part).

Objective Function
The objective of this work is to design an optimal home MG, which minimizes the investment and energy costs while ensuring the integration of V2H technology. This is done by maximizing home autonomy and reducing the energy issued from the grid. The optimization is performed over 20 years, taking into account weather data, grid energy price, and investment costs. The investment cost includes all equipment, namely PV panels, a wind turbine, batteries, power electronics, and cables, purchase and installation, and the operating and maintenances costs. The energy cost, however, mainly consists of the energy bills from the grid operator. The objective function is to ensure the optimal operation of the microgrid by minimizing its operating cost. Indeed, the area of the PV panels and the wind turbine power should be minimized to satisfy the load while minimizing the energy cost. Moreover, battery installed capacity should be optimized by taking into consideration its degradation cost. Consequently, the cost function to be optimized can be expressed as follows: where: • C inv corresponds to the investment cost, which is given by: with: -C PV , C WT , and C Bat are PV panels cost in (€/W), WT cost in (€/W) and battery cost in (€/J), respectively; -P ins PV , P ins WT , and E max bat are the installed PV power, wind power, and battery capacity, respectively.
• C ene stand for the energy cost of the power provided by the main grid. It can be expressed as follows: with: -C g corresponds to the grid energy cost, which is variable during the day: On peak periods have higher price than off-peak periods; -P i g (t) is the power fed or supplied by the power grid, which is minimized in this study.

Generation/Consumption Balance and Power Limitations
Minimizing the previously presented cost function is performed while respecting constraints related to each component of the home MG. The production/consumption balance is the main constraint of the system. To ensure a continuous and reliable power supply, the energy supplied by the RERs, the batteries, the grid, and the EV must be equal to the power required by the load at any time. This constraint is provided in Equation (8). Energy conversion efficiency is considered to account for the losses that occur when charging or discharging batteries or the EV battery. To express these losses in the power balance, the charging power is divided by the charging energy conversion efficiency (η cha bat = η cha EV = 0.9) and the discharging power is multiplied by the discharging energy conversion efficiency (η disch bat = η disch EV = 0.9). Equation (9) represents the new power balance constraint. Where P + bat (t), P + g (t), and P + EV (t) correspond to power supplied to the load and P − bat (t), P − g (t), and P − EV (t) stand for power fed to battery, power grid, and EV, respectively. Equations (10)-(12) describe the fact that these energy resources cannot charge and discharge at the same time. Moreover, to ensure that the battery, main grid, and EV do not exchange energy with each other, the constraint in Equation (13) is added. This is mainly set to minimize losses introduced by the energy conversion between these elements.
Equations (14) and (15) are set to ensure that the battery and EV battery recover its initial state of charge at the end of each day. To ensure this, the battery and EV provide a quantity of energy during underproduction periods, which is recovered during overpro-duction periods. Since the EV is not available all the day, it can be used only for a certain period of the day as specified by Equation (16). Finally, the power supplied (absorbed) by the battery is limited because of the characteristics of the conductors and switches, as shown by Equation (17). In addition of that, grid power should be limited to increase autonomy and avoid overloading. Its power is limited between minimum and maximum values as depicted by Equation (18).

Renewable Resources and ESS Constraints
The installed PV power is determined by the optimisation algorithm. This power depends on the peak irradiation and is limited by the available area on the roof of the house. Equation (19) ensures that the area is within the tolerated limits. The installed wind power depends on the peak value of the wind speed. The radius of the turbine is also limited by a maximum value. This maximum value should not exceed the value tolerated for domestic installations in urban areas and it cannot be negative, which is expressed by the constraint in Equation (20).
To ensure maximum lifespan (maximum cycles) for the battery and the EV battery, minimum SOC should be limited. On one hand, to ensure a safe operation of batteries (respectively EV battery), the SOC is limited by an upper limit, equal to 1. On the other hand, batteries (respectively, EV battery) usually have a maximum DOD set by the designer, indicating that by respecting this DOD the battery (respectively, EV battery) will be able to be operated at the maximum of charge/discharge cycles. SOCs for both the battery ESS and EV battery are then limited by a lower limit equal to the DOD for the whole day. These constraints are presented in Equations (21) and (22). Maximum battery capacity to be installed is optimized and is consequently limited to a reasonable capacity, denoted C max bat , as expressed by Equation (23). with: • SOC bat (t) and SOC EV (t) are state of charge of battery ESS and EV battery; • E max bat is the installed battery capacity that need to be optimized, which is limited by a maximum capacity C max bat ; • DOD bat and DOD EV are depth of discharge of battery ESS anf EV battery.

Simulation Results
Numerical studies have been carried out to investigate the benefits of integrating EVs in terms of financial benefits, optimal sizing, and guaranteed energy autonomy by limiting power issued from main grid. From Equations (6) and (9), it is possible to distinguish decision variables, which must have the optimal values to minimize the total cost while respecting constraints; mainly the power balance constraint. The decision variables are: • Grid power: P + g (t) and P − g (t); • Charging and discharging power of the battery: P + bat (t) and P − bat (t); • Battery capacity: E max bat ; • PV and WT dimensions: S PV and R WT ; • The evolution of renewable powers during a day: P PV (t) and P WT (t); • Vehicle charging and discharging powers: P + EV (t) and P − EV (t). The dealt with problem is a constrained non-linear optimization problem, which is described by Figure 4. The model is characterised by non-linear equality constraints and non-linear inequality constraints. In addition to these constraints, it is mandatory to define a set of lower and upper bounds on the design variables so that the solution is always in the specified range, such as the limits of the PV area and the radius of the wind turbine.
The sizing and energy management system is formulated as an optimization problem and is solved using the following method based on the Interior-point algorithm [32] using MATLAB software: With: • x: Decision variables; • A × x ≤ b: Linear inequality constraints; • A eq × x = b eq : Linear equality constraints; • C(x): Non-linear inequality constraints; • C eq (x): Non-linear equality constraints.
This method fits the problem as it minimises a multivariate function; some variables are scalars and some are vectors. It allows one to compute the minimum of the objective function under non-linear equality and non-linear inequality constraints, with upper and lower bounds of the decision variables. In the following, two case studies are presented and the results are discussed as follows: • Case study 1: Numerical studies for a grid-connected renewables-based MG without EV integration for Brest and Toulon; • Case study 2: Numerical studies for a grid-connected renewables-based MG with EV integration for Brest and Toulon.

Optimization Input Data
The investment, maintenance, and operating costs of PV, WT, battery, and grid energy costs are taken from [33], considering a lifetime of 20 years for PV and wind turbine, and 5 years for batteries. These data are provided in Table 1. Variable energy consumption for 24 h is considered in this study. Indeed, the used load profile is equivalent to the energy consumption of a small house with variable consumed power. Figure 5b shows the hourly load pattern of 24 h. Three load peaks can be noticed in the provided load profile: in the morning, at noon, and in the evening. The same consumer profile is considered for the two case studies and for the two cities for a fair and reliable comparison.
The weather data used for home MG optimal sizing and energy management system design are actual weather data issued from [34,35]. Numerical studies have been performed for two different cities in France considering a cold and hot climate for the sake of comparison and to prove the effectiveness of the proposed approaches for different climates and weather conditions. First, a cold city, namely Brest, is considered, which is characterised by high speed wind during a significant period of the year and low sunshine with high solar irradiance variability during the year. Second, Toulon, which is a city in the south of France, is considered. Toulon is characterised by higher constant irradiance compared to Brest, but it has less wind due to its geographical location. Weather conditions of these two cities are different, which is of great interest to show differences in terms of MG sizing, autonomy of the installation, and the economical benefits. Since the designed MG is connected to the main grid, the worst case is not presented hereafter. Indeed, yearly mean values are considered for both PV panels and wind turbine optimal sizing. The irradiance and wind curves for the considered cities are shown in Figure 5b and Figure 5c, respectively.   In the simulations carried out, all parameters to be optimized are bounded in order to get more realistic installation corresponding to urban usage. All decision variables' boundaries are provided in Table 2, as described in the optimization problem constraints.

Simulation Results for Home MG without EV Integration
Simulations have been performed first for a home MG without considering EV usage. Hot and cold weather climate regions in France are selected to assess the renewable resources-based MG optimal design and, consequently, to study the output power and the economic benefits. The design results give the optimal sizing of the energy generation system and is given in Table 3. These results are coherent since the solar energy potential in Toulon is higher than in Brest and wind power generation is more available in Brest. On one hand, the area of PV panels is larger in Toulon than in Brest, which is due to Toulon's high solar energy potential compared to Brest. The installed power in Toulon is 3.84 kW, whereas in Brest it is equal to 2.58 kW. On the other hand, due to high wind speed in Brest, the installed wind power is higher than in Toulon. Indeed, wind power reaches 2.46 kW against 0.89 kW in Toulon. Battery capacity in Toulon is much higher than in Brest. This is mainly due to the fact that the net power, which represents the difference between energy consumption and the actual PV and WT energy generation is higher in Toulon. Indeed, the battery is the first component to intervene in the energy management algorithm in order to maintain the consumption/generation balance.
Once the optimal sizing is performed, a one-day simulation is performed in order to show the behaviour of the MG components. Hence, PV and WT energy generation in Brest and Toulon are provided in Figure 6. Figure 7 shows the total RER energy production and net power (difference between RER production and load consumption). Net power can be provided using battery ESS if the SOC and the required power are within the specified limits or using the main grid, as shown by Figure 8. The sum of the battery and grid powers is equal to net power at any time, which shows that the main constraint related to power balance is achieved. The constraint related to the prohibited exchange of power between the battery and the grid (in both directions) is also fulfilled during the day.  The variation of battery SOC is provided in Figure 8b. It can be noticed that the battery charges and discharges during the day while respecting the the specified DOD. The battery is safely operated, its SOC varies between the limits indicated in the constraints, which makes it possible to consider a lifetime of 5 years. It is also shown that the battery SOC at the end of the day is equal to the initial value.
The total energy from the grid before the integration of the RERs was 377.24 MWh during 20 years. This energy consumption issued from the grid is reduced to 92.2 MWh in Brest and 126.95 MWh in Toulon after the integration of the RERs, allowing an autonomy of 75.56% in Brest and 66.35% in Toulon. These results show the profitability of the system after 20 years of operation. Indeed, the total energy cost before the integration of the RER was 70,703 €. This energy cost is reduced to 40,449 € in Brest and 46,105 € in Toulon. The investment cost, the grid energy cost, and the autonomy in the considered cities are given in Table 4.

Simulation Results for a Home MG with EV Integration
A second case study has been investigated to assess the interest of integrating the V2H concept in a home MG in terms of energy self-sufficiency and total cost comprising the investment, operating and maintenance costs of the MG, and the energy bill from the main grid. Two operating conditions may arise during operation, which are the vehicle is parked at home and can be used as an additional ESS or the vehicle is in normal every-day use. In the last operating situation, the home MG is operated as in case study 1 operating conditions. Numerical studies have been conducted for the same domestic MG, taking into account the use of EV batteries and limiting the available main grid power. Indeed, another constraint is considered in this second case study in order to relieve the grid by limiting the power exchange with the main grid to ±1000 W. The same cities are considered for the sake of comparison. This allows for the studying of the power outputs of renewable resources, battery ESS, EV, and grid, as well as the economic benefits of the integration of EVs at domestic MGs.
Domestic MG optimal sizing results with the integration of the EV are provided in Table 5 for Brest and Toulon. The same conclusions can be drawn from these results as the results discussed in case study 1. Indeed, the solar energy potential of Toulon remains higher than that of Brest and vice versa for the wind energy generation. The battery ESS to be installed has increased as the grid power is severely limited to enhance the use of renewables and EV batteries, and, consequently, to limit the stress on the grid, especially during on-peak periods. Renewable resources generated powers for 24 h are shown in Figure 9. It can be noticed that the integration of the EV as an additional ESS does not significantly change the sizing and the installed power of the RERs. It can be considered that renewable energy production mainly depends on meteorological data and these results allow for the extraction of the maximum energy from the RERs. The imbalance between renewable energy production and load consumption is shown in Figure 10. This imbalance is compensated for using battery-based ESS, the main grid, and the EV when the EV is parked at home. Otherwise, during EV daily use, only the battery-based ESS and the grid intervene to guarantee the production/consumption balance. System constraints are respected and power balance is achieved all the time. Moreover, there is no energy exchange between the battery, the grid, and the EV, as can be seen from Figure 11. Finally, the EV power exchange with a domestic MG and state of charge of the EV batteries are given by Figure 12. It can be seen that the EV is mainly used during periods where renewables energy generation is lower and load consumption is higher. This usage relieves the grid and decreases the energy bill.     EV usage in a home MG, even if limited to few hours, is still profitable because the home MG self-sufficiency is considerably increased in Toulon, which raises to 84.61%, and slightly increases in Brest, being raised to 76.87%, reducing the high electric network utilisation. The total cost for 20 years operation is 35,063 € in Brest and 38,827 € in Toulon. This allows financial savings of 5000 € and 8000 € in both cities, respectively compared to case study 1. The investment cost, battery energy, main grid energy, total energy cost, and achieved energy self-efficiency in the two considered cities are given in Table 6. It can be seen that the total cost is divided by almost 2 for the two cities. Moreover, the grid is relieved due to the use of the V2H concept and the energy bill is significantly decreased while achieving a very good autonomy.

Discussion
Numerical studies have proved that the integration of an EV in home microgrids has brought several benefits, starting with the economic gains, which is of interest for householders. Such financial savings encourage customers to switch to the V2H concept, given the reduction in the electricity bill and in the capacity of the installed battery ESS. The major disadvantage is the investment cost, which is still a bit expensive, but considering the duration of the project, this cost is quickly paid back in few years.
The second advantage to mention is the reduction of the energy provided by the main grid. Simulation results showed that the integration of an EV reduces the grid power and, consequently, lowers the stress on the grid, especially during congestion periods. The energy decreases from 92.2 MWh to 87.238 MWh in Brest, and it decreases by almost 50% in Toulon as the energy issued from the main grid decreases from 126.95 MWh to 58.073 MWh. The EV battery provides a certain amount of energy when it is connected to the home MG, and, therefore, allows grid power limitation. If the V2H and V2G concept is further expanded, there will be a decrease in grid power and therefore fewer outages, fewer voltage and frequency regulation problems, and also fewer CO 2 emissions thanks to the massive use of local renewable resources.
In a home MG, battery power decreases after the integration of an EV as an additional ESS. This leads to the reduction of the number of cycles, and, therefore, the lifetime of the battery increases. The increase in lifetime induces financial savings as the operating and maintenance costs will straightforwardly decrease. Moreover, the installed battery capacity decreases, which allows for a decrease in the initial investment cost. Indeed, a part of the required energy storage system to handle the intermittency of RER is ensured by using EV batteries.
Despite the large amount of energy supplied by the EV, its SOC does not significantly vary, which can be explained by the large storage capacity of the EV to ensure certain autonomy. Indeed, the EV will have enough energy to support the home MG while limiting main grid power. In this work, the EV SOC is limited to a DOD of 85% to avoid its battery being significantly discharged, but in reality, the EV can be discharged even more. Indeed, the Lithium-ion batteries used in EVs can be discharged even more than 50% of their maximum capacity to support the home MG. Table 7 summarizes the two conducted case studies. It is clear from this table and the previously discussed results that the integration of the EV brings great benefits to a home MG. Indeed, the energy self-sufficiency has increased in both cities, with a large improvement for Toulon (hot climate with huge PV potential). In terms of financial benefits, it is obvious from the given results that the use of renewable resources and the EV energy storage capacity lowers the energy bill for 20 years of operation, even if the investment cost is quite high, mainly due the price of battery energy storage devices.
The use of the electric vehicle as a RER energy storage device leads to the degradation of its battery over time [13], as the lifespan of the battery depends on the number of charge/discharge cycles. It would be more interesting to integrate an EV battery degradation cost in future work. Moreover, more aspects related to home MG EMS can be investigated, such as demand response and energy trading in the community integrating an EV fleet for enhancing the overall operation of the community MG [36].

Conclusions and Perspectives
This paper has presented an optimal sizing algorithm and energy management scheme for a home MG integrating the V2H technology for both hot and cold climates. The presented case studies show the advantage of the V2H concept, especially with the high integration of renewable energy resources. The electric vehicle presents a support for renewable energies by offering a larger storage capacity, thus efficiently increasing renewable energy generation by increasing on-MPPT mode usage. This increase in renewable production reduces the dependence on the grid, as shown in the simulation results. Therefore, the energy bill is reduced and the use of clean energy is empowered for sustainable development. It is mainly demonstrated that the use of V2H presents a financial interest for homeowners, supports the integration of RER for sustainable development, and relieves the main grid during on-peak periods.
The economic advantage of V2H and its cost-effectiveness may encourage homeowners to switch from thermal to electric vehicles, thus reducing the pollution rate, knowing that the total amount of CO 2 emitted by the design of the electric vehicle is half that emitted by the manufacturing and operation of the combustion vehicle. This greatly reduces the level of CO 2 emissions over a period of 20 years. Moreover, in a house MG, the electric vehicle reduces the size of the storage system and avoids its degradation by storing surplus production, which lowers the total investment cost and reduces the rate of manufacturing and changing of storage systems, in this case the battery ESS.
In the near future, it is interesting to scale up to a district, using a fleet of electric vehicles, to show the benefits of the V2G concept. It is foreseeable that the integration of electric vehicles will significantly reduce the pollution rate. However, the economic profitability needs to be demonstrated through further investigations. The move towards a larger scale will lead to more constraints, as vehicles will not have the same displacement and availability over a day, and this constraint will further complicate the optimisation of the objective function. It is not certain that, by increasing the number of electric vehicles, the network will be relieved, it may happen the other way round, where the charging stations require a huge amount of energy, and if the number of stations increases, the energy required increases accordingly. One solution to this problem is to power the charging stations with renewable energy.
Other aspects linked to artificial intelligence must be used to forecast weather data for optimal energy production and also to predict the displacement and consumption of vehicles, as well as their availability. Other parameters need to be considered in the modelling of the battery degradation cost, solar panels, and wind turbines to achieve more accuracy, such as the temperature, the change of the energy cost in the energy market, and load shedding.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

Nomenclature
The following variables are used in this manuscript:

P Irr
Irradiance of the day W/m 2 P ins PV Installed PV power (computed considering maximum irradiance) P PV (t) Power produced by PV at time t P ins WT Installed wind power (computed considering maximum wind speed) P WT (t) Power produced by WT at time t P + bat (t) Battery discharge power at time t P − bat (t) Battery charging power at time t P + g (t) Power supplied by the grid at time t P − g (t) Power sent to the grid at time t P i g (t) Grid power at time t at for the ith year P + EV (t) Electric Vehicle discharge power at time Electric vehicle depth of discharge S PV PV surface m 2 S limit Surface limit of the PV R WT Radius of the wind turbine R limit Radius limit of the WT