Integration of Electric Vehicles in Home Energy Management Considering Urgent Charging and Battery Degradation

With the absence of renewable energy sources (RES) and energy storage systems (ESS), home energy management systems (HEMS) suffer more difficulties to schedule the household demand without affecting the homeowner’s lifestyle or exceeding distribution transformer maximum loading. The problem is more complicated when considering other practical situations like multi-trips and urgent charging activities of electric vehicles (EV) during the peak periods. In this paper, a HEMS strategy is proposed to coordinate the operation of the household load demand, including charging/discharging activities of EVs batteries in homes that are not integrated with RES nor ESS. The proposed strategy is intended to reduce the daily energy cost, peak-to-average ratio (PAR), and alleviate stresses on the distribution transformer while maintaining the homeowner’s convenience. Unlike most previous studies, the proposed strategy considers EV multi-trips and battery degradation associated with home discharging activities. The proposed strategy coordinates the operation of various household appliances while the charging algorithm tackles the problem of urgent charging related to multi-trips requirements. Furthermore, by using battery degradation cost and energy tariff, the proposed strategy investigates the economic feasibility of home discharging activities of EVs. The strategy is applied to a residential neighborhood with three houses with various numbers of residents and various load profiles. The results proved the proposed strategy’s effectiveness in reducing the energy cost and PAR while maintaining the transformer loading limit even if there are charging activities during peak or high tariff periods.


t acc
Accumulated number of operation periods t duty−cycle Duty cycle period of the appliance n The total number of time slots which are 288 slots in this simulation S EV ,i Status signal of EV in time slot i, 0 = OFF, 1 = ON D EV ,i Decision control signal of EV in time slot i, 0 = OFF, 1 = ON c EV ,i EV connectivity status in time slot i, 0 = not physically connected to the charging unit and 1 = connected η ch−rated Charging efficiency at rated power η disch−rated Discharging efficiency at rated power η ch,i Charging efficiency corresponding to charging rate at time slot i η disch,i Discharging efficiency corresponding to discharging rate at time slot i P rated Rated charging/discharging power of the control unit (kW) P ch −unit,i Charging power of the control unit at time slot i (kW) P disch −unit,i Discharging power of the control unit at time slot i (kW) P av,i The value of available power under the demand limit at time slot i (kW) P total wo EV ,i The total household demand without EV at time slot i (kW) P final −load,i Total household demand at time slot i (kW) P peak The peak load value in 24 hours (kW) P average The average load in 24 hours (kW) P ON  Average cost saving associated with EV discharging (e) Cost HEMS Total cost incurred associated with utilizing HEMS (e)

