Power Scheduling Scheme for DSM in Smart Homes with Photovoltaic and Energy Storage

: This article presents a case study of a single-family house with several photovoltaic micro-installations oriented in different directions, in which the energy electricity storage systems have been operating for several months. In the house, the heat source is the air–water heat pump cooperating with heat buffers. The ﬁrst photovoltaic installation was installed in 2016 and, in the subsequent ﬁve years, was expanded using microinverters. The ﬁnal amount of energy from photovoltaics covers 50% of the energy demand of the building. The procedure for dealing with technical and economic aspects was presented, allowing us to determine whether it is proﬁtable to install energy storage in the given conditions of energy prices, equipment efﬁciency, and prices, as well as government support. This paper presents the effects of the designed and built home energy management system that supervises energy storage in heat and batteries, mainly through its impact on the self-consumption of energy from the photovoltaic system and on ﬁnal costs. Comparative calculations were performed with the demand-side management, which dictated the instantaneous energy costs. Attention was paid to the possibility of obtaining a high self-consumption, but the economic calculations showed that it was not always beneﬁcial. An annual self-consumption increased by approximately one-sixth upon installation of the electrical energy storage system and by one-third from the start of use of the home energy management system. Concurrently, by utilising energy storage in heat and batteries, almost 95% of energy was consumed in the cheapest multi-zone tariff. The impact of inverters and battery charging systems on the power grid is also presented. Often, when the active energy was nearing zero, the capacitive reactive energy was signiﬁcant.


Introduction
One of the main challenges world economies and scientific research focus on is the reduction of fossil fuel dependency due to their fluctuating market prices, which compromise the stability of the world's economy and the harmful emissions they cause. In order to reduce the share of energy originating from fossil fuels and simultaneously increase the share of renewable energy sources and an energy storage of both a small and large scale is required. A variety of accumulation solutions are currently being subjected to numerous tests in order to improve storage efficiency. The least costly method of accumulating energy storage is heat storage. However, it is limited in versatility and its efficiency peaks at low outside temperatures, making it dependent on the climate and geography. Analysis showed that the cost of investment in heat storage is a quarter of its equivalent in electricity storage [1]. Heat storage in domestic hot water buffer (DHWB) and heating water buffer is economically beneficial but does not allow for the use of energy in form other than heat. In buildings with a photovoltaic system (PVS), the main goal is to ensure as high a selfconsumption coefficient (SC) as possible. Accumulation of energy in batteries could allow for reduction of the peak energy exported to the grid by creating a buffer that separates the production from its consumption. A substantial drawback of energy storage is that it is not yet profitable for prosumers with the absence of public support system [2]. The Energy Transformation Programme in Europe promotes renewable energy and shifting from coal to gas. A shortage of natural gas as a result of the pandemic and the lack of wind increased electricity prices [3]. In 2021, electricity prices in the European Union have soared. In July of that year, most countries experienced a 1.5-year-long record in wholesale prices [4].
PVS costs have been falling in line with forecasts until the pandemic, but those of the energy electricity storage systems (EESS) are still high, over 200 EUR/kWh [5]. The cost projection shows an increase from 28% to even 58% of capital cost reductions by 2030. High energy prices and a drop in the EESS prices contribute to their increasing popularity.
Distribution system operators (DSOs) have a significant influence on energy prices. Their method portfolio consists of instruments through which they can manipulate the demand for electricity: demand-side management (DSM) and demand-side request (DSR). In Poland, the DSR system is still not available for individual consumers [6]. The only mechanism that households can use is DSM in the form of time-based tariffs. Potentially, it is possible to use DRS if an energy cluster is established in an energy community. An example of which in Poland is an energy cluster in which energy self-sufficiency can almost be achieved. It is much easier to implement the concept of a smart grid within it.

Review of the Literature
In article [7], the new model considering the Real-Time Demand Response Pricing scenario in the smart grid was tested. The Pricing Suggestion Unit was proposed based on a real-time pricing algorithm by considering users' preferences using stochastic optimisation techniques, better than real-time pricing. This system suggests to the end-users when they should turn on their load, but the final decision belongs to the people, not the machine.
Article [8] proposes a realistic scheduling mechanism to reduce user frustration and enhance appliance utility by classifying appliances with respective constraints and their time-of-use effectively. Algorithms are proposed regarding the functioning of home appliances. A 24 h time slot was divided into four logical sub-time slots, each composed of 360 min, or 6 h.
For the end-user, and for the DSO, when they make the decisions, there are a few evaluation criteria. They are almost identical for both sides. However, the importance is different. These criteria are: energy security, power reliability, and secondly investment and operating costs. There are several methods for decision making, from the simple weighted sum method [9,10], to multicriteria decision analysis optimisation approaches [11,12].
Paper [13] proposed the model which aims to optimise three different criteria: minimising electricity costs, reducing the probability of power loss, and maximising the use of locally available renewable energy. It was shown that lithium iron phosphate and lithium nickel cobalt alumina were the leaders among the five battery technologies. For the calculations used the Metaheuristic Canonical Differential Evolutionary Particle Swarm optimisation, proposed previously in article [14], which merges distinct principles of evolutionary computation and swarm intelligence.
There are three main goals for designing hybrid microgrid systems in the literature. Firstly, to minimise the cost of electricity per unit generated [15]; secondly, to minimise the loss of load probability or breakdowns [16]; and thirdly, to maximise the share of renewable energy sources in electricity generation [17].
Systems that will have optimal scheduling are possible to be designed and built, which is a requirement for current and future microgrids [18], but end-user optimisation would be the best option. The desired goal of the system's operation is to reduce the peaks of both the consumed energy and the energy fed into the network [19][20][21]. These are the most requested features by DSOs. All the proposed solutions are not simple enough in terms of user-friendliness and are yet to be implemented on a large scale in households.
There are publications that propose models that coordinate the benefits of households and utility operators. The results revealed a 38% reduction in the electricity consumption cost and an 18% reduction in peak demand of the distribution transformer [22]. In article [21], the authors made appliance classification as: non-deferrable (home lightings, Energies 2021, 14, 8571 3 of 20 washing machine), interruptible (water heater, iron), and must-run loads (TV, PC). The interruptible appliances have sequences of operations that can be interrupted. Must-run loads must be run immediately at any time, and these appliances must be run at any cost. This division assumes that the devices will be used as designed by the producer. For some devices, it is possible to temporarily interrupt the energy supply, too, e.g., heaters, which would not be of significant importance to the user. Ovens, washing machines, dishwashers and kettles are such devices. Had they been equipped with the internet of things (IoT), it would have been much easier to manage energy and reduce the peak-to-average (PAR) ratio. Another way to allow for uninterrupted functioning of devices while temporarily depriving them of external power supply is to equip them with an energy buffer, i.e., a battery or a supercapacitor. This solution could be used by almost all low-power devices that are powered by a direct current of several volts. We use cell phones, laptops, and battery-powered tools that allow for a number of hours of such work on a daily basis. Theoretically, any electrical equipment could have an energy buffer. Here it is merely an idea. It is conceivable that instead of building large EESS, it would be easier and cheaper to manage the energy of small loads using IoT.

