## 5 Simulation Scenarios and Results
In Figure 5a, during the low-price tariff (green rectangles), the EV can be charged from the supplying network. The charging rate additionally depends on the potential energy deficit the next day (due to weather conditions). The yellowish rectangle highlights the moment when the EV is being discharged even during the low-price tariff. This is due to another aim of the control algorithm, which is to keep the P\({}_{\text{net}}\) constant (whenever possible). If there is surplus energy from the PV, the charging rate changes dynamically. During the high-price tariff (orange rectangles), the P\({}_{\text{net}}\) can be minimized. The blueish rectangle highlights the period when the EV is charging and the ESS is discharging. It is possible because the ESS operation is based on the timer while the EV battery is controlled to consume the surplus energy from the PV. Figure 5: Scenario 2. EV connected to the prosumer installation during the whole analyzed duration. The controller schedules the operation of the EV battery controlling the SOC, too. In Figure 5b, one can note that during the V2H service, the EV SOC never drops below 20% or rises above 80%. Reserving the minimum SOC guarantees the needed EV range at all times and keeping it below the upper limit protects against overcharging. The greenish rectangles in Figure 5a,b highlight the moment when the discharging was stopped due to too low SOC\({}_{\text{EV}}\). Scenario 2 is quite unlikely (the vehicle is parked all the time) but shows the possibilities of energy management in the prosumer installations with a large ESS. In most cases, investing in such an ESS would not be reasonable from an economic point of view. However, in the case of the EV, the perspective is different. Scenario 3--the PV, the ESS and the EV connected, V2H services activated, the EV in the custom mode  
Scenario 3 (Figure 6) is the most real one. During the simulation, the EV is used for driving, so it is available for the V2H service only periodically when parking. As the EV battery storage is time-dependent, it means that the external controller must deal with the periods when the EV battery is not available due to driving and the changed SOC after each drive. The examples of the V2H operation are highlighted using colored rectangles:  
* The blueish color illustrates the custom mode (Figure 6a)--the EV user requested a specific SOC\({}_{\text{in}}\) (Figure 6b) and the time of departure. The EV battery SOC changes  
Figure 6: Scenario 3. Home installation operation with time-dependent storage. from the default 20% to the requested 70% (Figure 6b). The EV charging power is controlled so the P\({}_{\rm net}\) does not exceed the rated power of the main feeder (15 kW). * The black rectangles in Figure 6b illustrate the periods of driving. Since the V2H service is not available, the P\({}_{\rm net}\) can be negative (reverse power flow). * The yellowish color highlights the EV charging in the custom mode. However, in this case, the high PV generation resulted in additional energy transferred to the EV (which is acceptable as long as the upper threshold--80% is not exceeded). Consequently, at the moment of departure, the EV SOC is 55% instead of the requested 40% (SOC\({}_{\rm in}\)). Before the EV charging started, the system operated in the default mode so whenever it was possible, the EV battery was used for the V2H service. * The greenish color is used to show the \"priority\" charging during the default mode. After driving, the EV SOC dropped below 20% (Figure 6b). In such a case, V2H services must be disabled until the SOC reaches a lower threshold. Note that the custom mode can be easily extended to the \"fast-home\" charging option. The charging power might be increased if the external controller forces the ESS to discharge (override its default operating scheme) and the controllable loads are disabled (like the air-conditioning system or the washing machine, etc.). If the PV generation is high, the EV charging power might be significantly greater than the nominal power of the main feeder.