I. INTRODUCTION
The significant concerns about energy and the environment encourage increasing the market share of electric vehicles (EVs) as an alternative solution to traditional vehicles. As EVs (also referred to as Plug-in EV (PEV)) technologies are growing up, home charging activities are arising as new load consumption. Unmanaged residential load consumption and the irregular charging activities of EVs can exacerbate peak demand, cause potential overload, and damage local distribution transformers [1]. Home energy management systems (HEMS) introduce a solution to shrink energy consumption growth in the residential sector. Deploying demand-side management strategies side-by-side with the evolving communication systems and smart metering technologies is considered the main factor contributing to increasing the interest in HEMS [2]. The HEMS's core functions are monitoring, controlling, re-scheduling, and optimizing home energy usage by balancing energy produced and consumed. By communicating with household appliances, home energy resources, and network operators, the installed HEMS can manage energy consumption by re-scheduling home appliances' operation periods without affecting the homeowner's convenience. Therefore, the oversight of energy usage in homes can permit consumers to reduce their energy costs in parallel with restricting the overloading that can be occurred in the distribution sector. This positive effect shared between homeowners and the distribution network is so-call ''a win-win situation.'' Smart grid technologies such as small-scale renewable energy sources (RES) and residential energy storage systems (ESS) offer new opportunities for more energy management flexibility [3]. However, these technologies' problem is to engage them together with home appliances without breaking network constraints. Practically, numerous residential sectors do not have such technologies for the reasons of technical or economic problems. With the absence of alternative energy sources like RES or ESS, which offer more flexibility to the management of home energy, the energy management systems suffer more difficulty to cover the load consumption without exceeding the local transformer capacity limit. Additionally, EV multi-trips per day with urgent charging requirements between trips, especially during peak load or high tariff periods, make home energy management harder.
Utilizing EVs in HEMS offers an alternative solution to home energy resources in the absence of RES and ESS. However, the frequent charging/discharging cycles of EV battery organized by HEMS mainly accelerate the battery degradation and hence reduce its lifetime. From a financial aspect, battery replacement cost is the largest maintenance expense an EV owner will incur. As a result, HEMS is greatly affecting the total cost of ownership (TCO) of EV. The TCO of EV is affected by many factors [4]- [6]. However, two main factors are closely related to utilizing EVs in HEMS, namely EVs charging cost and battery replacement cost [4].
The charging/discharging extra cycles due to the contribution of the battery in supplying the household load demand represents an extra degradation to the vehicle's battery that would be avoided without utilizing HEMS. Accordingly, the battery degradation factor should be included in HEMS studies to decide whether the home discharging activities are more profitable than the cost associated with battery degradation or not. This factor may prevent utilizing the discharging process in some cases due to their uselessness. In contrast, EV charging cost is considered as a positive supporting point of utilizing EVs in HEMS. The management system is designed to activate charging processes at low tariff periods, except urgent charging cases, in comparison with the uncoordinated charging processes that occur in the absence of HEMS.
Interested readers can further refer to [7]- [11] for detailed information about the engaging of EVs in HEMS. References [7], [8] have represented a perfect starting point to create a complete vision about home energy management, including concepts, scheduling strategies, demand response programs, and charging/discharging of integrated EVs. A detailed review of home energy management models has been introduced in [9]. Implementation and challenges of a vehicleto-home (V2H) system related to incorporating a micro-RES and EV have been reported in [10]. Finally, a framework for home transition from traditional to smart and corresponding payback analysis of used equipment has been presented [11].
The recently published researches that are concerned with exploiting EVs in home energy management can be classified into three categories: 1) The first category concentrates on utilizing the RES side by side with ESS and EVs to improve the efficiency of the home energy system, increase the homeowner profits and reduce the energy costs as introduced in [3], [12]- [26] 2) The second category is related to engaging RES with EVs to provide the optimal management of home energy. The relevant researches of the second category have been reported in [27]- [37].
3) The third category concentrates on utilizing EVs in home energy management systems in the absence of RES and ESS, and it is introduced in [38]- [44]. According to the recent literature, few works are concerned with EV multi-trips per day in the presence of RES or ESS [29], [35]. However, the authors in [29] study the multitrips effect to estimate the availability period of EV at home, which serves the surplus power generated from the solar photovoltaic unit. In contrast, the effect of the urgent charging requirements related to multi-trips per day is not reported. In [35], it was assumed that charging activities occur only during the early morning while EV always discharges some of the energy stored in the vehicle battery after each home arrival regardless of whether this energy can cover the next trip's requirements or not. This hypothesis is impractical in many cases. In contrast, to the authors' knowledge, no study has analyzed EV multi-trips in the absence of RES and ESS.
This paper is concerned with the third category. A comprehensive comparison between the research in this category and the proposed strategy is presented in Table 1 to elaborate on the paper's contributions.
As shown in Table 1, many research that intended to utilize EVs in home discharging activities built their studies without considering the effect of vehicle battery degradation associated with discharging process [38], [40], and [41]. Utilizing energy stored in the vehicle battery to supply the household load demand without considering the financial aspect leads to an adverse effect on the TCO of EV, which limits the prevalence of EVs [4].
In this paper, a home energy management strategy is proposed to deal with vehicle multi-trips, urgent charging requirements, and home discharging activities considering the battery degradation cost in the absence of RES or ESS. The proposed strategy aims to reduce the daily energy costs and the peak-to-average-ratio (PAR) without exceeding the local distribution transformer limit.
The main features and contributions of this work are summarized as follows: 1) Present an efficient energy management strategy to reduce the daily energy cost and PAR without exceeding the local transformer capacity limit or affecting homeowner comfort in houses that are not integrated with RES or ESS. 2) Studying the multi-trips charging/discharging requirements. 3) Present an online adaptive charging algorithm to deal with the problem of urgent charging requirements of EV. 4) Present an online adaptive discharging algorithm to investigate the feasibility of HEMS discharging activities by considering the extra battery degradation associated with these activities. In addition, this algorithm prevents the reverse power flow during the discharging process. The rest of this paper is organized as follows: The problem statement and motivations are introduced in Section II. In Section III, the proposed smart home configuration and the home appliances mathematical models are presented. The technical and financial aspects associated with utilizing HEMS are presented in Section IV. Then, the proposed strategy and different charging and discharging algorithms are introduced in Section V. Afterward, the case study and methodologies implementation are noted in Section VI. Finally, conclusions are presented in Section VII.

II. PROBLEM STATEMENT AND MOTIVATIONS
In the absence of RES or ESS, the HEMS suffers from coordinating the household load demand and EVs charging requirements without exceeding the local distribution transformer demand limit. The situation gets worse with EV urgent charging situations that are required to meet the user traveling distance during a day. Furthermore, activating the home discharging process of EV batteries without considering the financial aspects may lead to not only unprofitable discharging activities but also shorten EV battery lifetime.
Through surveying the recent literature, there is a lack of studies that analyze the EV multi-trips per day, urgent charging conditions, and the consideration of battery degradation. In addition, the investigation of EV home discharging activities feasibility is not included in most previous studies.
This paper mainly focuses on studying the effect of utilizing EVs in HEMS in the absence of RES or ESS considering EV multi-trips, urgent charging conditions, and battery degradation associated with discharging activities. The proposed HEMS coordinates the household load demand, including EV charging/discharging activities to reduce the daily energy costs and PAR without exceeding the local distribution transformer limit. Meanwhile, the feasibility of home discharging activities of EVs is also investigated.