Motivations
Unfortunately, contrary to their declared goal, most DSM mechanisms do not encourage consumers to actively manage energy [23]. There exists a prosumer support system in the form of feed-in tariffs in European countries. The increase in energy production from renewable energy sources resulted in a reduction in the feed-in tariffs [24], which prompted prosumers to increase auto-consumption [25]. In Poland, there is a system called rebates, which is based on net metering [1]. The prosumer can feed energy into the DSO grid and receive this energy during the year. The cost to the prosumer is 30% of the energy for a photovoltaic system (PVS) over 10 kWp but not exceeding 50 kWp, or 20% of energy for PVS under 10 kWp.
If the distribution grid acts as an energy storage, then prosumers who have concluded 15-year contracts with the DSO will not be interested in investing in the EESS at all. Most prosumers in Poland, whose installations allow for the annual balance of energy generated in PVS and used in the building, use the G11 tariff. However, according to the new governmental proposals, the new contracts concluded with DSOs will be less beneficial to prosumers. Surplus energy will be resold to the grid at wholesale prices, almost twice lower than the costs of its purchase. This is expected to increase SC, also through the accumulation of energy in the EESS. Calculations will be performed considering the new conditions. The authors of [1] showed the impact of heat accumulation on the COP and SC. The additional effect of reducing electricity costs (CE) was achieved through load shifting and the multi-zone tariff. In the building, the SC reached a high level of 46% during the heating season. However, in the summer season, due to limited possibilities of energy accumulation, it was low and amounted to 32%. This was one of the reasons for the decision to invest in an accumulation system based on batteries. Before this happened, however, a preliminary economic analysis was made.
Usually, no attention is paid to the kind of energy, active and reactive, consumed by home equipment, especially in an intelligent home. In the presented house, there are over 30 control devices, such as temperature controllers, roller shutters, garage gate, intercom, intelligent lighting and others. Their power is only 3-5 W each, but they draw about 160 W active power and 280 VAr reactive power together. If powered from the EESS, the DC load of batteries is 250 W. These devices consume 1.4 MWh energy per year when powered from the grid, but if we would like to power them only by night from the EESS, they would have taken about 1 MWh instead of 0.7 MWh. The most common proposal is to use the energy stored in the batteries during the night hours. It turned out not to be cost-effective, as will be shown later in the article. Often during analyses, catalogue values of the efficiency of energy converting devices (inverters, chargers, converters, batteries) are adopted [26,27], although these are usually the highest values that the device can achieve. However, during operation, these devices very rarely operate at the nominal (maximum) powers. This leads to a reduction in their actual effectiveness. When calculating economic indicators, real efficiencies are necessary to be able to make rational decisions. Therefore, the efficiencies of the energy accumulation system were determined based on measurements.
The next three chapters describe the steps to achieve the described end results. Section 7 presents forecasts of potential benefits, and Section 8 the actual results. Section 9 presents some reflections related to overvoltage and reactive power that have arisen during the research. This problem is merely highlighted, which is a contribution to further research and publications.

Home Energy Management System
Prosumers can import and export energy at the same time when the building has a three-phase electrical installation. In the studied building, the first energy meter installed by the OSD performed vector summation mode (Ferraris mode) and balanced both energy streams before counting them in registers. After the expansion of the PVS in November 2018, the OSD replaced the energy meter with an implemented algebraic summation mode, which does not balance energy between phases before it is counted [1]. This has a financial effect. Each unbalanced energy unit is a loss of 20% of its value. To reduce these negative effects, the HEMS was designed and implemented. Depending on the instantaneous power balance, it switched the installation circuits under load in such a way as to maximise autoconsumption. A new approach is active load management by switching the load circuits and controlling the battery charging power. The HEMS was intended to lower electricity bills by increasing self-consumption. Prior to the launch of the HEMS, there was a system that controlled the following: the heat accumulation in water buffers, heat distribution, and the air-water heat pump (AWHP) work [1]. Although the PVS is three-phase, it consists of one main inverter and four single-phase microinverters. Photovoltaic (PV) panels are oriented in different directions and at different slopes. One of them has a simple one-axis tracker. They were originally connected to different phases. The AWHP and the main PV inverter are connected to the same power phase. An example of the power generated in June 2020 is shown in Figure 1. would have taken about 1 MWh instead of 0.7 MWh. The most common proposal is to use the energy stored in the batteries during the night hours. It turned out not to be costeffective, as will be shown later in the article. Often during analyses, catalogue values of the efficiency of energy converting devices (inverters, chargers, converters, batteries) are adopted [26,27], although these are usually the highest values that the device can achieve. However, during operation, these devices very rarely operate at the nominal (maximum) powers. This leads to a reduction in their actual effectiveness. When calculating economic indicators, real efficiencies are necessary to be able to make rational decisions. Therefore, the efficiencies of the energy accumulation system were determined based on measurements.
The next three chapters describe the steps to achieve the described end results. Chapter 7 presents forecasts of potential benefits, and Chapter 8 the actual results. Chapter 9 presents some reflections related to overvoltage and reactive power that have arisen during the research. This problem is merely highlighted, which is a contribution to further research and publications.

