Home Energy Management for Community Microgrids Using Optimal Power Sharing Algorithm

: From a residential point of view, home energy management (HEM) is an essential requirement in order to diminish peak demand and utility tariffs. The integration of renewable energy sources (RESs) together with battery energy storage systems (BESSs) and central battery storage system (CBSS) may promote energy and cost minimization. However, proper home appliance scheduling along with energy storage options is essential to signiﬁcantly decrease the energy consumption proﬁle and overall expenditure in real-time operation. This paper proposes a cost-effective HEM scheme in the microgrid framework to promote curtailing of energy usage and relevant utility tariff considering both energy storage and renewable sources integration. Usually, the household appliances have different runtime preferences and duration of operation based on user demand. This work considers a simulator designed in the C++ platform to address the domestic customer’s HEM issue based on usages priorities. The positive aspects of merging RESs, BESSs, and CBSSs with the proposed optimal power sharing algorithm (OPSA) are evaluated by considering three distinct case scenarios. Comprehensive analysis of each scenario considering the real-time scheduling of home appliances is conducted to substantiate the efﬁcacy of the outlined energy and cost mitigation schemes. The results obtained demonstrate the effectiveness of the proposed algorithm to enable energy and cost savings up to 37.5% and 45% in comparison to the prevailing methodology.


Introduction
There are still several problems associated with traditional energy management systems and power grids, such as one-way flow of electricity, fixed electricity pricing, high power transmission losses, lower grid reliability, and excessive utility tariffs. To overcome such limitations, two major elements of smart grid topologies are introduced, power flow and data flow through the entire network, which are utilized to find the most prominent solutions. Smart meters in the grid ensure communication between the consumers, power producers, and load aggregators [1][2][3]. The bidirectional data and energy flows are the most important features of smart grid technology. The incorporation of renewable energy sources (RESs), such as solar and wind, along with battery energy storage systems (BESSs) in residential premises can significantly decrease electricity prices and energy consumption [4][5][6]. However, the development of efficient home energy management (HEM) is a challenging task to efficiently handle the energy consumption inside a residence while exchanging energy with the utility grid.
A recent report illustrated that the residential sector consumes around 30% of the overall electrical energy [7]. For this reason, an efficient HEM technique is essential to effectively manage the energy demand, which plays a crucial role in the demand side management (DSM) in the microgrid framework. Currently, numerous categories of costing scheme including time of use pricing (ToU) for customers with excess energy requirement and hourly real-time pricing are used, as presented in [8]. Residential consumers can offer resilience to utility operators by adjusting their load profiles. Furthermore, the customers can shift or reduce the operational hours of loads to other periods of the baseline. In some research works, a load aggregator provides residential consumers with the possibility of registering in a demand-response strategy and capitalizes on their capacity for adjustability [9,10]. The authors in [11] established a framework to solve the function by developing a particle swarm optimization and a Rainflow algorithm to find out the working scheduling of the energy storage units by taking charging-discharging cycles and eventual degradation of the battery system into consideration.
There are a number of literature reviews on energy management of smart homes. Energy management for a typical smart home, consisting of wind generators, solar photovoltaics (PV), electric vehicles, and household energy storage, is presented in [12] using an improved particle swarm optimization (PSO) algorithm. The technique presented is suitable for emergency cases only and it does not consider a central battery storage system (CBSS). The authors in [13,14] proposed a HEM model by incorporating solar PV, wind energy, and energy storage system to tackle the energy availability and stability issues. In this study, the optimal power sharing algorithm (OPSA) and mutual satisfied user were not taken into account. The authors in [15] proposed a constraint-based demand side management (DSM) algorithm to promote the scheduling of home appliances. An intelligent HEM was introduced in [14], considering the integration of RESs. The results of active demand side regulation (DSR) taking into account BESS and solar PV were evaluated in [16]. The study did not consider addressing a detailed analysis of energy cutting techniques based on OPSA. The authors in [17] outlined an extensive survey of trends in smart grid infrastructures and investigated the effectiveness of several communication technologies. However, they did not consider the CBSS and mutually satisfied power demand scheme. Development of home energy management, cluster-based energy management, and improved energy and cost reduction schemes were outlined by the following authors [18][19][20]. However, they did not consider the CBSS, which is the key element of this research. By changing the number of people involved in economic activities and household consumption, demographic development is one of the strongest determinants of energy consumption [21]. The authors in [22] illustrated "analysis methods for characterizing energy saving opportunities from home automation devices using smart meter data". Optimization of power-to-heat flexibility for residential buildings in response to day-ahead electricity price was carried out by the authors in [23].
Several other research works were conducted on energy storage and energy sharing within the community microgrids. Authors in [24] conducted research on peer-to-peer (P2P) surplus energy trading, which is recognized as an efficient way to reduce required power reserve and peak demand in grid connected microgrids. However, the proposed approach mandates each home user to install distributed energy resources, which is difficult for some urban residents. Thus, this energy sharing approach is restricted for some urban participants in trading energy with the neighbors. The state of charge (SOC) of energy storage device and ToU are used in [25] to reduce the utility tariff by varying the operation of smart devices from peak hours to off-peak hours. Another energy management approach was presented in [26] to manage peak-hour energy consumption with thermostatically controlled electrical loads and energy storage devices. Some recent literature used several HEM techniques, such as the predictive method [27,28], linear method [29], non-linear method [23], and optimization technique [24,25]. Although several studies have been conducted, especially based on the strategy presented in [12,26], it was identified that most of the HEM approaches neither consider CBSS nor include the mutually satisfied power demand approach. To bridge the research gap in the existing literature, this paper proposes a home energy management system in the community microgrids using the optimal power sharing algorithm. The main objectives of this approach are to minimize energy usage, cost, and overall system peak load demand. The proposed HEM scheme allows for significantly reducing energy usage and the relevant costs when compared to the current strategies, resulting in higher consumer satisfaction. The research conducted in this paper contributes to the existing knowledge as follows:

•
The proposed model and OPSA allow an energy distribution scheme in a locality to be evaluated sharply.

•
A model for smart home users with CBSS is established to bypass peak load condition.

•
The remote monitoring and real-time energy pricing are enabled with the integration of a state-of-the-art smart metering device into the planned architecture.

•
The proposed approach saves up to 45% in energy costs, as observed from the analysis.
The remainder of the paper is structured as follows: Section 2 deals with the identification of the problem and introduces the microgrid framework together with smart metering devices, BESS, CBSS, and RESs. Section 3 illustrates the system architecture considering a PV system, wind energy, energy storage options, consumer load profile, and the grid infrastructure, mathematical modeling of a residential household comprising smart devices, and the developed OPSA. The results and discussion for several case studies are presented in Section 4. Finally, Section 5 depicts the comparison of results and discusses future research.

Problem Description
The proposed microgrid infrastructure depicted in Figure 1 considers several home users in a local community to establish household applicants swiftly and allow suitable allocation of a battery energy storage system (BESS). Energy demand for residential consumers increases significantly due to increased usage of household appliances. In the present day context, most of the household devices are supplied electricity from fossil fuel-based generation, resulting in a densely polluted environment due to greenhouse gas emissions [30]. In accordance with the recent international standards and policies, each country needs to reconsider their strategy to limit the carbon emissions with the aim of protecting the environment. As such, alternate means of power generation with zero carbon emissions is of paramount importance.
The microgrid architecture considered in this paper comprises renewable energy sources (RESs), a battery energy storage system (BESS), and a central battery storage system (CBSS). BESS is used when RESs are unable to meet the consumer's energy demand. In addition, CBSS is used when all other supplies are unable to meet power demand. The microgrid community under consideration has a group of suburban households as well as installed smart meters, and is further provisioned with wireless communication. Every single residential consumer is interconnected through a wireless communication network to enable smart meter data communication. Smart meters are installed for the purpose of monitoring customer's energy consumption, cost profile, and extra demand.
Assuming an end-user feels the need to increase their energy consumption for a certain period on a specific day, and then they must notify the grid supervisory management unit (GSMU) at least 24 h prior to the event with a view to facilitate stability between energy transmission and the user. The energy groups are integrated in the smart grid framework, such as group A, B, and C. A number of home users are interconnected and assume an energy group which is assigned a BESS to ensure steady electricity supply in the event of the failure of energy supply from RESs and the utility operator. In addition, when all available sources including RESs, BESS, and mutually satisfied power demand are incapable of meeting the energy demand, CBSS assists to ensure an uninterrupted power supply. Smart devices are distributed into three categories based on a consumer's use preferences. These include time-shiftable devices (TSDs), power-shiftable devices (PSDs), and non-shiftable devices (NSDs). Washing machines and dishwashers are considered as TSDs, as they are in a constant state of power consumption and can be shifted to preferable time slots. The several PSDs, such as electric vehicles and water pumps, have minimal and maximum power limits for their operation. NSDs such as lights, fans, TVs, refrigerators and so on, have dedicated operational hours and power utilization profiles as per consumer requirements. In this case, NSDs are excluded for optimal load scheduling. Based on consumers' energy requirements, they can regulate PSDs, their eventual energy consumption, and define the specific operating hours for the devices. As such, TSDs and PSDs are the ideal loads for HEM purposes.
Previous work on microgrids and HEM is not yet functional on an industry level on account of several reliability and security concerns. Hence, in order to considerably enhance the performance of home energy management systems within the residential microgrid communities, this research contributes towards developing an optimal power sharing algorithm and incorporating RESs, BESS, and CBSS into a microgrid framework.