III. SYSTEM MODELING A. SMART HOME CONFIGURATION
In this paper, a typical configuration of a smart home in a residential community is illustrated in Fig. 1. The proposed model comprises a smart meter, home energy control unit, communication network, household appliances, and EV. The smart meter is installed to monitor the household consumed energy and to receive the dynamic price signal and home demand limit from the system operators at the beginning of each day. The energy control unit is geared to control the home's energy usage by remotely turning ON/OFF appliances, setting up operation scheduling lists, and setting up conditional rules for appliance operation.
The communication network is also responsible for data transferring between the energy control unit and home appliances (receiving the appliances status signals and sending the scheduling decisions to these appliances). The household appliances are categorized in this paper into two types based on operating nature and controllability as follows: 1) Uncontrollable appliances: such appliances have unscheduled operational periods, which can be operated at all daytime, like a refrigerator or at random times as a TV. The uncontrolled appliances are simulated as a constant base load at each time slot. The data of such types of loads are extracted from the available residential load profiles. 2) Controllable appliances: The operating periods for such devices can be scheduled without a noticeable effect on the homeowner's lifestyle, such as washing machines or dishwashers.

B. MODELING OF CONTROLLABLE APPLIANCES
In this work, the mathematical equations and operation rules that describe the water heater (WH) model are assumed to be as [45]. The mathematical models of washing machine (WM), dishwasher (DW), and EV are presented consecutively in the next sub-sections.

1) MODELING OF WASHING MACHINE
The power consumption (P WM ,i ) equation of the WM is presented in (1), where the power consumption rate (P phase ) is related to the sequential operation phases of the WM. In this work, the operation sequence is introduced in three phases: washing, heating, and rinsing with associated power of 0.15, 2, and 0.3 kW, respectively [46]. The operation rules of status signal (S WM ,i ) are introduced in (2), wherein it will have a value of ''1'' (ON) from the instant of user-defined starting time (t st ) until the WM completes its duty cycle (t duty−cycle ) period. Finally, the decision signal (D WM ,i ) that switches between two values (0 or 1) is determined by the proposed HEMS based on the appropriate operation schedule of home appliances at each time slot.
2) MODELING OF DISHWASHER The power consumption (P DW ,i ) equation of the DW is presented in (3), while the status (S WM ,i ) and decision (D WM ,i ) signals are assumed to be the same rules of the WM that stated previously.

3) MODELING OF ELECTRIC VEHICLE
In this paper, EVs may be recharged or supply energy to home appliances according to energy stored in the vehicle battery after home arriving. Thus, EV is modeled as a load in charging mode while it acts as ESS in discharging mode. Accordingly, the simulation model of EV varies essentially based on the operation mode. For further clarification, VOLUME 9, 2021 the next subsections are dedicated to elaborating the required equations for simulating EVs' parameters, including battery state of charge (SOC) and charging/discharging power rate in various modes with different trip situations.

a: NEXT TRIP SOC CALCULATION
Initially, the user departs with a fully charged battery at the beginning of each day. The EV is connected to the control unit as soon as it arrives home. The new SOC is defined when the vehicle is plugged into the charging/discharging control unit. For multi-trip situations per day, the vehicle owner will be asked to determine the estimated distance of the next trip through the HEMS user-interface. As a result, the HEMS calculates the SOC required to cover the traveling distance by (4). The SOC level must be maintained over a certain level to prevent the battery from decreasing below a threshold value that would reduce the vehicle battery's lifetime (which is considered 20% in this study). Accordingly, the SOC at the next departure time is computed from (5). Also, 15% extra SOC is added, as much as possible, for the cases of traffic jams and emergencies.
The EV final charging power at any time slot is calculated from (6) as introduced in [45]. However, in this work, the charging power is modified to be compatible with different charge rate types (fixed or variable) and multi-trip situations. The EV status (S EV ,i ) is a binary parameter that denotes the ON-OFF status of the EV. State ''1'' refers to ON-status, and state ''0'' refers to OFF-status. In case of having a single trip per day, the status (S EV ,i ) is defined from (7) since this parameter value is ''1'' from the instant of plugging until a fully charging state is reached. For multitrip situations, the vehicle status is modified to ''1'' if the arrival SOC is less than the value required for the next trip. In contrast, status is turned into ''0'' to prevent the charging activity if the vehicle battery already has suitable SOC to cover the next trip requirements. The vehicle status for multitrips is realized from (8).
For a single trip: For multi-trips: As mentioned previously, the EV decision (D EV ,i ) is modified to 0 or 1 by the HEMS based on various parameters such as next trip status, amount of SOC stored in the vehicle battery, EV priority level, energy cost, and household load value. Besides, the vehicle connectivity status (c EV ,i ) will take the value ''1'' if EV is physically connected to the charging/discharging control unit while it will be ''0'' any time else. Finally, the charging power output from the control unit (P ch−unit,i ) is related to the charging level. It can be either fixed or variable power rate as illustrated below: CHARGING WITH FIXED POWER RATE In the fixed power rate (FPR) method, the charging is done with the maximum rated power during the charging periods. This method is used if the total household load demand plus the maximum rated power of EV charging is less than or equal to the home demand limit (DL). The charging power of the control unit at each time slot is calculated from (9). The charging efficiency is supposed to be 90%.
CHARGING WITH VARIABLE POWER RATES In the variable power rates (VPR) method, the charging power varies during the charging period based on the available power below the DL. The available power below the home DL is calculated from (10), as shown in Fig. 2. This charging method is used to benefit from any available amount of power, especially in urgent charging and preventing the household load from exceeding the home DL. Equations (11) and (12) calculate the charging rate and control unit output power. In this study, the dependency of charging efficiency (η ch,i ) on the power rate is considered. The charging efficiency is calculated from experimental data reported in [47], portrayed in Fig. 3. Finally, the battery SOC of FPR or VPR for time slot i is determined by (13).