Home Energy Management System
Prosumers can import and export energy at the same time when the building has a three-phase electrical installation. In the studied building, the first energy meter installed by the OSD performed vector summation mode (Ferraris mode) and balanced both energy streams before counting them in registers. After the expansion of the PVS in November 2018, the OSD replaced the energy meter with an implemented algebraic summation mode, which does not balance energy between phases before it is counted [1]. This has a financial effect. Each unbalanced energy unit is a loss of 20% of its value. To reduce these negative effects, the HEMS was designed and implemented. Depending on the instantaneous power balance, it switched the installation circuits under load in such a way as to maximise auto-consumption. A new approach is active load management by switching the load circuits and controlling the battery charging power. The HEMS was intended to lower electricity bills by increasing self-consumption. Prior to the launch of the HEMS, there was a system that controlled the following: the heat accumulation in water buffers, heat distribution, and the air-water heat pump (AWHP) work [1]. Although the PVS is three-phase, it consists of one main inverter and four single-phase microinverters. Photovoltaic (PV) panels are oriented in different directions and at different slopes. One of them has a simple one-axis tracker. They were originally connected to different phases. The AWHP and the main PV inverter are connected to the same power phase. An example of the power generated in June 2020 is shown in Figure 1.  In HEMS Version 0, which started in April 2019, only the microinverters could have been connected to different phases, and it is possible to connect them all to the same phase as the AWHP. However, switching occurs only when the AWHP starts and the power consumed by it exceeds the power generated by the main inverter. The switching of microinverters caused only small energy losses as they started up relatively quickly (in under 1 min). The current HEMS (Version 1), which has been working since November 2019, additionally controls five load circuits. One of them contains the AWHP, the second the battery charger, and the remaining three are the building installations. An example of energy flows during the cooperating HEMS and EESS is shown in Figure 2.
consumed by it exceeds the power generated by the main inverter. The switching of microinverters caused only small energy losses as they started up relatively quickly (in under 1 min). The current HEMS (Version 1), which has been working since November 2019, additionally controls five load circuits. One of them contains the AWHP, the second the battery charger, and the remaining three are the building installations. An example of energy flows during the cooperating HEMS and EESS is shown in Figure 2.
On this day, the energy generated by PVS was 15.0 kWh, the energy taken from the grid, 13.9 kWh, the energy exported to the grid, 2.8 kWh, and the daily SC was 81%. The annual effects of HEMS' working are presented in Figure 3. It shows the cumulative SC in 2019, 2020, and 2021. The timeline shows the moments of power changes in PVS, the HEMS and the EESS commissioning. In the year following the launch of the HEMS, the SC grew by 1/6 from 34.7% to 40.5%. There is also a visible increase in the SC caused by the EESS.  The cost of introducing the HEMS was omitted as load control systems already existed. It was only necessary to add a load switching module to the software. Measurement On this day, the energy generated by PVS was 15.0 kWh, the energy taken from the grid, 13.9 kWh, the energy exported to the grid, 2.8 kWh, and the daily SC was 81%. The annual effects of HEMS' working are presented in Figure 3. It shows the cumulative SC in 2019, 2020, and 2021. The timeline shows the moments of power changes in PVS, the HEMS and the EESS commissioning. In the year following the launch of the HEMS, the SC grew by 1/6 from 34.7% to 40.5%. There is also a visible increase in the SC caused by the EESS. In HEMS Version 0, which started in April 2019, only the microinverters could have been connected to different phases, and it is possible to connect them all to the same phase as the AWHP. However, switching occurs only when the AWHP starts and the power consumed by it exceeds the power generated by the main inverter. The switching of microinverters caused only small energy losses as they started up relatively quickly (in under 1 min). The current HEMS (Version 1), which has been working since November 2019, additionally controls five load circuits. One of them contains the AWHP, the second the battery charger, and the remaining three are the building installations. An example of energy flows during the cooperating HEMS and EESS is shown in Figure 2.
On this day, the energy generated by PVS was 15.0 kWh, the energy taken from the grid, 13.9 kWh, the energy exported to the grid, 2.8 kWh, and the daily SC was 81%. The annual effects of HEMS' working are presented in Figure 3. It shows the cumulative SC in 2019, 2020, and 2021. The timeline shows the moments of power changes in PVS, the HEMS and the EESS commissioning. In the year following the launch of the HEMS, the SC grew by 1/6 from 34.7% to 40.5%. There is also a visible increase in the SC caused by the EESS.  The cost of introducing the HEMS was omitted as load control systems already existed. It was only necessary to add a load switching module to the software. Measurement The cost of introducing the HEMS was omitted as load control systems already existed. It was only necessary to add a load switching module to the software. Measurement data, i.e., voltages, currents, active and apparent powers of all separated circuits, including inverters, are made in 10 s intervals and saved as five-minute averages. Therefore, it will not be included in the economic analysis of its implementation. If three-phase balancing had taken place during the settlements with DSO, there would have been no need to build it. However, this system realises a real increase in self-consumption. The SC based on vector-mode meters does not consider real energy flows.

Efficiency of the Electric Energy Storage Systems
The EESS is dedicated to off-grid or hybrid systems. Off-grid systems do not collaborate with the grid, and they shall not be analysed in this article. Nowadays, there are two types of hybrid systems available on the market. The first type works with low-voltage batteries, and the second collaborates with high-voltage batteries, but the differences are more significant. The main difference is in the location of the batteries in the electricity conversion chain and the number of DC/AC converters. Placing a high-voltage battery downstream of the MPPT and before the DC/AC converter simplifies the construction and eliminates the need for voltage reduction to 24 or 48 V. This results in greater efficiency of the inverter. Alas, the inverters for the studied house were purchased long before hybrid inverters with high-voltage batteries were available. Paramount importance was given to the investment costs. A hybrid inverter was used as a battery charger and DC/AC converter, which enabled the control of electrical parameters, such as the charge and discharge current state, battery voltage, and battery charge status. It turned out that these measurements were deficient in accuracy. Therefore, additional direct voltage and alternating voltage energy meters were installed to accurately determine the efficiency of the EESS.
If the efficiency was calculated from Equation (1) assuming the catalogue data, where the charger efficiency, EF CHG , is 95% and the AC/DC inverter efficiency, EF I NV , is 93%, the total efficiency, EF BAT , would be 88%. In the period of a few days, the efficiency of battery storage, EF ACC , can be assumed as 100%.
(1) Figure 4a shows the EESS efficiency calculated as the amount of output energy versus input energy, both measured on the AC side. After eight months of operation, the efficiency of the EESS stabilised at 72%.
Energies 2021, 14, x FOR PEER REVIEW 6 of 20 data, i.e., voltages, currents, active and apparent powers of all separated circuits, including inverters, are made in 10 s intervals and saved as five-minute averages. Therefore, it will not be included in the economic analysis of its implementation. If three-phase balancing had taken place during the settlements with DSO, there would have been no need to build it. However, this system realises a real increase in self-consumption. The SC based on vector-mode meters does not consider real energy flows.