System Model
This section provides a detailed insight into the system parameters: wind energy and solar PV, types of load, microgrid infrastructure, battery energy storage system, and load profile for a residential household considering real-time data.

Wind Turbines
Wind energy is one of the most significant sources of renewable energy and has widespread acceptance due to its unique qualities, such as abundance, availability, and zero carbon emissions. It refers to the method of electricity generation by transforming the kinetic energy of the turbine into mechanical energy, which in turn is converted into electricity using a generator. However, wind energy is notoriously intermittent and varies widely depending upon the regional wind speed and the height of installation of the turbine blades. Wind speed across the region over a timeframe of 96 h is depicted in Figure 2. Wind speed data are recorded via anemometer and further converted to energy with the use of power-law equation [31]: Equation (1) denotes the relationship between wind velocity and rotor height above the ground's surface. The velocities at height h and h 0 are v and v 0 , respectively. Here, α signifies the power law exponent [32], and is considered as 0.142 for free space. The piece-wise function establishes the power output obtained from a wind turbine and is governed by the conditions below [33]: In Equation (2), P r denotes the rated electrical power of the wind turbine and v r represents wind speed (rated). In order to safely operate the wind turbine, a cut-in wind speed and cut-off wind speed are defined by the manufacturing industries. The cut-in wind speed is given by v c , and the wind turbine cut-off wind speed is denoted by v i . When wind speed is beyond the specified cut-off wind speed, the turbine is shut down. The rated output from wind turbines is governed by the equation below [34]: where N w denotes the total number of wind turbines.

Solar PV
Solar photovoltaic (PV) systems are used throughout the world and are experiencing rapid growth due to their ability to accumulate usable energy from incoming irradiation and convert it into DC electricity. The total power generated from the available sunlight relies on PV array size and the weather conditions for the area under consideration. Figure 3 illustrates the value of solar irradiance over a timeframe of 96 h. As demonstrated, the data undergo significant variation based on the daylight hours and available climate. Maximum power point tracking (MPPT) technology is implemented to achieve optimal output from the PV panels [35,36]. The overall effectiveness of the installed PV system is dependent on the panel efficiency and system capacity. Nevertheless, the output of PV system declines during unfavorable condition such as reduced daylight hours or foggy or cloudy conditions. The total output from a solar PV system considering solar irradiance under MPPT mode is governed by the equation below: where η s in accounts for system efficiency, whereas A defines total area required by the installed PV system. Solar irradiance is denoted by SI, and t 0 defines the ambient temperature. γ in (4) represents the temperature coefficient for maximum available PV power output. In this study, the value for γ is taken as −0.005/ • C. For SI cells, γ ranges between −0.004 and −0.006 per • C [37]. For a large-scale PV system, the overall system output is defined using the equation below: where N s depicts the total quantity of solar PV panels.