c: EV'S DISCHARGING MODEL
In this study, the EV discharging power at any time slot is modified to be compatible with the fixed or variable discharge rate type determined from (14). The vehicle status (S EV ,i ) in case of a single trip is calculated from (15). The status turns into ''1'' if the SOC of the battery is greater than the minimum allowable limit. The discharging process is prohibited in any other case. In multi-trip cases, the discharging process's ON-OFF status is related to the amount of SOC stored in the battery and the value required for the next trip, as demonstrated in (16). The decision (D EV ,i ) and connectivity (c EV ,i ) are previously mentioned in the previous sub-section.
For single trip For multi-trips DISCHARGE WITH FIXED POWER RATE With FPR, the discharging output power is maintained constant at the maximum value. This method is used if the total household load (without EV) is larger than the DL. The discharged power of the control unit at each time slot is calculated from (17). Discharging efficiency is assumed to be 90%.
DISCHARGE WITH VARIABLE POWER RATES The discharging process with a variable rate is applied if the total household load (without EV) is less than the charger's maximum discharging power rate. Thus, the output discharging power will be reduced to prevent power reverse to the power grid. The appropriate discharge rate and the discharging output power of the control unit are calculated from (18) and (19). Finally, the battery SOC of FPR or VPR for time slot i is estimated from (20).

IV. TECHNICAL AND FINANCIAL ASPECTS OF UTILIZING HEMS
This section clarifies the related technical and financial analysis associated with utilizing HEMS.

A. TECHNICAL ASPECTS
One of the major indices that reflect the effect of using HEMS on the residential load profile is PAR. It is an index that expresses the energy consumption behavior of the users [25], which can be calculated from (21) PAR = Ppeak Paverage (21) B. FINANCIAL ASPECTS HEMS has deeply effect on the TCO of EVs wherein the extra discharging cycles due to the contribution of the battery in supplying the home loads accelerate the degradation of the vehicle's battery. This effect is reflected in the battery lifetime (Fast battery replacement). Accordingly, the battery degradation factor should be accounted for HEMS analysis to decide the feasibility of home discharging activities of EVs and prevent it if not profitable. The other factor that should be imposed in HEMS is the saving in the electricity bill associated with coordinating EV charging activities (off-peak charging) and the energy discharged from the vehicle battery to supplying the household demand. Thus, the financial analysis considering the battery degradation includes the following calculations in order: 1) The daily energy cost, including the EV coordinated charging/discharging activities, 2) The amount of battery discharged energy, 3) The battery degradation cost, 4) The cost-saving from extra EV discharged energy.

1) DAILY ENERGY COST
The daily energy cost (Cost energy ) of household load demand (including the EV charging/discharging activities) can be calculated as The battery degradation cost is an additional cost incurred by the user if the discharging process was activated. The battery degradation cost is a function of the amount of battery discharged energy used in supplying the loads [48]. This amount of battery discharged energy is calculated in the next section. VOLUME 9, 2021

2) AMOUNT OF BATTERY DISCHARGED ENERGY
Initially, the battery SOC that available to be discharged (SOC available ) can be calculated for both single/multi-trip as introduced in the next equations: For single trip For multi-trips The battery discharging energy (E disch ) related to available SOC stored in EV battery is estimated as:

Cost deg = Cost unit Cbattery + Cost labor
Nlife Cbattery DOD × Edisch (26) In this study, Cost unit is taken as 112 e/kWh [50], while Cost labor is 197 e, and N life is 5000 cycles at 80% discharge as reported in [49]. The total cost incurred by HEMS (Cost HEMS ) combines the daily energy cost provided in (22) plus the battery degradation cost introduced in (26) as indicated in (27).
The proposed discharging algorithm introduced in the next section checks whether the use of a battery with the extra EV discharged energy is more profitable as compared to the extra battery degradation or not. So, the next step is to calculate the average cost saving from extra EV discharged energy.

4) COST SAVING FROM EXTRA EV DISCHARGED ENERGY
The cost-saving (Cost disch ) due to the discharged energy from EV battery can be estimated based on the average energy tariff cost during the high tariff period (Tariff average ) as illustrated in (28).
The proposed HEMS is supposed to receive the day-ahead energy tariff at the beginning of each day (as introduced in the next section). Hence, the cost of the discharged energy is easily estimated. In the proposed HEMS, the vehicle battery is used to supply some of the household demand only during the high tariff period and provided that it is more profitable to use the battery. This sequence will greatly reduce the numbers of charging/discharging cycles organized by HEMS and reduce the battery degradation as introduced in the next section.