Efficiency of the Electric Energy Storage Systems
The EESS is dedicated to off-grid or hybrid systems. Off-grid systems do not collaborate with the grid, and they shall not be analysed in this article. Nowadays, there are two types of hybrid systems available on the market. The first type works with low-voltage batteries, and the second collaborates with high-voltage batteries, but the differences are more significant. The main difference is in the location of the batteries in the electricity conversion chain and the number of DC/AC converters. Placing a high-voltage battery downstream of the MPPT and before the DC/AC converter simplifies the construction and eliminates the need for voltage reduction to 24 or 48 V. This results in greater efficiency of the inverter. Alas, the inverters for the studied house were purchased long before hybrid inverters with high-voltage batteries were available. Paramount importance was given to the investment costs. A hybrid inverter was used as a battery charger and DC/AC converter, which enabled the control of electrical parameters, such as the charge and discharge current state, battery voltage, and battery charge status. It turned out that these measurements were deficient in accuracy. Therefore, additional direct voltage and alternating voltage energy meters were installed to accurately determine the efficiency of the EESS.
If the efficiency was calculated from Equation (1) assuming the catalogue data, where the charger efficiency, , is 95% and the AC/DC inverter efficiency, , is 93%, the total efficiency, , would be 88%. In the period of a few days, the efficiency of battery storage, , can be assumed as 100%.
(1) Figure 4a shows the EESS efficiency calculated as the amount of output energy versus input energy, both measured on the AC side. After eight months of operation, the efficiency of the EESS stabilised at 72%.

Energy Costs as the Basis for Decisions
One might ask if battery storage is profitable. In order to answer this question, several calculations have been made. The conducted analysis takes current increases in energy prices into consideration. A discount rate r = 0 was also assumed. The result of the calculations is given as the mean 20-year cost and as a percentage change in the cumulative costs.
Firstly, the EESS expenditure was calculated. The EESS was built with ready components: batteries LiFePo4 (200 Ah, 52 V), battery management system (BMS) 125 A, a battery charger and DC/AC inverter (a hybrid invert 5 kVA was used). With additional equipment, the total cost was EUR 2480, or approximately 240 EUR/kWh. At the beginning, the maximum amount of energy that could be accumulated in the batteries in the period of twenty years was estimated. The number of full battery cycles is 4000, which corresponds to eleven years. The batteries could be operating for twenty years, with an average load of 60% in such a cycle. During this time, the battery capacity will decrease by 20%, so the annual capacity reduction ratio is 0.9883. During this period, the batteries could have stored 41.6 MWh. Considering the investment costs and the EESS efficiency, the average unit energy cost will be 93.5 EUR/MWh.
Batteries can be charged with both PVS and utility power. Solar energy itself is free of charge. However, current methods of its collection can be costly. In the studied building, EUR 3300 was invested in PVS (accounting for the tax relief). The installation's capacity is 5.07 kWp, and the investment cost was around 650 EUR/kWp. Considering the measurements made so far and the reduction in PVS efficiency, collected solar energy in twenty years will be 69.6 MWh. The average unit cost of obtaining energy will be 47.5 EUR/MWh.
Finally, an average twenty-year cost of purchased energy should be determined. In Poland, there various scenarios of electricity prices are forecasted, depending on the costs of the energy transition. One such realistic scenario is presented in the study [28]. It presents four circumstances for the development of coal-based generation capacity, the diversification of sources with and without nuclear energy, and the dynamic development of renewable energy sources. Wholesale price forecasts in the form of graphs are shown in Figure 5. Retail prices are derived from average wholesale prices, and it has been assumed that their annual changes will be the same.
Energies 2021, 14, x FOR PEER REVIEW 7 of 20 respectively = 85.9% and = 83.8%. This is due to the fact that most of the time, the charging current does not exceed 20 A, and the load fluctuates around 500 W.