Battery Energy Storage System (BESS)
There are several forms of battery energy storage system available. These include electrochemical batteries with high energy and power density, superconducting magnetic energy storage (SMES) with high power density, and compressed air and flywheel energy storage. Each of these storage technologies offers numerous features, such as fast response, increased storage option, and capacity to deliver peak current. These available attributes make the storage technologies ideal for use in several applications with respective units. Electrochemical batteries are favored in this research due to the attributes such as high energy density and power density. BESS reduces the impact of the unpredictable behavior of RESs on the smart grid infrastructure with an aim to ensure system stability. This is mainly obtained through the controlled charging and discharging of BESS. In the event of redundant power from RESs, additional energy is stored in the BESS, whereas during unfavorable weather condition, the system relies on BESS to supply the required energy. The charging and discharging models of the battery can be illustrated as follows: The power limits for the energy storage device are: The energy level for the storage units is: In the above defined conditions, P c (t) defines the battery charging power level at time t, and P d (t) denotes the battery discharging power. ∆t accounts for the total time period and BL(t) represents the energy level during time t. In Equation (6), charging efficiency is denoted by η c , and η d in (7) represents the discharging efficiency. Both charging and discharging efficiencies are considered as unity for this study.

Load Profile and Utility Grid
The load profile over a timeframe of 96 h for domestic consumers is depicted in Figures 4-6. The figures illustrate three types of load pattern for the system during peakhour conditions, mid-peak hours, and during the conditions of lower power requirement. As shown in Figure 4, the load profile reaches a maximum of 0.43 kW during high demand conditions. During mid-peak hour conditions (as shown in Figure 5), the load reaches up to 0.42 kW and it reaches 0.32 kW for off-peak hours conditions.
The above estimated load profile is adequate in satisfying the energy demand for everyday household devices such as compact fluorescent lamp CFL, ceiling fans, TVs, dishwashing machines, refrigerators, etc. Nevertheless, the user energy requirements fluctuate over the course of the day. For this research, a similar energy demand pattern for domestic consumers is considered. Several energy readings from individual consumer result in a diversified demand profile for the overall system.  The forecasted electricity tariff of a residential consumer over a 24 h period is illustrated in Figure 7. Per unit pricing of electricity is made available to the customer one hour early from the distribution company. This pricing scheme allows residential consumers to shift their flexible loads. The microgrid system assumed is grid-connected.
In this work, the assumed system is projected in a platform where alternative energy sources are supported by the local authority. It is further considered that the power from and to the grid is transferrable, neglecting any transfer margin in the process. The system enables residential customers to participate in energy generation and overcome the issue of unmet loads resulting from poor voltage within the community. Furthermore, such initiatives will allow consumers to earn remuneration from their respective utility companies.

Mathematical Modeling of RESs, BESS and Smart Home Appliances
The mathematical model of smart home devices merged with RESs, BESS, and relevant design constraints is analyzed in this segment. Detailed modeling of different subsystems is considered for studying the performance of the solar PV, wind turbine, energy storage units, smart home appliances, and their overall economic impact. The total power available from the RESs is stored in a smart battery. The following equation defines the total renewable energy: P RE = p PV + p Wind (8) where P RE is the renewable energy generation, and p PV and p Wind indicate the power generated by solar PV and wind, respectively. A single dwelling's load profile considering key household appliances is governed using the equation below: where E THA indicates the total household appliances, E RF signifies the refrigerator load, E DW accounts for the dishwasher, E L denotes the lighting load, E TV denotes the television power, E WM is the power consumed by the washing machine, and E MO defines the microwave oven load. Normally, community users receive power from renewable energy sources. However, while insufficient generation of RESs; users can take power from utility grid. The overall power request made by the user is governed by Equation (10).
where E UE represents user energy, E RE is the renewable energy, and E ESS is a measure of power from energy storage units. Again, E THA indicates the overall power consumed by the smart devices used by the domestic customer. The additional energy required by the residential unit is delivered by the grid and is governed by Equation (11). The additional energy cost is estimated using Equation (12).
where E EED defines the extra energy demand, E US depicts energy from the utility system, and E UE denotes user energy. In Equation (12) above, E EEDC represents the extra energy demand cost, whereas E USP outlines the utility system price. A community comprising twenty residential consumers is studied in our proposed system and the total user energy is given by Equation (13). (13) where E TUE defines the total user energy, and E UE represents user energy. The total energy cost for user is governed by Equation (14) below: where E TUEC depicts the total user energy cost while E UE denotes the user energy and E UEC indicates the user energy cost. Equation (15) shows the daily total number of hours.
where E TNH accounts for the total number of hours. E H signifies energy consumption by residential consumer per hour. We considered a 96 h period for this work. The daily total energy consumption and relevant cost are detailed using Equation (16).
where E TND depicts the total number of days, with E D accounting for energy consumption made by a user on a daily basis.