V. ALGORITHM DESIGN A. HEMS MAIN ALGORITHM
The proposed strategy aims to reduce energy costs, PAR, and prevent the local distribution transformer from exceeding its rated capacity. The combination of charging and discharging processes, including FPR and VPR, provides a suitable scheduling scheme for smart home appliances and maintains the user's convenience. Unlike most studies in the literature, EV multi-trips, urgent charging considerations, and battery degradation are considered in this strategy. The proposed strategy operates with the following considerations: 1) Network service providers send day-ahead tariff data at the beginning of each day. 2) The transformer capacity is assumed to be equally distributed among the end-users connected to the LV side of the same local distribution transformer.
3) The home charging/discharge unit is powered with a variable charging/discharging control system to adapt the output power. 4) The vehicle's initial SOC is known once the vehicle is plugged into the charging/discharging control unit. 5) After arriving from a trip, the following question must be answered: Is there any next trip? [y/n]. What is the expected next trip distance? [mile]. What is the next trip departure time? The strategy procedure is explained in Fig. 4, and the main steps are summarized as follows: Step 1: Gathering the system's initial data, receiving the day ahead real-time price signal (RTP), demand limit, home appliances priorities, and finally initialized the mathematical models of home appliances and EV.
Step 2: Starting the daily time sweep with a time resolution of 5 minutes. (288-time slots) Step 3: In the first stage of this step, update the ON/OFF-status of each controlled appliance and sort the ON-status appliances based on priority rank. In the second stage, start the operation of ON-status controlled appliances and calculate the total expected load.
Step 4: Check of the vehicle arrival by examining the connectivity status (c EV ) If EV is connected (c EV = 1): Updating the battery SOC at the arrival instant and check for any next trip through the user interface. If EV does not arrive (c EV = 0): Switch to Step 6.
Step 5: This step consists of two separate cases depending on the next trip situation as follows: Case 5.a (Multi-Trips Mode): Based on the user-defined distance, this case starts with the computation of SOC required for the next trip (SOC next−trip ) from (4) and (5). The (SOC next−trip ) then is compared with the amount SOC stored in the vehicle battery (SOC i ) at time slot i. Based on the previous data, two different paths are expected: Path-1: This path is selected if the SOC i is less than the SOC next−trip . The energy available in the EV battery is  insufficient to cover the traveling requirements of the next trip. As a result, the EV has automatically been assigned as a high priority load, and the urgent charging sub-algorithm described in the next section is launched.
Path-2: This path is selected if the SOC i is greater than the SOC next−trip . In this case, the vehicle battery has excessive energy available for discharging activities. However, the discharging algorithm described in Fig. 6 starts only during a high tariff period to minimize the number of discharge cycles and preserve battery health.

Case 5.b (Single/Final Trip Mode):
In the case of having a single trip or no other trips till the next morning, the EV is automatically assigned as the lowest priority load. The charging and discharging of the EV are determined based on the energy costs with two different paths: Path-1: This path is selected during the low tariff periods. The charging process is activated with economical mode to charge the vehicle battery for the next day's trip.

Path-2:
This path is chosen during high tariff periods. In this case, the SOC i is compared first with the minimum threshold SOC (SOC min. ) of the battery to decide whether discharging is permitted or not. The discharging algorithm is activated if the SOC i is greater than SOC min . while EV switched to economic charging algorithm if this condition is not satisfied.
Finally, the expected home demand (P exp−load,i ) is calculated from (29) as the final procedure in step 5.

Pexp.−load
Step 6: The final step in the proposed HEMS algorithm is dedicated to preventing the P exp−load,i from exceeding the home DL. The ON-status appliance usually operates upon request until the P exp−load,i exceeds the DL. If this happens, the HEMS algorithm will start shedding the lowest priority appliance one by one and re-arrange the new priority list. Once the P exp−load,i goes below DL, the algorithm determines the final scheduled value of the household load demand.

B. EV CHARGING ALGORITHM
The charging algorithm is a sub-algorithm from the HEMS main algorithm. The charging algorithm is responsible for scheduling EVs' charging activities in single and multi-trip conditions based on the charging model introduced previously in section III. The algorithm is segregated into two modes: urgent (obligatory) and economical charging modes. The choice between the two modes depends on the EV load priority, as discussed in the previous section. The economic charging mode is used in cases like single trip per day or when the EV arrives from the final trip wherein the parking period is relatively long (departure in the next morning). In contrast, the urgent charging mode is utilized for multi-trip cases when the parking periods between trips are limited. The main feature of using this mode is to meet the EV's required charging level before the next departure time.
In economic charging mode, the EV is automatically assigned as the lowest priority load demand. In this case, the charging process started only at the low tariff period provided that the available power below the home DL is sufficient to charge the EV with FPR. If these conditions are not met, the charging activities are prohibited in this time slot. On the other hand, the urgent charging mode is used between trips, especially during peak load periods. In this case, the user needs to guarantee that the SOC required for the next trip will be fulfilled without exceeding the home DL. In the urgent charging mode, the algorithm checks first the charging possibility without shutting down any ON-status appliance to maintain the user convenience by comparing the total expected demand for ON-status appliances (P exp−load ) with the pre-set DL. If the expected demand is higher than the DL, all appliances that have a priority lower than EV will be switched OFF. The charging process will be paused in the current time slot if the new load demand value is still greater than the DL after switching OFF the low-priority appliances.
The algorithm always examines the ability to charge with FPR. The algorithm starts charging with FPR if the total load demand, including EV did not exceed the DL. If the condition is not fulfilled, the charging process will proceed with a VPR. To maintain the battery's health and reduce its degradation, the VPR is only limited to urgent charging mode. The detailed information of the charging algorithm is illustrated in Fig. 5.