Energy Costs as the Basis for Decisions
One might ask if battery storage is profitable. In order to answer this question, several calculations have been made. The conducted analysis takes current increases in energy prices into consideration. A discount rate r = 0 was also assumed. The result of the calculations is given as the mean 20-year cost and as a percentage change in the cumulative costs.
Firstly, the EESS expenditure was calculated. The EESS was built with ready components: batteries LiFePo4 (200 Ah, 52 V), battery management system (BMS) 125 A, a battery charger and DC/AC inverter (a hybrid invert 5 kVA was used). With additional equipment, the total cost was EUR 2480, or approximately 240 EUR/kWh. At the beginning, the maximum amount of energy that could be accumulated in the batteries in the period of twenty years was estimated. The number of full battery cycles is 4000, which corresponds to eleven years. The batteries could be operating for twenty years, with an average load of 60% in such a cycle. During this time, the battery capacity will decrease by 20%, so the annual capacity reduction ratio is 0.9883. During this period, the batteries could have stored 41.6 MWh. Considering the investment costs and the EESS efficiency, the average unit energy cost will be 93.5 EUR/MWh.
Batteries can be charged with both PVS and utility power. Solar energy itself is free of charge. However, current methods of its collection can be costly. In the studied building, EUR 3300 was invested in PVS (accounting for the tax relief). The installation's capacity is 5.07 kWp, and the investment cost was around 650 EUR/kWp. Considering the measurements made so far and the reduction in PVS efficiency, collected solar energy in twenty years will be 69.6 MWh. The average unit cost of obtaining energy will be 47.5 EUR/MWh.
Finally, an average twenty-year cost of purchased energy should be determined. In Poland, there various scenarios of electricity prices are forecasted, depending on the costs of the energy transition. One such realistic scenario is presented in the study [28]. It presents four circumstances for the development of coal-based generation capacity, the diversification of sources with and without nuclear energy, and the dynamic development of renewable energy sources. Wholesale price forecasts in the form of graphs are shown in Figure 5. Retail prices are derived from average wholesale prices, and it has been assumed that their annual changes will be the same. Wholesale energy prices are projected to increase by 90% to 130% over a twenty-year period. Achieving this price level means an average annual increase in electricity prices of 6.4% to 8%. The calculations also considered the very optimistic average price increase over the last four years, amounting to 4.8%. The calculations were made for the used Wholesale energy prices are projected to increase by 90% to 130% over a twenty-year period. Achieving this price level means an average annual increase in electricity prices of 6.4% to 8%. The calculations also considered the very optimistic average price increase over the last four years, amounting to 4.8%. The calculations were made for the used multi-zone G13 tariff. Table 1 presents time zones in G tariffs for OSD Tauron. Only for multi-zone tariffs may it be profitable to recharge batteries not solely with solar energy. multi-zone G13 tariff. Table 1 presents time zones in G tariffs for OSD Tauron. Only for multi-zone tariffs may it be profitable to recharge batteries not solely with solar energy.  T1   T2  T2   T2   T3  T3   T3   …  6  7   T1  T1  8  T1  T1  …  13  T2  14  T2  T3  T3   15   T1   16   T1   17   T2  …  20  T2  21  22  T3  23  T2  T2  T3  24 * also on public holidays. Table 2 shows the prices of consumed energy and the percentage use of energy in each time zone over the last four years. The share of consumed energy in the cheapest T3 zone increases yearly. This is the result of energy accumulation. The calculated average energy prices over the period of twenty years for three variants of its average annual growth: 4.8%, 6.4% and 8% are presented in Table 3. The energy share of particular time zones was assumed as in 2021. * also on public holidays. Table 2 shows the prices of consumed energy and the percentage use of energy in each time zone over the last four years. The share of consumed energy in the cheapest T3 zone increases yearly. This is the result of energy accumulation. The calculated average energy prices over the period of twenty years for three variants of its average annual growth: 4.8%, 6.4% and 8% are presented in Table 3. The energy share of particular time zones was assumed as in 2021. This table also presents the wholesale energy price because, from 2022, prosumers will sell surplus energy to DSOs at wholesale prices. In the bill project, it is called net-billing.
In line with the current net-metering billing system, a prosumer can recover 80% of the energy fed into the grid. The unit cost of this recovered energy corresponds to the average price of purchased energy. Accounting for the efficiency of the EESS, it seems the energy storage in the net-metering billing system will be unprofitable. Using the calculations made, the cost-effective use of the EESS can be determined. Table 4 shows the energy prices for various combinations of charging sources in comparison to utility energy prices. The efficiency of the EESS was accounted for in the calculation. Considering current prices, the most profitable scenario is charging batteries from PVS and discharging them in the T2 zone tariff. What is also profitable is charging batteries from the grid in the T3 zone and discharging them in the T2 zone tariff. Charging the batteries with solar energy and using them in zones T1 and T3 is not profitable.
Considering the average twenty-year price of energy (with assumption, that energy costs in the zones will not be flattened), it will be profitable to use solar energy stored in batteries in the T2 tariff zone. It will be profitable to charge the batteries from the grid in the cheapest T3 zone and use it in the more expensive zones T1 and T2 and also charge in the T1 zone and discharge in the T2 zone. The conclusions from the price analysis are more visible in Table 5. Profitable combinations have a negative percentage change, which means that the energy stored in the battery from the indicated source is cheaper than the energy from the grid in the given tariff zone. Columns for which neither variant is profitable are not shown.

Potential Profits
Considering the previous analysis, the calculations were made for two scenarios and, within them, two variants. The first scenario is the current net-metering billing system, and the second is the future net-billing system when surplus energy would be sold at wholesale prices. The first variant assumes that the electricity is not taken from the grid in the T2 zone tariff for the entire year. The latter variant means that the same was assumed for both T1 and T2 zones. This means that energy will be taken from the grid only in the T3 tariff, both for current needs and for charging the battery. Data collections used for calculations, i.e., imported and exported energies, energy from PVS and the SC are presented in the graphical form on Figures 6-8. Monthly summary of the data is presented in Table 6.
for calculations, i.e., imported and exported energies, energy from PVS and the SC are presented in the graphical form on Figures 6-8. Monthly summary of the data is presented in Table 6.    in the T3 tariff, both for current needs and for charging the battery. Data collections used for calculations, i.e., imported and exported energies, energy from PVS and the SC are presented in the graphical form on Figures 6-8. Monthly summary of the data is presented in Table 6.    In the winter months, the amount of energy exported to the grid is lower than that taken from the grid in each of the T1 and T2 time zones. In order not to consume energy in zones T1 and T2, the missing energy will have to be replenished from the grid in the T3 zone, charging the batteries there. In the winter months, the amount of energy exported to the grid is lower than that taken from the grid in each of the T1 and T2 time zones. In order not to consume energy in zones T1 and T2, the missing energy will have to be replenished from the grid in the T3 zone, charging the batteries there.
In the first scenario, the energy cost, EC, was calculated in accordance with Equation (2) for the year 2020. These are not only the current costs incurred but also ones related to the amortisation of investments in the PVS and the EESS.
The annual energy cost, EC, was calculated according to Equation (3) in the first variant and in accordance with Equation (4) in the second one. In the second scenario, the annual energy cost was calculated according to almost the same equations; the only difference is in the last part of the expressions, where instead of income from energy sent to the network as a rebate, is income for electricity supplied to the grid at wholesale price. Instead of the expression × , it is .
where: -energy component i -unit cost energy of component i k-factor rebate 0.8 p-share of energy obtained from PVS in winter months (in other p = 1)  In the first scenario, the energy cost, EC, was calculated in accordance with Equation (2) for the year 2020. These are not only the current costs incurred but also ones related to the amortisation of investments in the PVS and the EESS.
The annual energy cost, EC, was calculated according to Equation (3) in the first variant and in accordance with Equation (4) in the second one. In the second scenario, the annual energy cost was calculated according to almost the same equations; the only difference is in the last part of the expressions, where instead of income from energy sent to the network as a rebate, is income for electricity supplied to the grid at wholesale price. Instead of the expression k × Uc grid avg , it is Uc whp .
where: When determining the unit costs, Uc, the energy conversion chain was included. For example, the unit energy cost from the EESS is the sum of the costs depending on the charging source, grid Uc grid T3 or PV energy Uc PV and storage Uc BAT . The impact of different options for accumulation on the annual energy costs in the described building is shown in Table 7. Profitable options have a negative percentage change in the cost of energy. It would seem that, accounting for the data in Table 5, it should be profitable to use energy from PVS and stored batteries in zones T1 and T2. However, this is not the case as the EESS accumulation efficiency is less than 0.8, which is less than the rebate value. Unfortunately, lowering the average energy cost reduces the benefits of transferring excess electricity to the grid. The Equations (1)-(3) can be used to control the EESS, deciding whether to charge the battery from two sources simultaneously, meaning from PVS and grid.
Using the same data collections, it is also possible to calculate the maximum SC coefficient, Φ, based on Equations (5) and (6).
The conclusion of these calculations is that limiting the export of energy in the zones T1 and T2 by charging the batteries can maximally increase the SC for the first variant to 57.6% and for the second variant to 64.4%. Only for prosumers in the new net-billing system would the second variant be profitable while investing in the EESS.