The Proposed Algorithm
The following section deals with the overall framework for the simulation and introduces the proposed optimal power sharing algorithm within a smart grid framework. The defined algorithm efficiently analyses and prioritizes the energy request made by users within the community.

Optimal Power Sharing Algorithm (OPSA)
The simulation study included the real-time retail electricity tariff, thereby allowing for coping with regular issues faced in optimization techniques. In order to overcome these problems, an optimal power sharing algorithm (OPSA) is proposed which outlined in the Appendix A. OPSA enables an optimized microgrid model which incorporates a central battery storage system (CBSS). OPSA is further implemented to enable power sharing between CBSS and the battery installed at the user end. The OPSA aims towards the mitigation of user's energy usage and relevant cost, thereby attaining a higher degree of consumer satisfaction [38]. Smart devices account for the majority of the energy consumed by home users in a microgrid community. CBSS, in coordination with the grid supervisor and management unit (GSMU), provides a backup power option in the event of the failure of power from the ESS and the grid. GSMU accounts for prioritizing user requests including emergency scenarios. In the event of a higher energy requirement from the user end as compared to the capacity of the energy storage device, the charging mode is initiated. This is accomplished via the GSMU accounting for the requested demand by the consumer. GSMU further enables the requested consumer to accommodate shared energy available from the remaining users within the community. Furthermore, an alternate route of power is accessed by the requested user via CBSS in the case when no energy is being generated from the rest of the sources. Figure 8 exhibits the proposed OPSA algorithm flow chart in order to establish the detailed procedure and implementation process required for analyzing the percentage of overall energy and the relevant cost minimization by taking into account the mutually satisfied power demand, RESs, BESS, and CBSS. The collected energy from solar PV and wind turbines is stored in a smart battery. When residential users' energy demands are greater than the battery energy, then the battery needs to charge at the peak level. Otherwise, the battery is permitted to remain at the maximum level. If any user requests extra power and a fully charged battery is found, then charge is assigned to the requested neighbor battery through the GSMU, because the GSMU is the main controlling unit of the microgrid framework. When RESs' energy generation is greater than the user energy demand, channel the excess energy to the utility grid. Otherwise discharge the BESS to utilize the battery energy. The daily and hourly energy demand and pricing and mutually satisfied power demand are evaluated. The simulation is stopped if it meets the iteration condition.

Simulation Results
This section presents a detailed analysis of the home energy management (HEM) model by comparing the overall impact of the proposed optimal power sharing algorithm (OPSA) and simulation results. The smart grid infrastructure is further merged with renewables in the form of solar PV, a central battery storage system (CBSS), and a wind power system with an aim to achieve reduced energy use and cost for the user. The OPSA proposed enables the effective allocation of power-sharing among the user's energy storage devices. The CBSS system further provides additional backup energy to the customers within the smart grid when all other supplies remain inactive. The CBSS's capacity is considered as 30 kWh with a minimum storage of 5 kWh and maximum storage of 30 kWh. The CBSS selected was equipped with an initial charge of 10 kWh. Table 1 presents a detailed specification and constraints of all the components within the smart grid. The components are fed with real-time values. Nevertheless, the data are further modulated to ensure OPSA application suitability. For this research, three different case scenarios are investigated. An ongoing grid system is compared against two other proposed systems in order to evaluate the overall percentage of user energy and relevant monetary savings. The simulation results display the energy consumption profile on an hourly and daily basis by including satisfied power demand to enable effective comparison between all case scenarios.