C. EV DISCHARGING ALGORITHM
The discharging algorithm is responsible for controlling the discharging activities of EVs. Besides that, the EV discharging mode is limited only during the high tariff periods to reduce energy costs. Accordingly, the battery discharge is restricted in any other period to minimize battery degradation. In a high tariff period, discharging algorithm may also prevent utilizing of discharging process due to an increase in the battery degradation cost (Cost deg ) in comparison with the average cost saving (Cost disch ) associated with the EV discharging process.
The discharging algorithm starts by calculating the available SOC that can be discharged according to trip attitude imposed by the vehicle owner as introduced in (23) and (24). Afterward, the algorithm determines the total discharging energy referring to (25). From these parameters, the battery degradation cost (Cost deg ) and the average cost saving (Cost disch ) associated with EV home discharging activity are calculated as shown in (26) and (28), respectively. The discharging algorithm decides of activating the discharging process or preventing it based on the values of Cost deg and Cost disch . If Cost deg is greater than Cost disch , then the discharging process is unprofitable, and the discharging process will be prevented. In contrast, if this condition is not fulfilled (discharging process more profitable), the algorithm compares the value of total connected household load demand without EV load with the charger's maximum discharging power rate (P rated ). If the house's connected load is greater than or equal to P rated , the algorithm directly starts the discharging process with FPR. In contrast, if this condition is not satisfied, the discharging process initiates with the VPR technique to prevent the reverse power flow. The detailed information of the discharging algorithm is clarified in Fig. 6.

A. CASE STUDY DATA
The system under study in this paper is shown in Fig. 7. It contains three houses in a neighborhood served by VOLUME 9, 2021 a 25 kVA single-phase transformer [16]. These houses host not only different loads but also different numbers of occupants. A single person occupies House-1 while two persons occupy House-2, and House-3 is occupied by four residents. The three houses are equipped with several domestic appliances, including ordinary household appliances, washing machines, dishwashers, water heaters, and EVs with different battery capacities. The uncontrolled load profiles of the three houses are reported in [16]. The energy price signal for the 24h of the operation horizon is displayed in Fig. 8. The prices are adapted from UK real-time price at 5-10-2020 [51]. According to the tariff data, the average cost of energy tariff during the high tariff period (Tariff average ) is 0.079 e/kWh. The operational phases and the washing machine's power consumption are presented in [46].
In this paper, the pre-defined appliance's priority of all three houses is supposed to be as shown in Table 2. Since the homeowner completely imposes the operation priority of the controlled appliances, the entire data in Table 2 are typically assumed. Additionally, the simulation parameters of different controlled appliances, including the EV, are assumed to be as stated in Table 3. The three houses' first trip arrival times are assumed to be compatible with the uncontrolled load profiles portrayed in [16]. Multi-trip cases are assumed for House-2 and House-3, while House-1 has only one trip per day.

B. RESULTS AND DISCUSSION
In this work, all analysis, simulations, and results have been implemented using MATLAB script for 24 hours with 5 minutes time resolution. This section introduces the validation of the proposed HEMS strategy with the associated impacts on the three houses individually and on the local distribution transformer to prove its effectiveness.
For each house, the output results are validated by displaying the final scheduling operation of the controlled appliances, including EV, and the associated total household load demand with and without applying HEMS. Fig. 9 clarifies the operation schedules of controlled appliances in House-1. The EV is assumed to arrive at the 47724 VOLUME 9, 2021 beginning of the violet region at 17:45 with assumed 47% SOC stored in the vehicle battery. Once the vehicle arrived and is plugged into the charger, the connectivity status (c EV ) turns into ''1'' and asks the operator for any upcoming trip. Since there is no defined next trip in the case shown in Fig. 9 and the vehicle battery SOC is greater than SOC min. , the HEMS was supposed to start the discharging algorithm. However, the discharging algorithm was prohibited in the violet region because of the low energy cost during this period.