Profits from the Operation of the HEMS and the EESS
The HEMS system has been operating since November 2019. From the beginning of April 2021, the EESS was installed and launched. The research was conducted under the first scenario, in which the surplus of non-consumed PV energy was stored in batteries and then used in the T2 time zone, in which energy is the most expensive. There are some limitations associated with charging and discharging of batteries, which were implemented at the HEMS, which controlled the EESS: The battery charging current can be set as stepwise with the minimum current of 2 A, the next values being 10 A and its multiples up to 80 A. - The charger is only turned on when the excess PV power over the instantaneous consumption exceeds 200 W. The batteries are then charged with a current of 2 A. The charging efficiency for this current is exceptionally low (65%). - Batteries are charged to 94-95% of their capacity (after reaching the absorption voltage), which will extend their life. In addition, the overall efficiency of the EESS also increases due to the reduction of the charging time with a low current. The results of three-year measurements of the SC are presented in Figure 9. Each of the actions (introduction of HEMS and EESS) taken increased the SC. The cumulative yearly SC is already presented in Figure 3. The charger is only turned on when the excess PV power over the instantaneous consumption exceeds 200 W. The batteries are then charged with a current of 2 A. The charging efficiency for this current is exceptionally low (65%).  Batteries are charged to 94-95% of their capacity (after reaching the absorption voltage), which will extend their life. In addition, the overall efficiency of the EESS also increases due to the reduction of the charging time with a low current.  Energy measurements and flow control are taken every 10 s.
The algorithm of operation of this system is based on the state machine. Its inputs are:  measured instantaneous powers consumed by five load circuits;  measured powers generated by five PV inverters;  24 h weather forecast in one-hour steps;  date and time;  system operation mode (manual/battery/auto)  electricity price forecast (current price/low/medium/high) Parameters of the state machine are:  determined unit energy cost for calculating price increase variants and current price Outputs of the three-state type control they switch:  four circuits of load;  four inverters circuits.
The results of three-year measurements of the SC are presented in Figure 9. Each of the actions (introduction of HEMS and EESS) taken increased the SC. The cumulative yearly SC is already presented in Figure 3. In Table 8, the SC for 2019, 2020 and 2021 are presented, divided into working and non-working days as well as the heating season and summer season. The same data is graphically shown in Figure 10 to better show the relationship between them.
In most cases, both of the introduced systems (HEMS and EESS) brought about similar effects, i.e., increased the SC. There were annual increases of 5-6% on working days. The increase in auto-consumption in the summer due to the EESS was more than twice as high as for the HEMS.
According to the estimates shown in the previous section, the investment into the EESS would not be profitable in the first scenario, except for the forecast with the highest Figure 9. Influence of the daily PV generation on the SC.
In Table 8, the SC for 2019, 2020 and 2021 are presented, divided into working and non-working days as well as the heating season and summer season. The same data is graphically shown in Figure 10 to better show the relationship between them. increase in energy prices. To compare the effects of the HEMS and EESS in the net-metering and net-billing billing systems, the cost of energy was calculated assuming the same amount of energy consumed and its price in 2019-2021. Results are shown in Table 9.   It can be seen that despite the increase in SC, energy costs have not decreased in the current net-metering system. The reason is, among others, that the increase in SC was indirectly reduced the average unit costs of exported and imported energy due to the reduction of energy consumed in zone T2. A slight drop in cost would take place if the future prosumer billing system were to apply. The energy cost of a future system would be 13% higher. However, when looking at the trends in Table 7, it can be concluded that the increase in energy prices will increase the profitability of energy accumulation. Table 10  In most cases, both of the introduced systems (HEMS and EESS) brought about similar effects, i.e., increased the SC. There were annual increases of 5-6% on working days. The increase in auto-consumption in the summer due to the EESS was more than twice as high as for the HEMS.
According to the estimates shown in the previous section, the investment into the EESS would not be profitable in the first scenario, except for the forecast with the highest increase in energy prices. To compare the effects of the HEMS and EESS in the net-metering and net-billing billing systems, the cost of energy was calculated assuming the same amount of energy consumed and its price in 2019-2021. Results are shown in Table 9. It can be seen that despite the increase in SC, energy costs have not decreased in the current net-metering system. The reason is, among others, that the increase in SC was indirectly reduced the average unit costs of exported and imported energy due to the reduction of energy consumed in zone T2. A slight drop in cost would take place if the future prosumer billing system were to apply. The energy cost of a future system would be 13% higher. However, when looking at the trends in Table 7, it can be concluded that the increase in energy prices will increase the profitability of energy accumulation. Table 10 shows the yearly actual energy flows and the purchase costs of energy without depreciation. Considering an increase in energy consumption, the energy costs decreased, particularly in 2021, by 5%. One might ask why the G11 tariff was not used. For comparison, the cost that would be incurred if it were used with the same SC as in the G13 tariff is presented in Table 11. Additionally, for the year 2021, energy costs were calculated assuming the maximum possible SC with the use of the EESS, assuming that surplus energy will be accumulated, but only as much as can be consumed. The reasons for choosing the G13 tariff are explained in article [1], but here the DSM benefits can also be seen as time-based multi-zone tariffs. The energy cost in the G13 tariff is about 40% lower than it would be in the G11 tariff.