Case Study
Numerous studies were conducted in order to outline the residential unit's energy requirement profiles and perform comparative analysis with existing techniques. A community with twenty domestic units was analyzed to project the overall energy and cost savings. Three different case scenarios were considered. In Scenario 1, the grid is solely responsible for the supply of electricity to the customers. Scenario 2 allows the merging of power from RESs with the available power supply from the local utility system and BESS. In addition to power supplied from the grid, BESS, and RESs, Scenario 3 considers CBSS.

Case I
This model relies on power supplied by the electricity grid alone. The model considers no additional power from RESs or BESS to support during power shortages. The existing scenario is entirely incapable of accounting for energy mitigation and financial gain as a result of the exclusion of RESs and BESS. The grid supplies electricity and the users pay the resulting bills based on their grid energy consumption.

Case II
The second case accounts for the integration of power from solar PV and wind turbines, as depicted in Figures 2 and 3. The power produced from RESs is highly stochastic and struggles to meet the energy requirements of the residential user during unfavorable condition. As such, a CBSS is injected within the smart grid infrastructure. Figure 9 delineates comparison for energy consumption by the residential consumer for the existing case and proposed system 1 over a timescale of 96 h. Table 2 illustrates the energy consumption, cost factor, and the overall percentage of saving for the base case and proposed system 1.  Table 2. Comparison of energy and cost reduction between proposed system 1 and the existing system.

Scenarios Energy (kWh) Cost (EUR) Percentage Saving
Existing (scenario 1) 80 6.32 0 Proposed 1 (scenario 2) 50 3.95 37.5 The power generated by RESs is stored in a smart battery which can be accessed by the user as per their requirements and can further be utilized in a power-sharing mode. The integration of RESs allows the electricity pricing to reduce to EUR 3.95, thereby allowing an overall saving of 37.5% as compared to the base case scenario. Furthermore, during ideal conditions, additional power generation from RESs is stored in a smart battery, which accounts for higher savings.

Case III
In order to assess the effectiveness of the proposed scheme, a CBSS together with the grid, RESs, and BESS is considered. Figure 10 depicts the energy consumption profile for the existing scenario and Scenario 3 over a timescale of 96 h. The BESS considered allows charging up to 30 kWh and is charged via the grid. BESS is completely discharged during peak-hour conditions and is charged again during off-peak hour conditions. BESS also allows charging from RESs. Scenario 3 results in an energy saving of up to 47% in comparison to the base case. Table 3 shows a comparative analysis between the existing case with the recommended energy and cost mitigation scheme.  This study involves the evaluation of an energy and cost mitigation scheme for domestic customers relying on numerous case scenarios. The existing scenario is entirely incapable of reducing energy consumption or relevant cost omission of RESs and BESS. On the other hand, scenarios 2 and 3 provide considerable savings by integrating BESS, RESs, and CBSS by further allowing optimal power sharing topology. Table 4 accounts for the percentage of saving, depicting the best beneficial case.  Figure 11 above shows the comparison of energy consumption, associated cost, and percentage of savings for three different scenarios. Scenario 1 depends entirely on the utility grid for operating home appliances and consumes 80 kWh energy and costing 6.32 (EUR) over the 96 h timeframe. As the residential load in this instance relies on the grid, no energy savings are possible. For Scenario 2, the penetration of renewables accounted for reduced energy consumption (50 kWh) and improved (37.5%) savings on the overall energy and cost. Finally, Scenario 3 assumes the integration of BESS together with RESs, resulting in a further reduction in energy consumption (44 kWh) and cost (3.47 EUR). Scenario 3 results in an overall energy and cost saving of 45%. The energy consumption in Scenario 3 is minimized due to the integration of RESs and BESS with the grid and the implementation of OPSA. Figure 11. Comparison of grid energy, cost and percentage saving for three scenarios. Figure 12 depicts the comparison of energy consumption for all three scenarios. Scenario 1 consumes 80 kWh during the operation of the entire residential load. The utility grid supplies electricity to the end-user. Scenario 2 considers solar PV and wind power to reduces energy consumption from the grid to 50 kWh. The penetration of renewables resulted in reduced dependency on the grid to operate residential loads. Scenario 3 provides the best outcome, with the energy consumption from the grid being reduced to 47% due to the inclusion of energy storage devices in each household. The dark yellow line in the figure below indicates the percentage of energy savings for the three scenarios.  Figure 13 illustrates the percentage of saving in terms of energy cost for three scenarios by taking into account the penetration of RESs and BESS together with the grid supply. The results show that when the grid operated alone to supply all connected loads, the cost of electricity is 6.32 EUR. This figure reduced to 3.95 EUR when renewable energy sources act in conjunction with the grid for Scenario 2. Finally, energy storage devices introduced in each residence accounted for a further reduction in electricity cost to 3.47 EUR. BESS integrated into the system results in a reduced reliance on the utility grid and RESs in the event of grid outage or unfavorable weather conditions.  Figure 14 illustrates the energy consumption and cost profile for three scenarios to obtain a clear concept for energy consumption and associated utility cost for the residential consumers in a community microgrid. Scenario 3 provides the lowest energy price owing to reduced power consumption from the utility grid. Meanwhile, Scenario 1 has the highest energy cost due to the energy being supplied by the utility grid only. Furthermore, Scenario 2 has the medium price due to utility and RESs support.