1) IMPACT OF APPLYING THE HEMS ON HOUSE-1
As soon as the high tariff period starts (displayed in the orange region), the discharging process also starts (at 18:05). The system decided to discharge with FPR as the total household load demand (uncontrolled appliances plus WH) is greater than the maximum discharge power rate (3.3 kW as stated in Table 3). In this case, the EV battery fulfills a partial of home energy requirements to limit the power consumed from the grid and hence reduce the electricity bill. Later from 18:20 to the end of the orange region at 20:00, the household load drops to be less than the maximum discharging power rate. Hence, the discharging process continued with a lower discharging rate (i.e., the discharge mode is VPR) to compatible with the household load and prevented reverse power flow. During this period, the home's energy requirements are almost fulfilled by the EV battery, and hence, the energy cost is minimized.
At 20:00, the SOC of the vehicle battery reaches the minimum allowable limit, and as a result, the discharging activity is ended. After disabling the discharging process, the EV is automatically assigned as the lowest priority load. It will not start to recharge unless the household load demand has fallen to a value that allows for the charging process to start (which occurs at 22:50).
According to Table 3, the WM is supposed to operate at 20:45. However, the HEMS delayed the WM operation during the high tariff period to reduce the energy cost. The HEMS takes this action only with the low-priority appliances to minimize the energy costs. The WM started at 21:10 with a delaying period about 25 minutes from the user's time previously defined. At 21:45, the DW started according to the user-defined time as introduced in Table 3. As the available power (below the DL value) does not allow the operation of the two appliances simultaneously, the HEMS starts the DW and pauses the WM operation since the DW has a higher priority rank than WM stated in Table 2. The HEMS takes this action after comparing the total household load associated with both units' operation simultaneously with the DL to prevent the total household load from exceeding the DL. The WM resumes its duty cycle after the end of DW operation at 22:45. Once the household load demand falls to a value that allows for the charging process to start at 22:50, the HEMS directly initiates the economic charging algorithm to recharge the EV battery. The charging process is carried out through a continuous 3.3 kW FPR to charge the EV battery from minimum to full charge status in about 4:20 hours, as shown in the green region. In this context, the benefits of applying the proposed HEMS to House-1 are demonstrated in Fig. 10. The discharging and charging regions (orange and green) are embedded in this figure to illustrate the effect of charging and discharging activities on the total household load demand during different periods. Without using the HEMS, the DL of House-1 is exceeded (it reaches 13 kW) since the various appliance's operation sequence is not controlled. In contrast, with the proposed HEMS, the energy stored in the EV battery partially or wholly covers the home energy requirements during the high tariff period (orange region). The HEMS prevented non-urgent charging activities in this period. It is also responsible for suppressing the household load demand below the DL by re-scheduling the operations of the controlled appliances (as described in the previous paragraph) based on the priority rank. According to these results, the proposed strategy succeeded in reducing PAR by 45.3 %, as stated in Table 4.
THE FINANCIAL ASPECTS OF HOUSE-1 The previous analysis and discussions are devoted to introducing the technical impacts of the proposed HEMS strategy VOLUME 9, 2021  in House-1. Now it is the turn of the financial aspects. The EV is assumed to arrive with 47% SOC (as stated in Table 3), and a single trip is imposed by the vehicle owner of this house. Thus, referring to (23), about 27% SOC can be used in home discharging activities, which is equivalent to 4.32 kWh of discharged energy as estimated by (25). Accordingly, the battery degradation cost associated with discharging process is 0.1343 e while the average energy cost saving related to this charging process is 0.3413 e as estimated by (26) and (28), respectively. Referring to (22), the daily energy cost (including EV charging and discharging activities) associated with utilizing HEMS is 3.2206 e while it was 3.8255 e without using HEMS. Lastly, the total cost incurred by the owner as a result of using HEMS is 3.3549 e as introduced in (27). Table 4 illustrates the financial impacts associated with utilizing HEMS in House-1 and the percentage of reduction.   (2) and (3), and the result was 53%. Once the required SOC is calculated, HEMS compares the calculated value with the original SOC. Accordingly, in the yellow region, the HEMS immediately starts the urgent charging algorithm to fulfill the required charging before the next trip. In this region, the charging algorithm starts at 17:05 with 6.6 kW-FPR since the household load is 1.7 kW and the available power below the DL is suitable to start charging with maximum power rate. Once the household load is increased to 4.3 kW at 17:25, the charging process automatically switched to VPR to adapt to the newly available power. Later at 17:50, the HEMS turns ON the WH to maintain the pre-defined values' hotwater level. At this instant, the total load reaches 8.3 kW, and since the WH has a higher priority rank than EV, as stated in Table 2, the EV charging is paused until the load value is dropped again. The EV charging process returns at 18:00 and reaches the required SOC at the yellow region's end. During the violet region, the vehicle battery can neither charge nor discharge as its SOC is almost enough to cover the next trip mobility at 18:30.
The EV arrived from the second trip at 19:30 with 35% SOC at the beginning of the orange region. Since the EV arrived during a high tariff period with reasonable SOC, the discharging process starts with VPR. The discharging power rate depends on the household load (uncontrolled household load plus the WH) during this period. The discharging is deactivated when the SOC reached the battery's minimum threshold at the orange region's end.
The WM operation was delayed during the high tariff period while the DW started at 21:55. The operation of the two units continued during the same time since the household demand was lower than the DL. At 22:20, the operation cycle of the DW was paused as the WH starts its operation (WH has high priority rank than DW). Although the DW was paused, the WM continues its operation simultaneously with the WH as the WM operates in the rinse phase with small consumption power of 0.3 kW, which has no noticeable effect on the total household load demand. Afterward, at 22:25, the DW continues its operation until it finishes at 23:00.
Even though the operation of WM and DW finished at 23:00, the charging process did not start before 1:15. This delay occurred due to the economic charging mode operates with 6.6 kW-FPR, which -if used -may lead to exceeding the DL value during the period from 23:00 to 1:15 (load is about 2 kW in this period). Finally, the charging process of the EV started in the green region at 1:15 with economic charging mode.
The total load demand of House-2 with and without using HEMS is illustrated in Fig. 12. The uncontrolled operation of home appliances and un-scheduling EV charging activities led to an increase in total load to 18 kW (more than double of DL). In contrast, the proposed strategy supports the urgent charging mode without exceeding the DL despite having many activities during peak or high tariff periods, as shown in Fig. 11. The EV discharged energy almost fulfills the home energy requirements in the orange region. Besides, it prevents the load from exceeding the DL during the day. In this house, the HEMS reduces the PAR by 49.9 %, which is numerically shown in Table 5.  THE FINANCIAL ASPECTS OF HOUSE-2 EV has arrived from the second trip with 35% SOC, which means there is about 15% SOC available to activate the discharging process. Thus, the total discharged energy from the vehicle battery during this period was 3.6 kWh, while the associated energy saving and battery degradation cost are 0.2844 e and 0.1119 e respectively. The daily energy costs (including EV charging and discharging costs) with and without utilizing HEMS are 4.1943 e and 5.3405 e respectively. Finally, the total cost incurred with utilizing HEMS is 4.3062 e. The financial impacts associated with utilizing HEMS in House-2 with the percentage reductions are detailed in Table 5.