Overvoltage and Reactive Power in Building
A growing number of the PVS, especially in the suburban areas, contributes to certain problems to the current grid system, such as shutdown due to overvoltage. Figure 11 shows the daily voltage changes collected in the summer season in a small housing estate in which 25% of buildings have photovoltaic installations. Each point represents a five-minute window in which the maximum value is determined. As can be seen, the permissible voltage of 253 V is frequently exceeded. Each such voltage excess results in the inverters being switched off. The problem, however, is not a recent phenomenon. The main cause is the insufficient capacity of distribution networks in suburban areas, which were designed as energy supply networks with low simultaneity factors. The energy provided by the sun is at its highest at the same time that the self-consumption is low. These hurdles might be overcome by modernising the network, which is expensive. Therefore, often, a cheaper solution is shaving off the peaks. One of the easiest to implement and most effective solutions is to turn on receivers with high power consumption, such as heaters in the DHWB or the AWHP. This solution, however, has a finite capacity to absorb excess energy.
A good yet costly solution is the EESS. Another one is reactive power compensation, which can help in some cases [29,30]. Almost all publications pay attention to inductive power compensation, even today [31]. Here, the problem is the capacitive reactive power. A large number of electronic devices can lead to the situation described here. The PVS and the EESS have, in many cases, a positive impact on the power grid, but there is also the negative impact related to the reactive power.
In prosumers' households, energy is usually recorded in four quadrants energy meters, in registers described by the QBIS code, as shown in Figure 12. The energy meter installed in the described building, unfortunately, does not record the exported reactive energy. Registers 7.8.0 and 6.8.0 are not available. For the illustration as big is the reactive power, Table 12 shows energies imported and exported. A better illustration can be obtained by calculation of the power factor cos(φ) and tan(φ). In zone T2, taken from the grid, active energy is exceptionally low because the amount of consumed energy is equal to the energy generated from the PVS, but capacitive reactive energy is noticeably high. The power factor is substantially low, equal to 0.013. Almost all publications pay attention to inductive power compensation, even today [31]. Here, the problem is the capacitive reactive power. A large number of electronic devices can lead to the situation described here. The PVS and the EESS have, in many cases, a positive impact on the power grid, but there is also the negative impact related to the reactive power.
In prosumers' households, energy is usually recorded in four quadrants energy meters, in registers described by the QBIS code, as shown in Figure 12. The energy meter installed in the described building, unfortunately, does not record the exported reactive energy. Registers 7.8.0 and 6.8.0 are not available. Almost all publications pay attention to inductive power compensation, even today [31]. Here, the problem is the capacitive reactive power. A large number of electronic devices can lead to the situation described here. The PVS and the EESS have, in many cases, a positive impact on the power grid, but there is also the negative impact related to the reactive power.
In prosumers' households, energy is usually recorded in four quadrants energy meters, in registers described by the QBIS code, as shown in Figure 12. The energy meter installed in the described building, unfortunately, does not record the exported reactive energy. Registers 7.8.0 and 6.8.0 are not available. For the illustration as big is the reactive power, Table 12 shows energies imported and exported. A better illustration can be obtained by calculation of the power factor cos(φ) and tan(φ). In zone T2, taken from the grid, active energy is exceptionally low because the amount of consumed energy is equal to the energy generated from the PVS, but capacitive reactive energy is noticeably high. The power factor is substantially low, equal to 0.013. For the illustration as big is the reactive power, Table 12 shows energies imported and exported. A better illustration can be obtained by calculation of the power factor cos(ϕ) and tan(ϕ). In zone T2, taken from the grid, active energy is exceptionally low because the amount of consumed energy is equal to the energy generated from the PVS, but capacitive reactive energy is noticeably high. The power factor is substantially low, equal to 0.013. Within contracts for the supply of energy to institutional consumers, it is allowed to consume the inductive, reactive energy with a tan(ϕ) not greater than 0.4. For a greater value, this will result in additional fees [32]. Charges are made for the consumption of the capacitive reactive energy, regardless of the power factor, but its cost is much higher than that of the active energy. Both consumers and prosumers pay for energy in municipal tariffs (flats, houses, and small enterprises can use tariffs G in Poland). They pay only for the active energy, and they do not know the effect of reactive power consumption. They are only interested in energy quality in an area important to them. The main parameter is the voltage range (without overvoltage) and with an uninterrupted power supply. Prosumers also want to generate and sell energy from their installations continuously.
The simple (but not free of cost) way to reduce the capacitive reactive power is to use low-power inductors. Simple calculations show that this way allows a reduction of the voltage drop on the building connection by 1-2 V and at the same time reduce the voltage drop in the power line by another 2-3 V.
A simple experiment was carried out with reactive power compensation in the building, known as shunt compensation. Only the capacitive reactive power was compensated with three compensation inductors of the powers 100, 250, and 500 VAr, allowing for an eight-step regulation. As there are no ready-made compensators with such low power, a prototype was built using the existing meter with an RS485 interface, modules for switching coils and a software module implemented in the HEMS. How the power factor varies without and with compensation is shown in Figure 13. The maximum voltages obtained in the period of 5 min are shown in Figure 14. In many cases, it is enough to keep the grid inverter from turning off.  Within contracts for the supply of energy to institutional consumers, it is allowed to consume the inductive, reactive energy with a tan(φ) not greater than 0.4. For a greater value, this will result in additional fees [32]. Charges are made for the consumption of the capacitive reactive energy, regardless of the power factor, but its cost is much higher than that of the active energy. Both consumers and prosumers pay for energy in municipal tariffs (flats, houses, and small enterprises can use tariffs G in Poland). They pay only for the active energy, and they do not know the effect of reactive power consumption. They are only interested in energy quality in an area important to them. The main parameter is the voltage range (without overvoltage) and with an uninterrupted power supply. Prosumers also want to generate and sell energy from their installations continuously.
The simple (but not free of cost) way to reduce the capacitive reactive power is to use low-power inductors. Simple calculations show that this way allows a reduction of the voltage drop on the building connection by 1-2 V and at the same time reduce the voltage drop in the power line by another 2-3 V.
A simple experiment was carried out with reactive power compensation in the building, known as shunt compensation. Only the capacitive reactive power was compensated with three compensation inductors of the powers 100, 250, and 500 VAr, allowing for an eight-step regulation. As there are no ready-made compensators with such low power, a prototype was built using the existing meter with an RS485 interface, modules for switching coils and a software module implemented in the HEMS. How the power factor varies without and with compensation is shown in Figure 13. The maximum voltages obtained in the period of 5 min are shown in Figure 14. In many cases, it is enough to keep the grid inverter from turning off.  Nowadays, all inverters have the option to set a fixed power factor value from −0.8 (cap.) to 0.8 (ind.). There are also inverters in which the power factor may vary (according to the segmental approximation) depending on the amount of generated power. The newest inverters can compensate for the reactive power during the operation. This functionality is, unfortunately, rarely used. Obviously, they are a bit more expensive as they require a measurement of the power factor or the reactive energy.