Mutually Satisfied User
When any user highly requires power due to a blackout of the smart battery or all other support being unavailable, such a condition is addressed through battery power sharing within a neighboring residential user, and this technique is called mutual satisfied user (MSU). This method enables power sharing amongst residential consumers within the microgrid framework. In order to ensure sustainability, each individual user is permitted to allocate a maximum of 50% of its total storage capacity. A detailed analysis between the base case and the recommended model based on MSU is depicted in Figure 15, and the details are shown in Table 5. The left hand y axis indicates the number of mutually satisfied users. However, right hand y axis illustrates the percentage of saving (energy and cost). Scenario 2, which incorporates BESS, projects 22% additional savings due to MSU compared to scenario 1. Furthermore, scenario 3 has 28% additional savings as compared to the base case scenario due to RESs and BESS combined with grid supply and MSU.  This research work involved comparative analysis among several case scenarios, thereby allowing the selection of an energy-and cost-efficient system. Figure 16 illustrates the overall percentage saving (grid energy consumption and cost) among three cases. The base case considered residential consumers with a fixed electricity pricing and nominated load profile. This provided the home user with a threshold of energy demand as decided by the grid operator. Thus, the user is unable to bypass higher electricity pricing and peak load conditions. Scenario 2 offered flexibility to the user with the merging of RESs to reduce the overall energy usage and associated costs. Nevertheless, RESs suffer from inconsistency, with performance variation during unfavorable weather conditions. Scenario 3 promotes an overall energy and cost reduction of 45% as compared to the base case. It introduces a supplementary BESS to overcome the aforementioned problem. The BESS is provided with charging during off-peak hours and when the demand profile rises, BESS is allowed to discharge. However, an additional BESS will result in a higher initial capital cost, which might impact the overall economic factors.

Conclusions
This study presents an efficient home energy management approach within a microgrid community considering renewable energy sources, a battery energy storage system, a central battery storage system, and mutually satisfied power demand for a specific number of users. The HEM model allows residential consumers to regulate their overall energy consumption profile and alleviate the associated expenditure along with real-time pricing. The offered model is designed within a microgrid infrastructure with twenty residential consumers considering the optimal power sharing algorithm. The overall impact of integrating the HEM scheme and BESS is evaluated based on three different cases. The C++ simulation platform is used to analyze the economic impact of RESs, BESS, CBSS, and the mutually satisfied power demand scheme. Scenarios 2 and 3 proposed in this research resulted in overall energy and cost savings of as much as 37.5% and 45%, respectively, when compared against the base case. Furthermore, the mutually satisfied user technique additionally can provide grid energy and cost savings of up to 22% and 28%, respectively. This study proposes an energy-and cost-efficient HEM model by merging RESs, BESS, and CBSS in a power-sharing environment. Furthermore, the outcomes of this research identify potential financial gain for a residential customer in a smart grid community and promote alternative means of sustainable energy generation within a locality. Future works may introduce and explain the following concepts and aspect for better research: • A large community • Hybrid energy storage devices with degradation cost • Integration of renewable sources with uncertain modeling to measure the effectiveness of the proposed algorithm • Techno-economic analysis of the proposed model.