1. Introduction
Photovoltaic (PV) technology has evolved in recent decades into a major worldwide renewable generation technology [
1]. By the end of 2022, the global cumulative installed capacity of PV systems reached 1177 GW and experienced 25% growth compared to 2021 [
2]. Solar power contributes an increasing share of total electricity demand, accounting for 4.5% of global power production in 2022, up from 3.7% in the previous year. The reasons for this spectacular growth result from the unmatched versatility of PV technology, which can be applied in comparatively quickly deployed utility-scale projects at a competitive low cost and can generate energy for individual customers by means of rooftop micro-installations, increasing their self-sufficiency. Globally, the share of the rooftop segment has been growing continuously since 2018 and, in 2022, both marked segments were balanced, with 48% of new capacity on rooftops [
3]. One of the markets with the fastest growing segment of rooftop PV installations is Poland, where the growth has been primarily driven by prosumer systems below 50 kW. In 2022, Poland’s rooftop segment was responsible for 78% of the installed PV capacity. In the third quarter of 2023, there were more than 1,322,000 prosumer micro-installations in operation, with a total installed capacity of more than 10 GW [
4].
The economy, combined with growing ecological awareness, is the most common factor in the decision to install a prosumer PV source [
5]. On the other hand, the current regulatory framework favors self-consumption as the only economically viable model for rooftop PV installations [
6]. Considering this, prosumers should select the rated power of their PV plants so that their annual generation is approximately equal to the annual electricity consumption of their households [
7]. Since the capacity factor of the PV source is low (it ranges from 10% in Europe to 20% in Latin America [
8], and in Poland, it is about 11% [
9]), producing energy equal to the consumer’s annual demand requires the installation of a PV source of sufficiently large power rating. With an average annual consumption in the EU household sector of 1671 kWh per capita [
10], the power of a PV source should be equal to 1.9 kW per capita. The PV micro-installation capacity determined in this way is much larger than a typical household load [
11]. In addition, load and generation profiles are usually divergent [
12]. As a result, most of the energy produced is fed into the power system to be taken back from it later.
The high penetration of PV micro-installations can have a negative impact on the operation of distribution networks [
13]. One way to eliminate it is to curtail the active power generation of PV sources when it becomes problematic. Smart inverters can first reduce the output power and may eventually shut down a micro-installation to mitigate adverse effects on the network [
14]. However, this is an unfavorable remedy that limits the economic and environmental benefits of solar energy production. An alternative technique is to reduce the amount of energy injected by prosumers into the power system when the PV sources are operating by using a residential energy storage system (RESS) and load shifting under a demand-side management (DSM) scheme.
RESSs can decrease PV curtailment by storing excess generation and, therefore, can reduce the export of energy to the network [
15]. Currently, battery-based energy storage systems are predominantly employed [
16]. To maximize effectiveness, the battery should be charged during high PV production, when the risk of exceeding the normal operating conditions of the network is at its highest [
17]. However, reducing PV curtailment is not the sole purpose of installing an RESS. An additional benefit of battery installation results from serving the household load with stored PV energy. Another option to decrease PV curtailment is DSM, which has the potential to be a practical solution in all energy demand sectors, including residential buildings [
18]. In this case, DSM mostly refers to the active shifting of household loads to increase matching demand with the power production. To obtain the best results from the use of RESS and DSM, the prosumer should properly control the operation of the storage and flexible loads through an energy management system (EMS).
There are two main categories of EMSs [
19]: rule-based EMSs and optimization-based EMSs. A rule-based EMS allocates the resources using predefined logical rules so that the energy produced can be adequately used or stored. An optimization-based EMS is more sophisticated and usually implements an optimization-based unit commitment (UC) model that considers several technical constraints while optimizing the objective function. The authors of article [
19] compared these two approaches by controlling a microgrid testbed equipped with controllable load banks, a battery, a diesel genset, and wind energy as well as PV simulators and generators. Article [
20], on the other hand, compared the employment of these methods to control the operation of a microgrid in an office building supplied by PV and wind sources, as well as by various storage units. In both cases, the optimization-based EMS minimized the operating costs of the microgrid. The optimization problem formulated in [
19] has been decomposed into UC and optimal power flow (OPF) problems [
21]. A mixed-integer linear programming (MILP) method was used to solve the UC problem, while the OPF problem was solved using an interior-point nonlinear programming method. The MILP method was also used in [
20].
Articles [
19,
20] considered microgrids with relatively large source and load capacities. In turn, article [
22] compared these methods to control the energy flexibility in a single residential building with PV. The flexible sources included were a heat pump with an auxiliary electric resistance heater and a water tank, a battery, and shiftable loads (SLs), such as washing machines. Under the rule-based control, the PV’s self-consumption was maximized, and the building acted as a customer who actively tried to avoid supplying PV electricity to the grid and did so only when other options were unsuccessful. If there was surplus PV power available, the energy was self-consumed in the following priority: firstly, shiftable appliances were operated; secondly, the remaining surplus was stored in the battery; and lastly, the remaining surplus was converted to heat and stored. At times when the PV power did not cover all consumption, the battery was discharged, and only the deficit was drawn from the grid. The second control approach analyzed in [
22] was the cost-optimal control, which minimizes the total electricity cost to the building. In this mode, the building takes the role of an active prosumer that both buys and sells electricity. The electricity cost is minimized over sequential 24 h horizons using a deterministic dynamic programming (DP) algorithm. A similar optimization algorithm was applied in the article [
23], in which the battery’s state of charge (SoC) was chosen as the decision variable to maximize the user’s profit. The proposed optimization-based control method was compared with the rule-based method in simulations conducted for a residential building equipped with a PV source and storage unit. An analogous comparison was made in the paper [
24], with the MILP method being used to optimally control the energy storage and heat pump. The objective was to minimize costs and peak power while considering the thermal comfort of the residents of the building.
In the articles discussed above, various objective functions and optimization algorithms were used to control EMSs. In each case, better results were obtained for optimization-based EMSs than for rule-based EMSs. However, when applying the optimization-based control, the computation time can be long [
21] and is highly dependent on the flexible sources included [
22] and the simulation time step assumed [
23]. As a result, high-performance computing may be required. This may be a significant obstacle to implementing optimization-based control into EMSs in residential buildings. Therefore, it is necessary to search for optimization methods that provide adequate results without having such high computational requirements. This is the purpose of this article.
The remainder of this study is organized as follows. In
Section 2, a method for the optimal control of RESSs and SLs that maximizes the prosumer’s financial neutrality is proposed.
Section 3 presents a test installation located in a residential building equipped with a rooftop PV source, an RESS, and controllable household appliances, where field measurements were taken to test and validate the proposed method. The simulation results are shown and discussed in
Section 4.
Section 5 describes the architecture and framework of the proposed optimization-based EMS. Finally, the main contributions of the presented work and the conclusion are given in
Section 6.
2. Control Algorithm for Maximizing the Prosumer’s Financial Neutrality
The above-mentioned challenges and current trends indicate the need to look for a simple, scalable system that can be widely applied in residential buildings in order to spread the concept of renewable energy based on PV technology. Of particular importance in this system is a method for adequately controlling the operation of RESSs and flexible loads, which consequently leads to the search for a suitable EMS system that, at its core, contains a dedicated algorithm whose task is to optimally control devices for a predetermined objective function. While rule-based management strategies continue to be developed and refined [
25], management strategies using novel approaches based on various computational intelligence tools are gaining popularity and attention from researchers [
26]. In particular, extensive applications of artificial intelligence techniques to hybrid microgrids based on renewable energy sources have been highlighted, addressing problems such as multi-criteria optimization, demand and supply forecasting, energy management [
27], as well as fault detection, classification, and security [
28]. A variety of techniques have been applied in this regard, such as machine learning, genetic algorithms, neural networks, swarm intelligence methods, and others. Among these, the multi-agent metaheuristic algorithms, such as particle swarm optimization (PSO), are especially gaining in popularity.
PSO is a stochastic population-based meta-heuristic optimization method inspired by swarm intelligence, such as the social behavior of bird flocking. It mimics the cooperative behavior of birds in a flock, where individual birds work together to find food and protect themselves from predators. Its first application to optimization problems was proposed by Kennedy and Eberhart [
29], and it has since been successfully applied in many fields [
30].
In general, the optimization problem considered in this paper can be defined as:
where
is the objective function, and vector
represents the problem’s decision variables. The problem described by Equation (
1) is treated as an unconstrained optimization problem. However, only solutions belonging to a subset of the search space are considered admissible. The feasible subset of the search space is defined as follows:
where
and
are, respectively, the lower and upper bounds of the search space along dimensions
j, for
, where
N is the number of decision variables.
PSO employs a swarm of particles, each representing a potential solution to an optimization problem. In a swarm of size
M, these potential solutions are denoted by the particles’ current positions:
where
is the position of the
i-th particle. Each particle
i, in addition to its position vector
, also has a velocity vector
, defined as:
Additionally, the particles maintain the value of their most favorable personal position so far, represented by
. The overall best position
found by any particle in the swarm, known as the swarm leader, is also tracked.
During the iterative optimization process, the best position of each particle
is maintained or updated. An update occurs when the particle’s new position yields a smaller value of the objective function. For the
i-th particle, the value of its personal best position
in the
k-th iteration is updated according to the following rule:
For iteration
k, based on the personal best positions of all particles
, the swarm leader
is selected using the formula:
where
represents the best position discovered by any of the particles at iteration
k.
The algorithm proceeds iteratively and, during this process, particles traverse the search space, considering their individual optimal position as well as the collective best position. The velocity and position of each particle are updated based on these factors. At iteration
k, for each particle
i, its velocity is updated first, using the following formula:
The particle’s velocity is then restricted to predetermined minimum and maximum values (
and
) [
31], followed by updating its position:
where
and
are
N-dimensional vectors of uniformly distributed random numbers within the range
,
and
are acceleration coefficients, and
is the so-called constriction factor [
32]. Factors
and
determine the range of particle motion in an iteration. In most cases, they are identical.
In the optimization problem discussed in this article, each particle represents an RESS operating profile for an assumed 24 h time horizon. It also stores values representing the switching time of the SLs. This means that each particle has 25 elements (parameters), of which the first 24 elements represent the operating points of the RESS in the subsequent hours of the day, and the last element represents the time of switching on the SL (it was assumed that the SL can be switched on at any hour of the day, but its operation must be completed within the analyzed 24 h time horizon). During the optimization process, the PSO algorithm utilizes OpenDSS simulation software (version 9.6.1.1) [
33], which uses a model of a building’s power supply system implemented specifically for the purpose of the optimization procedure (the model is described in
Section 3).
Figure 1 illustrates the sequence of steps of the PSO algorithm and how it interacts with the OpenDSS environment. During the algorithm initialization, an initial swarm (
3) is generated. The values of swarm particles are randomly chosen from a set of permissible solutions. Furthermore, each particle is assigned a randomized initial velocity value (
4). Then, during the initialization stage, the algorithm computes the objective function value for every particle, which also serves as its initial best value. Based on these, the swarm leader is determined (
6). After the initialization step, the algorithm progresses to the iterative phase. In each iteration, after determining the velocity of the particles (
7) and restricting them to their limiting values, new positions of the particles are calculated (
8) while respecting their permissible values. Based on the new positions of the particles, the input OpenDSS model is modified. The primary algorithm initiates the simulation process, which is executed by the OpenDSS simulation engine. Based on the result of the simulations, an objective function value is calculated. Once the objective function values are determined, the best positions of each particle in the swarm are updated (
5), and the leader of the swarm is selected (
6). If the termination condition is not met, the algorithm will continue its operation in a loop, and the described process will be repeated.
From the standpoint of the problem examined in this article, specifically the optimization of the operation of the RESS and SLs and the general optimization problem formulated by Equation (
1), it is crucial to properly define the objective function’s form. According to the European Commission’s regulation establishing a guideline on electricity balancing [
34], the settlement processes should ensure the financial neutrality of all Transmission System Operators. An analogous principle was adopted in this article for the selection of the objective function for the problem of optimizing the operation of the RESS and SLs. It was assumed that the goal of the optimization was to maximize the daily financial neutrality of the prosumer. This could be achieved by minimizing the objective function
f, defined by the formula:
where
is the power exchange with the grid in hour
h, and
is the energy price in hour
h. The value of the power exchange with the grid in hour
h can be calculated using the following formula:
where
and
are fixed and shiftable loads, respectively;
is the PV source generation; and
is the energy storage operation point. The value of
can be positive or negative (a positive sign indicates discharging, and a negative sign indicates charging the battery). Therefore, by controlling the operating point of RESS and the switching time of the SLs, it is possible to change the value of the power exchange with the grid in individual hours and, as a result, the value of the optimized objective function (
9).
Dynamic energy prices, changing on an hourly basis, were assumed to be used in the calculations. This is the preferred method of settling transactions in the energy market in the European Union [
35]. The 24 h horizon, on the other hand, is a realistic optimization horizon in terms of day-ahead electricity price and weather forecast availability. Dynamic energy prices can have a positive or negative value (negative energy prices indicate a general need to increase the flexibility of the power system; in the case of prosumers, this phenomenon should stimulate an increase in self-consumption, e.g., by storing energy or increasing load by switching on additional shiftable loads). Power exchange with the grid can also be positive (import from the grid) or negative (export to the grid). As a result, the products of price and power appearing in the formula (
9) can also be positive or negative, representing cost or income (
Table 1). By squaring these products, the prosumer’s cost and income are both minimized. In this way, the prosumer’s financial neutrality is maximized. The application of the square root ensures better convergence of the optimization algorithm.
3. Overview of a Test Installation and Input Data
The simulations carried out to test the proposed optimization method were based on measurements taken in a real residential detached house located in southern Poland. The building was inhabited by four people, and the annual electricity consumption was approximately 5000 kWh. The house was equipped with a rooftop PV micro-installation with a rated power of 5.25 kW and a Li-ion battery RESS with a rated power of 5 kW and a capacity of 20.8 kWh. The battery minimum SoC was set to 10%, while the maximum SoC was 100%. There were typical electrical appliances in the household, among which, the washing machine, clothes dryer, and dishwasher could be used as SLs. Dedicated energy meters were installed in the building’s power supply system to monitor PV generation, storage operation, total load, and power exchange with the grid. The results of the measurements were recorded with a 1 min resolution.
Figure 2 and
Figure 3 show the operation of the building’s power supply system for two consecutive weekdays in September 2023 (all figures in the article use Coordinated Universal Time or UTC; in the summer in Poland, local time is UTC +02.00). No central EMS was used when the measurements were taken, as the RESS was being controlled by its own rule-based algorithm that minimized the power exchange with the grid. In addition, no DSM was used during the measurements.
The days of 20 September (Wednesday) and 21 September (Thursday) were selected for evaluating the proposed optimization method due to their similar PV generation and load profiles. The operation of the RESS, which was fully charged around noon, was also similar. On both days, the operation of a potential SL could also be observed in the afternoon, after the PV source generation was completed. However, significant differences in the profiles of hourly electricity market prices were recorded on these days [
36], as shown in
Figure 4. The 21 September price profile had a typical shape, with stable prices during the day and higher prices in the evening peak. In contrast, the 20 September price profile showed a significant reduction in energy prices between 9 a.m. and 2 p.m., with negative prices between 10 a.m. and 1 p.m. This was the result of the high generation of renewable energy sources, particularly PV sources, during these hours [
37]. The described common features and differences for the chosen days allowed us to assess the impact of energy prices on the results of optimizing the operation of the RESS and SLs.
Since electricity prices are quoted with an hourly resolution, all the simulations described in this article were carried out with an hourly resolution. The hourly energy balances also corresponded to the net-billing system, which was in use in Poland. Thus, the daily operating profiles of the building’s power supply system recorded at 1 min resolution (
Figure 2 and
Figure 3) had to be transformed to an hourly resolution. Hourly power values were determined in such a way that the hourly energy quantities for 1 min and hourly resolution were equal.
Figure 5 and
Figure 6 show the recorded daily profiles transformed to hourly resolution. The power consumed by the electrical appliances (washing machine in
Figure 5 and dishwasher in
Figure 6), treated as SLs in the simulations, is marked with green bars.
Simulations were carried out using a model of the building’s power supply system implemented in OpenDSS software [
33]. The model built in the OpenDSS environment considered the actual parameters of individual devices and their most important constraints, such as the SoC constraints for the RESS. An electrical topology in which the loads (shiftable and fixed), the RESS, and the PV source were connected to the single AC bus, which was directly connected to the low voltage (LV) grid, was employed (
Figure 7). The measured operating profiles of the individual components of the building’s power supply system were used to tune the model. During the simulations, the daily profiles of loads (fixed
and shiftable
), PV source generation (
), energy storage operation (
), and power exchange with the grid (
) were recorded. The value of the objective function (
9) was determined based on the recorded value of power exchanged with the grid (
) and the hourly electricity prices shown in
Figure 4. Simulations were carried out separately for the two days analyzed, each time starting from the battery SoC resulting from the measurements.
4. Simulation Results and Discussion
Two variants of the simulation were carried out to test the proposed optimization algorithm for each of the days analyzed. In the first variant, only the daily operation of the RESS was optimized, while in the second variant, both the operation of the RESS and the switching time of the SLs were optimized.
Figure 8 shows the daily operating profiles of the RESS determined using the PSO algorithm, while
Figure 9 shows the SoC of the storage. For comparison, the measured values of these quantities, resulting from the RESS control based on a factory-implemented rule-based algorithm, are also shown.
Figure 10, on the other hand, shows the total load in the building, both measured and after optimizing the switching time of the SLs.
On 20 September (a day with negative energy prices), from midnight to 9 a.m., the RESS operation determined by the optimization algorithm (in both variants) was the same as the RESS operation recorded at that time (
Figure 8a). Also, in the evening and the first part of the following night, the optimization results coincided with the measurements. The major differences in storage operation occurred between 9 a.m. and 3 p.m., i.e., during the period when energy prices were low. From 9 a.m. to 12 p.m., the RESS charging power calculated by the PSO algorithm was lower than the charging power resulting from the measurements. Controlling the storage in this way allowed it to operate in charging mode for a longer time compared to the situation when the storage was controlled by a rule-based algorithm (
Figure 9a). As a result, the operation of the RESS was better adapted to the generation profile of the PV source.
On the second analyzed day, 21 September, differences in the RESS operating profile determined by the PSO algorithm and the measured profile were already noticeable at night (
Figure 8b). During this period, the PSO algorithm controlled the RESS to operate in the discharge mode with a higher power than the power determined by the rule-based algorithm. Part of the discharged energy was used to cover the building’s demand, while the remaining part was supplied to the grid. This was beneficial for both the power system and the prosumer. Discharging the RESS with a higher power at night reduces the power generated from non-renewable resources. At the same time, the RESS became better prepared to operate in charging mode during the day (
Figure 9b), when energy was generated by the PV source, which was noticeable around noon. On both the days analyzed, the effect of shifting load from evening to late morning hours on the operation of the RESS was also evident. During the hours when the demand in the building had increased (
Figure 10), the RESS was charged with lower power, and the capacity saved in this way was utilized at other times.
A measurable effect of optimizing the RESS and the SL was to increase the self-consumption of energy produced by the PV source compared to the situation when the storage was controlled by a rule-based algorithm. This is shown in
Figure 11. After the application of the PSO, on the first analyzed day (
Figure 11a), the self-consumption admittedly decreased from 9 a.m. to 12 p.m., but it was higher in the remaining hours in relation to the measurements. As a result, the total daily self-consumption increased from 43.1% to 46.9% after optimizing the RESS operation (
Table 2). On the other hand, after optimizing the RESS and SL, the daily self-consumption increased to 48.0%. An even greater increase in self-consumption was recorded on 21 September (
Figure 11b). On that day, the daily self-consumption increased from 36.7% when controlling the RESS with a rule-based algorithm to 41.8% after applying PSO. There was a further increase to 48.5% after optimizing storage and shiftable load.
A change in the level of self-consumption affects the exchange of energy with the LV distribution network. This is illustrated in
Figure 12. After the application of PSO, only the export of energy to the grid occurred. On 20 September (
Figure 12a), energy exports occurred for five hours, from 9 a.m. to 2 p.m., with a clear trend of reduction during hours when PV generation was higher. This phenomenon was closely related to the level of energy prices during these hours. From 9 a.m. to 10 a.m. and from 1 p.m. to 2 p.m., energy prices were at their highest and amounted to 0.01 PLN/kWh. From 10 a.m. to 11 a.m. and from 12 p.m. to 1 p.m., the prices dropped to −0.01 PLN/kWh, and from 11 a.m. to 12 p.m., the price was −0.02 PLN/kWh. Thus, to reduce the costs incurred by the prosumer as a result of the energy exports during hours when prices were negative, the PSO algorithm adequately reduced the exchange with the grid. This means that, when using an optimization-based EMS, energy prices can be an appropriate tool to influence the operating profiles of the RESS and the SL and, thus, the value of power exchanged with the grid. After optimizing the RESS operating profile, on 20 September, the daily energy export to the grid decreased from 7.6 kWh to 6.6 kWh (
Table 2). The use of DSM further reduced it by 1 kWh. An even more pronounced reduction in the amount of energy exported to the grid as a result of PSO application was recorded on 21 September (
Figure 12b). On that day, export to the grid decreased from 11.8 kWh to 7.9 kWh in the first optimization variant and to 7.8 kWh in the second variant.
In the method applied to optimize the operation of RESS and SL, it was assumed that the objective function was to maximize the daily financial neutrality of the prosumer. This required minimizing both cost and income. The results of the calculations are shown in
Figure 13 (positive values represent the cost for the prosumer, and negative values represent their income). On 20 September (
Figure 13a), the prosumer earned income or incurred a cost only from 9 a.m. to 2 p.m., as there is no exchange of energy with the grid during the remaining hours. However, since energy prices were close to zero at this time, the income generated and the costs incurred were negligible and offset each other. As a result, complete financial neutrality of the prosumer was achieved on that day. The situation was slightly different on the next analyzed day. On 21 September (
Figure 13b), after applying the PSO, the prosumer did not incur any costs, since the import of energy from the grid was zero and the energy prices on that day were exclusively positive. Instead, the prosumer received income for the energy sold. However, after optimization, the total daily income was approximately 25% lower than in the case when the RESS was controlled by a rule-based algorithm. Thus, the financial neutrality of the prosumer also increased on that day. A summary of the analysis results for both days is shown in
Table 2. Detailed results are given in
Appendix A (
Table A1,
Table A2,
Table A3,
Table A4,
Table A5 and
Table A6).
When carrying out the simulations described above, a series of experiments were performed to observe the convergence process of the PSO algorithm.
Figure 14 shows the results of the subsequent 10 daily PSO-optimized operating profiles of the RESS on 20 September 2023 (the daily operating profiles of the RESS shown in
Figure 8 are the average of the 10 PSO optimizations). Additionally, the convergence curves of the PSO algorithm executions for the corresponding RESS optimization results displayed in
Figure 14 are shown in
Figure 15. The curves show decreasing values of the objective function for the swarm leader of each PSO run in successive iterations. A swarm of 40 particles was used for these experiments. The PSO algorithm’s parameter values
and
,
were experimentally selected and set to
and
. The average duration of a single PSO optimization, obtained from 30 test runs, was approximately 22 s, with the maximum number of iterations set at 320. All simulations were carried out on a computer with an Intel Core i7-3770K CPU, 3.5 GHz with 16 GB of RAM, running on a 64-bit Windows 10 operating system.
5. Home Energy Management System Architecture
An EMS designed to improve the energy management of residential buildings by controlling and scheduling the use of household equipment is called a home energy management system (HEMS) [
38].
Figure 16 shows the HEMS architecture applying the proposed PSO-based method to optimize the operating profiles of the RESS and the SLs. This is a typical HEMS architecture [
39], containing various household appliances, a PV source, an RESS, an electric vehicle, and a central controller. Household appliances are divided into conventional appliances, which require a smart plug, and smart appliances. The central controller is the core component of HEMS, and it optimizes and controls the energy usage in the household. Wired and wireless systems are used for communication between the corresponding devices. A human–machine interface (HMI) displays information from the controller, smart meters, sensors, smart plugs, and the smart appliances of the HEMS.
The HEMS shown in
Figure 16 is in the implementation stage in the residential building where the measurements used in this article were taken. A second analogous HEMS is being implemented in a similar building, also equipped with a PV source, RESS, and SLs. The designed HEMS will operate according to the following principles. At the planning stage, the central controller will collect information on the day-ahead energy prices, the PV source generation forecast, the building’s baseline demand forecast, and the storage’s SoC. The PV generation forecast will be based on numerical weather forecasts [
40]. The building’s baseline demand forecast will be determined using historical load profiles [
41]. Using the HMI, the user will enter information into the system about the time intervals in which SLs can be switched on. The planned operating programs of these appliances will also be provided, and HEMS will download appropriate load profiles from the database containing data analogous to the load profiles described in [
42]. Based on the described input data, the PSO algorithm implemented in the central controller will determine the RESS operating profile and the times of switching on the SLs. The proposed HEMS will use a moving horizon of 24 h. The operating schedule will be updated in accordance with the update time of numerical weather forecasts. During the implementation of the developed plan, data from energy meters will be recorded. In this way, the results of the applied forecasting and optimization methods will be verified and improved.
The practical implementation of HEMS in a real environment such as a residential building requires meeting several challenges, both technical and non-technical in nature. The first issue that determines the quality of the decisions developed by the HEMS is to ensure the highest possible accuracy of generation and load forecasts in the building. Other technical challenges include the need to equip many electrical devices with monitoring and control systems and to build a reliable communication system, which must also ensure a correspondingly high level of cybersecurity. An additional problem may be the need to integrate devices from different manufacturers, operating according to different communication standards or having no communication system at all, which directly affects the cost of system implementation. In turn, a non-technical challenge is the need to raise awareness of people in the field of energy use and conservation so that residents of buildings equipped with HEMS will more willingly accept a situation in which some decisions are not made by them but by an automatic control system. It is obvious that the acceptance of such a situation will be easier for the residents when the decisions made by the HEMS system do not reduce their living comfort. This is another challenge that should be considered at the HEMS design and implementation stage.
6. Conclusions
The application of PV micro-installations to cover the electric energy needs of residential buildings is becoming increasingly popular worldwide. Unfortunately, the discrepancy between generation and load profiles results in low self-consumption, which means that a large part of the generated energy is transmitted to the LV grid, negatively affecting its operation. The remedy for this problem may be the use of RESSs and the implementation of DSM schemes, which involves switching on SLs at the appropriate time. However, such an extensive power supply system for a building requires a properly designed HEMS.
In this study, a PSO-based method was proposed to optimize the operation of an RESS and the switching time of SLs. The objective was to maximize the prosumer’s financial neutrality, which was calculated based on dynamic energy prices. The proposed optimization method was validated using measurement results taken in a building equipped with an RESS controlled by a rule-based algorithm. Compared to the situation when the RESS was controlled by the rule-based algorithm, the simulation results demonstrated an increase in the self-consumption of produced energy. After the application of PSO, the total daily self-consumption increased from 43.1% to 46.9% on the first analyzed day and from 36.7% to 41.8% on the second day. An even greater increase was recorded after optimizing the RESS and SLs. In this case, the self-consumption increased to 48.0% on the first day and to 48.5% on the second day.
The increase in self-consumption affects the exchange of energy with the LV distribution grid. After optimizing the RESS operating profile, on the first analyzed day, the daily energy export to the grid decreased from 7.6 kWh to 6.6 kWh (13%), while on the second day it decreased from 11.8 kWh to 7.9 kWh (33%). The use of DSM further reduced the daily energy export to the grid. In addition, the proposed PSO-based algorithm also optimized the amount of energy exported to the grid at specific hours of the day, reducing exports at a time when PV generation was at its highest. This was particularly noticeable on the day with negative energy prices that occurred as a result of excess energy from renewable sources across the power system. This means that, using the proposed PSO-based HEMS, it is possible to use price signals from the wholesale energy market to control the operation of the individual RESS and the SLs in a way that improves the LV network operating conditions. Therefore, the proposed algorithm not only benefits the prosumer by maximizing self-consumption, but it also decreases the investment pressure on the distribution system operator by minimizing the negative grid impact of the prosumer’s PV micro-installations. The proposed architecture of the HEMS is generic and practically applicable to any residential building, so it can be widely implemented in such locations.
Further research will include the integration of other renewable energy sources (e.g., wind microturbines) and electric appliances used to ensure thermal comfort in the building (heat pump, air conditioning, heat storage) into the HEMS system. The effects of controlling the prosumer power supply system according to other objective functions (e.g., cost minimization) will also be analyzed, and the impact of different control strategies on the operation of the low-voltage distribution network will be compared.