Summary and Conclusions
Presented calculations were made to determine whether and in what case the investment in the EESS could be profitable. The current prosumer support system (by net-metering) seems to be so attractive that it is difficult to convince them to invest in the EESS without significant additional support. It has been shown that in some cases, it is worthwhile to invest in an EESS when actively using DSM.
This article discusses impacts on the SC of two activities: the introduction of the HEMS and secondly the installation of the EESS. It has been shown that the algorithm implemented in the HEMS can significantly increase the SC. In the analysed building, for over 2019, the increase was 34.7%. Following the launch of the HEMS, the yearly SC increased to 40.5% in 2020. Using the EESS in 2021 resulted in a further increase in the yearly SC to 45%. This is a very good result as it amounts to 25% on average. For the case at hand, both the HEMS and the EESS have a positive impact on SC, but they will not reduce the energy cost consumed. The profitability of the investment depends largely on the efficiency of energy accumulation. All in all, this is beneficial given the forecast that the increase in energy prices will make energy accumulation profitable for already installed batteries. It must be remembered that both systems were experimentally built at a very low cost. In the year 2021 alone, a few reasonably priced commercial systems with hybrid energy storage appeared on the market, which signals a positive trend in the development of this industry An increasing nuisance for prosumers in Poland is the increasingly frequent shutdowns of inverters. Overvoltage caused by the PVS, which was still incidental in 2018, is already becoming a serious problem in the year 2021. Currently, Polish DSOs do not control micro-installations both below and up to 10 kWp, but new inverters that meet the requirements of the grid code are already prepared for this. However, there is no infrastructure that would allow for remote control of the generated power. For now, one of the best ways to increase grid stability is to shave energy peaks. The article also highlights the growing capacitive reactive power and presents its effects. Nowadays, all inverters have the option to set a fixed power factor value from −0.8 (cap.) to 0.8 (ind.). There are also inverters in which the power factor may vary (according to the segmental approximation) depending on the amount of generated power. The newest inverters can compensate for the reactive power during the operation. This functionality is, unfortunately, rarely used. Obviously, they are a bit more expensive as they require a measurement of the power factor or the reactive energy.

Summary and Conclusions
Presented calculations were made to determine whether and in what case the investment in the EESS could be profitable. The current prosumer support system (by net-metering) seems to be so attractive that it is difficult to convince them to invest in the EESS without significant additional support. It has been shown that in some cases, it is worthwhile to invest in an EESS when actively using DSM.
This article discusses impacts on the SC of two activities: the introduction of the HEMS and secondly the installation of the EESS. It has been shown that the algorithm implemented in the HEMS can significantly increase the SC. In the analysed building, for over 2019, the increase was 34.7%. Following the launch of the HEMS, the yearly SC increased to 40.5% in 2020. Using the EESS in 2021 resulted in a further increase in the yearly SC to 45%. This is a very good result as it amounts to 25% on average. For the case at hand, both the HEMS and the EESS have a positive impact on SC, but they will not reduce the energy cost consumed. The profitability of the investment depends largely on the efficiency of energy accumulation. All in all, this is beneficial given the forecast that the increase in energy prices will make energy accumulation profitable for already installed batteries. It must be remembered that both systems were experimentally built at a very low cost. In the year 2021 alone, a few reasonably priced commercial systems with hybrid energy storage appeared on the market, which signals a positive trend in the development of this industry An increasing nuisance for prosumers in Poland is the increasingly frequent shutdowns of inverters. Overvoltage caused by the PVS, which was still incidental in 2018, is already becoming a serious problem in the year 2021. Currently, Polish DSOs do not control micro-installations both below and up to 10 kWp, but new inverters that meet the requirements of the grid code are already prepared for this. However, there is no infrastructure that would allow for remote control of the generated power. For now, one of the best ways to increase grid stability is to shave energy peaks. The article also highlights the growing capacitive reactive power and presents its effects.
Energy storage is a solution that can be implemented, but, currently, it is not the most common practice in Poland. From the DSO point of view, the EESS is the more advantageous form, but as it has been shown, it is on the verge of profitability. Perhaps in the next announced support program for existing prosumers, the subsidies will be large enough to encourage investments into the accumulation of electric energy.