3) IMPACT OF APPLYING THE HEMS ON HOUSE-3
Fig . 13 displays the re-scheduling results of the proposed HEMS for House-3. The EV arrived at 17:50 (beginning of the yellow region) with 33% SOC. The user scheduled a new trip at 19:30 with a total traveling of 30 miles, which requires 54% SOC to cover the trip distance according to (4) and (5). As a result, the urgent charging mode started to attain the necessary SOC before the next departure time. The charging process starts from 17:50 to 19:10 with VPR to keep track of the change in the available power below the DL related to the change in the household load value, as shown in the yellow region. During the violet region, the vehicle battery can neither charge nor discharge as its SOC is almost enough to cover the next trip mobility at 19:30. For economic reasons, the HEMS delays the operation of DW and WM to a time after the end of the high tariff period wherein these loads can be classified as low priority loads. At 21:10, the DW and WM are supposed to operate simultaneously. However, the operation of WM has been paused after completing the first cycle since this cycle has 0.15 kW power consumption, which has no noticeable effect on the household load demand. The operation of WM is paused from the second cycle (heating with 2 kW power consumption) as the load consumption of uncontrolled appliances, and WH is 3.2 kW while the DW requires 4 kW. Thus, the operation of WM, if it operated, will lead to exceeding the DL. Therefore, the operation of WM is paused to the end of the DW operation at 22:10. Then the WM operation is continued up to 23:35.
The EV arrives from the second trip at 22:00 with 28% SOC. The EV discharging has been prevented from 22:00 to 00:50 since there was no high tariff during this period. Meanwhile, the charging process was prohibited during this period. Nether the DL, the available power is less than the power required to charge the battery, which is 6.6 kW for FPR (as stated in Table 3). Once the load demand drops to a value that allows the charger to start with FPR, the economic charging algorithm initiates the charging process, which occurs at 00:50 (at the beginning of the green region). The charging process takes about 160 minutes to reach the full-charging status.
Fig. 14 displays the total load demand with and without using the proposed HEMS for House-3. As expected, the load without using HEMS exceeded the pre-set value of DL (it reaches 15.5 kW). On the other hand, the proposed strategy supports the urgent charging activities without exceeding the DL even if these activities occur during peak or high tariff periods, as shown in the yellow region. The HEMS suppressed the overshooting of household load above the DL from 22:00 to around 01:00 (just before the green region).
The proposed system achieved about 42.6 % reduction of the PAR, as presented in Table 6.

THE FINANCIAL ASPECTS OF HOUSE-3
Without activating any discharging process, the HEMS of House-3 achieves a daily energy cost (including EV charging activity) of 5.206 e while this cost was 5.9035 e without utilizing HEMS. The cost related to battery degradation is equal to zero since there are no discharging cycles activated during this day. The percentage reductions and the associated energy costs are clarified in Table 6.

4) IMPACT ON THE LOCAL DISTRIBUTION TRANSFORMER (AGGREGATE LOAD OF THE THREE HOUSES)
From the system operators' perspective, the proposed strategy has positively affected the local distribution transformer by suppressing the excessive loading, which reaches nearly 160 % without using HEMS during peak periods while HEMS drastically reduces this value to about 87% (21.8 kW), as shown in Fig. 15. This reduction will alleviate the transformer aging acceleration and, as a result, extends the distribution transformer lifetime. The proposed technique then succeeded in reaching a ''win-win situation'' for both homeowners and the distribution network.

VII. CONCLUSION
This paper proposed a comprehensive home energy management system to deal with economic charging, urgent charging between trips, and discharging activities of EVs in houses that are not integrated with RES nor ESS. The proposed strategy reduces the daily energy cost, PAR, and inhibits the overloading of local distribution transformer, which maintains the transformer health. With considering the battery degradation factor, the proposed strategy also investigates the economic feasibility of EV home discharging activities. Simulations studies on a neighborhood with three houses with different occupancy and different customer load profiles were carried out to study the proposed strategy's performance. From the system operators' point of view, the HEMS proposed strategy completely prevents the local distribution transformer from exceeding its capacity limit with around 45% percentage reductions in PAR of all houses. Thus, the proposed strategy directly affects the distribution sector since it prevents loading limit violation of the local distribution transformer. On the other hand, from the users' point of view, the proposed strategy achieved around a 12% reduction in the daily energy cost with different daily situations.
In addition, the proposed strategy can assess the feasibility of home discharging activities and prevent it if required. In the near future, the expected substantial drop in battery prices and increase in energy prices will encourage the exploitation of EVs in HEMS. Finally, this work is only valid for smart houses that do not sell energy to the power grid. As a future business, the proposed strategy could be upgraded to apply to houses that exchange energy between themselves in the same neighborhood or to houses that exchange energy with the local grid.