Recent advances in residential automation technologies and the widespread adoption of distributed energy resources (DERs) have dramatically amplified the need for sophisticated energy management strategies that harmonize operational reliability with cost-effectiveness in smart residential microgrids (SRMG). When smart homes fail to coordinate effectively or exchange energy, irregularities in the SRMG load profile emerge, potentially breaching critical technical thresholds. This work presents a fully decentralized architecture for SRMG that accommodates heterogeneous smart homes that actively participate in peer-to-peer (P2P) energy trading. This architecture targets the simultaneous minimization of load profile variability across the microgrid, reduction of household electricity bills, and preservation of occupant comfort levels enabled by P2P exchanges. At the household level, the home energy management (HEM) system is engineered to curtail overall energy expenditure by leveraging available DER capacity to enable P2P transactions and maintain continuous bidirectional links with the SRMG operator (SRMGO). Real-time, ongoing data interchange between SRMGO and HEM units proves indispensable for achieving superior load-profile smoothing in a decentralized setting. The proposed mechanism achieves roughly a 4.25% decrease in load-profile deviations while keeping energy costs unchanged, thereby confirming that decentralized P2P energy exchanges markedly improve both microgrid load balancing and household expenditure stability. Simulations conducted with the general algebraic modeling system (GAMS) software confirm that incorporating P2P energy mechanisms within a decentralized structure satisfactorily meets the SRMG’s technical constraints and the monetary priorities of participating smart homes.
The fundamental purpose of a smart residential microgrid (SRMG) lies in determining the most advantageous blend of power generation from distributed energy resources (DERs), while simultaneously supporting energy exchanges and maintaining a reliable communication channel between the SRMG operator (SRMGO) and the home energy management (HEM) systems installed in smart dwellings [1-3]. Such optimization seeks to meet residential energy requirements at the lowest feasible operating cost, subject to the system’s equality and inequality constraints. Moreover, effective utilization of on-site DERs in smart homes is vital to improving overall efficiency and reducing the environmental burden imposed by SRMG operations [4]. Implementing a coherent energy management plan for SRMG—augmented by peer-to-peer (P2P) energy transfers among neighboring smart homes—can substantially advance progress toward a wide range of technical and economic targets, thereby enriching the ongoing conversation surrounding next-generation electricity network design [5].
From the consumer’s viewpoint, the HEM system constitutes a pivotal instrument for controlling DERs operating at low-voltage distribution levels [6]. It integrates a smart meter with a centralized home controller within the intelligent residence infrastructure. By accessing live data streams, the home controller dynamically allocates energy to resolve load allocation problems [7]. In addition, it orchestrates alignment between domestic consumption patterns and DER output, subject to the quality and availability of the underlying communication network. To motivate households to join energy management schemes, the SRMGO offers financial perks—most notably lower electricity rates—that can be claimed via the HEM interface [8]. Reliable bidirectional data flow of this kind depends on strong telecommunications backbones and pervasive Internet of Things (IoT) connectivity spanning household and neighborhood networks [9]. Because the HEM system automates cost-minimizing energy decisions, it naturally stimulates broader consumer engagement in demand-side management activities [10]. Beyond nonresponsive electrical loads (non-REL), smart residences typically include responsive electrical loads (REL) such as intelligent appliances, air conditioning (AC) units, and bath heating systems (BHS). Prevalent DER technologies in these contexts comprise energy storage systems (ESS), plug-in hybrid electric vehicles (PHEV), and solar photovoltaic (PV) systems.
Over the past several years, peer-to-peer (P2P) energy trading among smart homes has attracted considerable scholarly attention as a powerful strategy for maximizing energy resource utilization [11, 12]. In this arrangement, households share surplus generation with neighbors in real time to meet their needs, thereby greatly reducing their reliance on upstream grid supplies. The resulting cooperation relieves stress on the main distribution network and simultaneously raises the effective performance of local DER assets. Seamless information exchange between individual smart homes and the SRMGO is indispensable; lacking such coordination, autonomous HEM-driven scheduling in each residence could unintentionally generate fresh demand peaks during low-price windows, thereby jeopardizing SRMG stability [11]. Hence, fostering P2P energy trading in parallel with uninterrupted two-way data links between HEM platforms and the SRMGO promises markedly better system-wide performance for the microgrid and more favorable economic results for end-users. Ultimately, the widespread presence of DERs and responsive loads (RELs) within smart homes provides the essential foundation for viable P2P energy transactions, which, in turn, secure meaningful bill reductions and tighter control over load-profile fluctuations throughout the SRMG.
An incentive-driven demand response approach is outlined in Ajitha et al. [13], employing IoT-supported home energy management systems (HEMS) tailored to the Indian residential sector, which accounts for 25% of national electricity consumption. The proposed HEMS automates control of household loads during peak periods by shifting loads and optimizing scheduling. The algorithm is deployed in actual residential environments using IoT platforms, with an emphasis on consumer affordability and environmental sustainability. In addition, a photovoltaic (PV)-integrated energy storage system (ESS) is included to ensure continuity of critical loads amid high-demand periods. User preferences derived from survey data are embedded into the HEMS to enhance satisfaction and usability. Implementation of this model holds strong potential to boost microgrid performance overall. However, the work neglects the critical need for bidirectional communication links between smart homes and the SRMG operator (SRMGO), which is essential for coordinated handling of household loads and DERs. Moreover, as plug-in hybrid electric vehicles (PHEVs) gain wider adoption, the lack of dedicated charging/discharging strategies limits the effectiveness of home-level energy management.
A new optimization and planning framework for residential microgrids is detailed in Ling and Mulani [14], integrating renewable sources with advanced storage solutions. The primary aim is to boost efficiency, dependability, and sustainability in energy handling by integrating PV systems, air conditioning (AC) units, and battery storage, while drawing on historical weather records and multiple control techniques to manage inherent uncertainties. The analysis covers diverse tariff regimes and load behaviors, underscoring the framework’s adaptability in elevating overall system outcomes. It further stresses the importance of advanced energy management tools for continuous oversight and fine-tuning of generation and storage activities. While the study provides a robust framework for residential microgrid energy oversight, it omits detailed modeling of smart-home consumption behavior and inter-home energy transfers. The role of PHEVs in shaping energy management in these microgrids is also unaddressed, highlighting a clear research gap.
In Zhu et al. [15], a dual-layer architecture is proposed to coordinate local energy markets and balance services across residential microgrids in an active distribution network. Here, the network operator oversees both segments: an intra-day energy market involving nonprofit aggregators and residential microgrids, followed by an intra-hour balancing market featuring profit-motivated aggregators for flexible loads and electric vehicles. The operator can dynamically reconfigure the network during these operations. Profit calculations for aggregators rely on Karush–Kuhn–Tucker optimality conditions and strong duality principles, formulated as mathematical programs with equilibrium constraints that tie aggregator gains to user utility metrics. Yet, the treatment of microgrids in this work largely ignores the contributions of smart homes and their dedicated energy management systems, especially concerning impacts on targeted goals. Incorporating alternative resources, such as ESS, and recognizing community-level participation in resource use could yield stronger results. Furthermore, the analysis falls short in exploring collaborative user interactions, which remain fundamental to the successful operation of smart residential microgrids, underscoring the value of a broader, more inclusive approach in subsequent studies.
Toosi and Merabet [16] investigate the implications of hourly versus sub-hourly battery scheduling protocols in residences equipped with electric vehicles and ESS. Drawing on a bilevel mathematical programming structure combined with a rule-based two-tier method, the study assesses how varying time resolutions and commitment schemes affect battery capacity degradation. Two core formulations are applied: a mixed-integer linear program that optimizes without regard to battery aging, and a mixed-integer quadratically constrained program that enforces degradation limits via a quadratic function. The ultimate objective is to pinpoint scheduling policies that maximize energy efficiency while curbing long-term battery wear. Nevertheless, this investigation overlooks the effects of energy sharing among smart homes on overall management practices and ESS charge/discharge cycles. Accounting for such interactions—essential to smart microgrid dynamics—would inevitably influence both household energy strategies and ESS performance.
An enhanced community-oriented energy management system for microgrids is presented in Abdelhameed et al. [17], aimed at optimizing residential consumption and facilitating energy sharing among smart homes. The approach adopts constrained mixed-integer programming, blending state-of-the-art optimization with cooperative game-theoretic pricing to tackle persistent issues in load coordination and efficient P2P trading. It operates under dynamic time-of-use tariffs for grid-supplied energy, a modified mid-market rate for internal P2P trades, and feed-in tariffs for grid exports. However, the P2P framework examined here struggles to concurrently satisfy the technical priorities of the microgrid and the financial priorities of participating households. In addition, the model inadequately accounts for responsive household loads, diverse DER categories, and resident comfort in smart homes.
Saif et al. [18] describe an all-encompassing evaluation framework for smart homes that evolves from mere efficiency toward active energy production within community energy management settings, with particular attention to DER integration stages. It analyzes seasonal variations and their distinct energy signatures, grounded in real-world data from an Irish energy community. To aid decarbonization efforts in smart grids, the work provides actionable recommendations to accelerate the adoption of smart home technologies. Had the authors incorporated data flows between smart homes and the grid operator, while enabling direct energy exchanges among homes, the resulting structure could offer substantially greater effectiveness for residential microgrids.
In Afzal et al. [19], a joint energy management approach is proposed for community microgrids that capitalizes on IoT-based smart meters and renewable DERs. The model devises a consumption plan to lower electricity bills for both individual users and the collective group. Participants—homeowners with personal renewables, a communal microgrid, and potentially the utility—collaborate to schedule daily appliance operations to minimize costs, while protecting consumer privacy. The framework is reinforced by blockchain for secure, reliable interactions among stakeholders. This research, however, overlooks the fact that prioritizing purely economic goals in consumption scheduling risks inducing peak demand during low-price periods, potentially exceeding technical limits. Properly managing relations between smart home–microgrid operators requires balancing the technical aims of microgrid operators with the economic needs of smart home occupants.
Safdarian et al. [20] introduce an innovative decentralized coordination mechanism for demand response in smart residential microgrids (SRMG), designed to avert serious technical violations while preserving occupant comfort and avoiding any rise in consumer costs. The key advancement involves HEM systems that engage in lightweight, non-intrusive exchanges with the SRMG operator (SRMGO) to refine the aggregate system load profile collaboratively. This is achieved through iterative cycles of sharing load data and submitting schedule adjustments, continuing until convergence to an optimal profile is reached. However, the study does not explore how distributed energy resources (DERs) or responsive electrical loads (ERLs) could further enhance the targeted performance metrics. Moreover, peer-to-peer (P2P) exchanges among smart homes are not included in the model. The framework is also demonstrated only for a small-scale set of smart homes, rendering it impractical for deployment in realistic SRMG environments.
In Abolhasanzadeh and Barati [21], a fresh matching technique is developed to align SRMGO objectives with HEM preferences in decentralized P2P energy trading environments, by dynamically integrating user-defined priorities. Three distinct preference models are evaluated, focusing on cost, reliability, and security aspects. The method elevates SRMGO’s position in rankings, accommodates heterogeneous HEM requirements, and strikes an effective trade-off between customization depth and processing demands, thereby increasing SRMGO’s overall adaptability. Nevertheless, this work omits any analysis of how responsive electrical loads (ERLs) and DERs could contribute to better economic outcomes for smart home owners. It likewise neglects to investigate the effects of direct interactions among neighboring smart homes.
Razavi et al. [22] tackle the inherent tension between peer-to-peer energy trading activities and the operational decisions imposed by the SRMGO, a barrier that restricts broader adoption of P2P mechanisms. To mitigate this friction, the authors suggest enabling the SRMGO to better model smart home behavior patterns, despite the significant analytical challenges posed by the nonconvex, nondifferentiable nature of HEM optimization problems. The primary contribution is a novel modeling and design paradigm specifically for structuring P2P interactions between smart homes. That said, the analysis is limited to a narrow set of DER types and completely disregards the potential of responsive electrical loads (ERLs) to meet the SRMG’s technical performance targets. Implementing decentralized coordination between smart homes and the SRMG would likely allow substantial improvements to the objectives pursued in this research.
Following a thorough review of the existing body of work, Table 1 provides a comparative overview of selected recent studies relative to the model proposed in this paper.
Table 1. Comparison of recent literature with the proposed model.
References | View point | ERLs | DERs | Data flow between SRMGO and HEM | P2P interaction | Decentralised framework | |
SRMG | Smart home | ||||||
Ajitha et al. [13] | — | * | * | * | — | — | — |
Ling and Mulani [14] | * | — | — | * | — | — | — |
Zhu et al. [15] | * | * | — | * | — | * | — |
Toosi and Merabet [16] | — | * | — | * | — | — | — |
Abdelhameed et al. [17] | * | * | — | * | * | * | — |
Saif et al. [18] | — | * | * | * | — | — | — |
Afzal et al. [19] | — | * | * | * | — | * | — |
Safdarian et al. [20] | * | * | — | — | * | — | * |
Abolhasanzadeh and Barati [21] | * | — | — | — | — | * | * |
Razavi et al. [22] | — | * | — | * | — | * | — |
Proposed model | * | * | * | * | * | * | * |
According to Table 1, only the works by Zhu et al. [15], Abdelhameed et al. [17], and Safdarian et al. [20] simultaneously consider viewpoints from both the SRMG and individual smart homes. Responsive electrical loads (ERLs) and distributed energy resources (DERs) are incorporated into the analyses in Ajitha et al. [13], Saif et al. [18], and Afzal et al. [19]. Bidirectional data exchange between the SRMGO and HEM systems, combined with peer-to-peer interactions among smart homes, is addressed exclusively in Abdelhameed et al. [17]. Finally, a fully decentralized architecture is adopted solely by the studies in Safdarian et al. [20] and Abolhasanzadeh and Barati [21].
Contemporary research on energy management in smart residential microgrids (SRMG) has proposed community-based architectures that enable peer-to-peer (P2P) energy exchanges among smart homes. Despite these advances, several important shortcomings persist, as detailed below:
· These existing frameworks fall short in simultaneously satisfying the technical constraints of the SRMG and the financial priorities of participating smart homes.
· Present approaches do not sufficiently incorporate the full spectrum of responsive electrical loads (RELs) in smart homes alongside the necessary distributed energy resources (DERs) required for efficient energy sharing.
· Continuous data communication between home energy management (HEM) systems and the SRMG operator (SRMGO)—a channel that could deliver considerable improvements and shared advantages for both parties—remains largely unexplored.
As a result, there exists a pressing need to develop a comprehensive mathematical formulation that enables decentralized peer-to-peer interactions among smart homes. Such a model should prioritize smoothing the microgrid load profile while simultaneously minimizing energy expenditures for smart home residents within the broader context of SRMG energy management research.
The principal innovations presented in this work include the following:
· Achieves simultaneous alignment of objectives between the SRMG operator (SRMGO) and individual smart homes.
· Proposes a decentralized coordination mechanism that supports ongoing data interchange between the SRMG and home energy management (HEM) systems.
· Avoids dependence on electricity pricing signals provided by the SRMGO as the primary driver.
· Recognizes and accommodates potential divergences between the goals of smart homes and those of the SRMGO.
· Grants smart homes autonomy to dynamically reallocate responsive electrical loads (RELs) and distributed energy resources (DERs) through persistent data communication.
· Shares solely the surplus energy quantities available from each smart home, thereby protecting the privacy of individual household consumption patterns from the SRMGO.
· Guarantees that the disconnection of any single smart home does not compromise the SRMG’s overall energy management, owing to independent, parallel communication links maintained with each home.
Figure 1 depicts the configuration of the smart residential microgrid (SRMG) under consideration. The illustration highlights both responsive electrical loads (RELs) and nonresponsive loads (non-RELs) within smart homes, as well as the distributed energy resources (DERs) installed at the household level. The home energy management (HEM) system serves as the central interface, facilitating bidirectional data and energy flows between each smart home and the SRMG operator (SRMGO). Within each residence, the HEM system oversees local energy decisions, arriving at final schedules after conducting concurrent data exchanges with the SRMGO concerning DER utilization, REL scheduling, and peer-to-peer energy exchanges with neighboring smart homes. Additional elaboration on the decentralized framework is provided below.

Figure 1. Proposed smart homes within SRMG.
The suggested framework is formulated as a bilevel optimization problem. The upper-level sub-problem focuses on minimizing fluctuations in the SRMG load profile. At the same time, the lower-level sub-problems aim to reduce electricity costs for smart homes without compromising homeowner comfort. This bilevel structure is subsequently transformed into an equivalent single-level optimization task by incorporating the lower-level outcomes as constraints within the upper-level objective. Peer-to-peer (P2P) interactions among smart homes play a central role at both optimization tiers. Employing a decentralized solution approach to the resulting single-level problem enables independent energy scheduling for smart homes and their associated DERs. In this setup, each HEM functions as a self-governing decision-making entity. As illustrated in Figure 2, the SRMGO first broadcasts day-ahead electricity prices to all HEM systems. In parallel and without sequential ordering, the HEMs generate preliminary energy management schedules designed to minimize their respective household costs, accounting for responsive loads (ERLs) and available DER capacity. The SRMGO then assesses these submissions to evaluate their collective influence on the system-wide load profile, adherence to network constraints, and avoidance of congestion risks. Operating in this capacity as a virtual network overseer, the SRMGO monitors aggregate load and generation deviations across the microgrid. Any potential overloads or congestion issues are identified via discrepancies in the overall SRMG load profile. Feedback on these profile deviations is subsequently transmitted back to the HEM systems, enabling them to determine whether modifications can be implemented to reduce deviations further without penalty. A critical condition for encouraging HEM participation in this decentralized process is that no increase in operational costs occurs—meaning that any required adjustments must preserve or further decrease the initially proposed minimum energy expenditure while simultaneously advancing the SRMG’s technical performance, particularly by lowering load profile variations. Upon receiving this feedback, HEM systems re-evaluate and, if necessary, update their schedules before resubmitting them to the SRMGO. The iterative cycle persists until convergence is achieved, with no additional reduction in load profile deviations possible. A key advantage of this decentralized methodology is the preservation of privacy. Each smart home discloses only aggregate surplus energy figures when required for P2P exchanges, ensuring that detailed individual consumption patterns remain confidential and inaccessible to the SRMGO. The procedural sequence of this framework is visualized in the flowchart presented in Figure 2.

Figure 2. Flowchart of the decentralized framework.
The coordination between the SRMG operator (SRMGO) and home energy management (HEM) systems is modeled as a bilevel optimization problem that simultaneously addresses the distinct priorities of each entity. The primary goal of each HEM system is to minimize the daily electricity costs of its respective smart home. By achieving cost minimization at the individual household level, the aggregate energy expenditure across the entire SRMG is consequently lowered. The secondary layer, in turn, seeks to minimize deviations in the SRMG load profile and thereby flatten it, while ensuring that the cost-minimization results from the first layer remain unchanged or improve. This overall structure incorporates peer-to-peer (P2P) energy transactions among smart homes, encompassing both energy purchases and sales, to realize the specified technical and economic targets.
From the HEM perspective, the SRMGO first broadcasts the day-ahead electricity price schedule to every smart home. Each HEM system then optimizes the scheduling of its distributed energy resources (DERs) and responsive electrical loads (RELs) to minimize household energy costs. The total energy cost for the SRMG is the sum of the costs across all participating smart homes permitted to engage in mutual energy trading (buying and selling), as follows:
(1)
In this context, COSTSRMG denotes the total energy cost of the SRMG, reflecting the aggregated consumption costs of all smart homes. The variables ρbuy and ρsell represent the buying and selling prices of energy at time interval t, respectively. HEbuyh,t and HE sellh,t indicate the total energy purchased and sold by smart home h at time t, respectively. The binary variables Ibuyh,t, and Isellh,t indicate whether smart home h is engaged in buying or selling energy at time t.
The subsequent objective focuses on minimizing the load profile deviation of the SRMG (LPDSRMG). This function is constrained such that the energy cost for each smart home does not increase relative to the value obtained from the initial cost-minimization objective. Upon receiving the individual load profiles from all smart homes and aggregating them, the SRMGO evaluates the resulting system-wide load profile using this second objective function. It then solicits feedback from the HEM systems to refine the second objective iteratively. In essence, the SRMGO’s initial evaluation criterion is the aggregate SRMG load profile; through repeated iterations, enhancements are pursued via adjustments proposed by each smart home. The formulation of this second objective function is given below:
(2)
Here, ESRMGmean represents the average energy consumption across the entire SRMG, computed accordingly.
(3)
The total energy consumed by each smart home at time t consists of two parts. The first part, HEbuyh,t ,SRMG, corresponds to energy procured directly from the SRMG, while the second part, HEbuyh,t ,neighbor, accounts for energy acquired from neighboring smart homes within the SRMG. Thus, the overall energy consumption of each smart home is given by the following expression.
(4)
Similarly, the energy sold by each smart home is modeled through the equation below:
(5)
Where HEsellh,t ,neighbor denotes the quantity of energy sold by smart home h to neighboring smart homes in the SRMG.
It is important to note that this framework accounts for simultaneous buying and selling activities. As a result, the full discharge capacity of energy storage systems (ESS) and plug-in hybrid electric vehicles (PHEV), along with total generation from photovoltaic (PV) systems, is not fully consumed locally by the households that own them. Rather, a portion of this available power is designated for P2P trading within the SRMG.
The total energy made available by each smart home for P2P exchange within the SRMG—originating from ESS, PHEV, and PV systems—is mathematically represented as follows. In this expression, the amounts of energy supplied for sharing at each time interval t are denoted as ESSSRMGdisch, PHEVSRMGdisch, and PVSRMGdisch for the respective technologies in smart home h.
(6)
Smart homes are prohibited from simultaneously buying and selling energy in the same time interval. This constraint is enforced through the following condition.
(7)
Within the proposed framework, the SRMG does not export energy to the main distribution grid; all P2P energy transactions are confined internally among the smart homes. Consequently, the total energy purchased by smart homes within the SRMG must exactly equal the total energy sold by other smart homes in the same SRMG at every time interval, maintaining this balance as shown below.
(8)
The energy purchased by each smart home serves to meet the household electrical loads and the charging needs of its DERs. To ensure local load balance within each smart home, the mathematical model for the total purchased energy at each time interval is formulated accordingly.
(9)
In this formulation, HERELh,j and HENonh,t −REL denote, respectively, the energy demand of the jth responsive electrical load (REL) and the aggregate consumption of all nonresponsive electrical loads (non-RELs) during time interval t. The binary variable IRELh,j,t is associated with the jth REL at interval t; a value of 1 indicates that the jth REL is consuming energy in that specific interval. The permissible operating windows for these RELs are constrained as follows:
(10)
Where sj and fj represent the earliest allowable start time and latest allowable end time for operating the jth REL in smart home h, as specified by the homeowner to support effective energy scheduling, URELj denotes the required operating duration of the jth responsive load. Under this setup, any binary variable linked to a REL is forced to zero outside the designated time window. To ensure continuous, uninterrupted operation required by responsive loads, the active intervals must form a contiguous block.
(11)
(12)
(13)
Where yRELh,j,t and zRELh,j,t are binary variables indicating the activation (startup) and deactivation (shutdown) of the jth responsive load, respectively. Setting yRELh,j,t = 1 corresponds to switching on REL j at time t, while zRELh,j,t = 1 corresponds to switching it off at time t.
The operating window for the bath’s heating system (BHS) is user-defined and activated only once per day. In the model, HEBHSh quantifies the BHS’s energy consumption, and IBHSh,t is a binary variable indicating its status during interval t. The preferred operating periods for the BHS are determined by the smart home owners and aligned with their individual consumption patterns, structured according to the following constraints:
(14)
Where ts and tf denote the start and end intervals for BHS operation as proposed by the homeowners of the hth smart residence. The parameter UBHSh,t represents the homeowner-recommended time slots for running the BHS over the single-day planning horizon. As a result, the BHS energy consumption is restricted to the user-specified window, with consumption outside these intervals set to zero.
Within the smart home energy consumption model, air conditioning (AC) usage for indoor temperature control is classified as a responsive electrical load (REL). Here, HEACh denotes the energy drawn by the AC unit, and IACh,t is the binary variable indicating AC operation during interval t; IACh,t = 1 signifies active temperature regulation by the AC system.
The indoor temperature dynamics of the hth smart home are governed by:
(15)
(16)
Where θhomeh,t is the indoor temperature at time t in the hth smart home, θACh,t,set is the desired setpoint temperature, θmargin is the allowable temperature deviation threshold, kroomθ is the room thermal constant, θambh,t−1 is the outdoor ambient temperature in the previous interval, khuman is the heat transfer coefficient between occupants and the environment, nhumant−1 is the number of occupants present in the previous interval, θhuman is the average human body temperature, keffAC is the cooling efficiency coefficient of the AC unit, θgAC is the temperature guard band, and Iθh,t−1 is the binary variable reflecting the AC unit’s operational state in the prior interval.
In modeling smart home energy requirements, HEESSh,t ch, and HEPHEVh,t ch represent the charging energy demanded by the energy storage system (ESS) and plug-in hybrid electric vehicle (PHEV), respectively, during interval t.
The parameters ηESSh ch and ηPHEVh ch indicate the AC-to-DC conversion efficiencies for ESS and PHEV charging, respectively. The binary variables IESSh,t ch and IPHEVh,t ch indicate whether charging is active for the ESS and PHEV at time t (1 denotes charging). Furthermore, ,and PVhome disch and HEh,t represent the amounts of energy supplied locally to the hth smart home from its ESS, PHEV discharge, and PV generation, respectively, within the same interval.
Uncoordinated scheduling of ESS and PHEV charging/discharging can provoke demand peaks at particular times, leading to imbalances in energy distribution and generating technical, economic, and reliability issues for the SRMG. Therefore, the stored energy in ESS and PHEV units can be strategically managed within the HEM framework to facilitate more effective peer-to-peer (P2P) energy exchanges among smart homes.
The discharge energy from ESS and PHEV, together with PV-generated power, is allocated according to the smart home’s internal needs or redirected to meet P2P requirements of neighboring homes in the SRMG. Accordingly, the mathematical expressions for discharge from ESS and PHEV, as well as PV output, are defined as follows:
(17)
(18)
(19)
Where ηESSh disch, ηPHEVh disch, and ηPVh, DC−AC are the DC-to-AC conversion efficiencies for the ESS, PHEV, and PV systems, respectively. HEESSh,t disch and HEPHEVh,t disch denote the total discharged energy from the ESS and PHEV of smart home h during interval t. HEPVh,t, expected represents the forecasted PV energy production, obtained via probabilistic methods. The binary variables IESSh,t disch, and IPHEVh,t disch indicate whether discharge is occurring from the ESS and PHEV of the hth home at time t, respectively.
In developing this study, the mathematical relationships for distributed energy resources (DERs)—including ESS, PHEV, and PV—were constructed based on established models from Wang et al. [23], Sattarpour et al. [24], and Sattarpour et al. [25]. These references provide equations for state-of-energy (SOE) calculations under varying load conditions, limits on maximum charging and discharging rates, constraints on PHEV energy availability when the vehicle is absent from the home, and probabilistic distributions for solar irradiance. They also enable computation of expected PV output while accounting for generation uncertainties. Thus, the formulations adopted here draw significantly from the principles detailed in these sources.
Beyond the various elements incorporated into the modeling process and reflected in the mathematical structure, it is essential to account for the physical limits on energy transfers between the SRMG and individual smart homes. The following equation specifies the lower and upper bounds on the energy each smart home can purchase from or sell to the SRMG.
(20)
Where HEmaxBuyh,t and HEmaxSellh,t denote the maximum allowable quantities of peer-to-peer (P2P) energy that smart home h can purchase or sell, respectively, during time interval t. The constraints governing energy transfers between the main distribution network and the SRMG are also incorporated. The following equation defines the lower and upper limits on the energy the SRMG can draw from the main distribution network.
(21)
Where TEmaxt Buy, SRMG represents the maximum energy that the SRMG is permitted to purchase from the main distribution network in time interval t.
The approach developed in this study is applied to a smart residential microgrid (SRMG) comprising 500 smart homes, grouped into four distinct categories. These categories vary in the composition and quantity of responsive electrical loads (RELs), nonresponsive electrical loads (non-RELs), and distributed energy resources (DERs). The distribution consists of 100 homes of Type 1, 50 of Type 2, 200 of Type 3, and 150 of Type 4. Table 2 lists the smart appliances in each smart home category, along with homeowner-suggested operating time windows. The analysis covers a full 24-hour period for the SRMG, discretized into 96 15-minute time intervals.
Table 2. Characteristics of smart appliances [24].
Smart appliance inventory | Daily energy usage | Energy per operating interval | Required duration (hours) | Home category 1 (suggested time range) | Home category 2 (suggested time range) | Home category 3 (suggested time range) | Home category 4 (suggested time range) |
Washing machine | 1.5 kWh/day | 0.25 kWh/interval | 1.5 | 32–96 | 40–96 | 50–88 | 32–96 |
Dishwashing machine | 1 kWh/day | 0.25 kWh/interval | 1 | 76–96 | — | 80–94 | 72–88 |
Tumble dryer | 1.4 kWh/day | 0.35 kWh/interval | 1 | — | 1–32 | — | 6–60 |
Electric slow cooker | 1.2 kWh/day | 0.2 kWh/interval | 1.5 | — | 36–50 | — | 36–76 |
Microwave oven | 0.8 kWh/day | 0.2 kWh/interval | 1 | 64–84 | 60–96 | 68–96 | — |
Robotic vacuum | 0.9 kWh/day | 0.15 kWh/interval | 1.5 | 1–96 | 1–96 | 1–96 | — |
Exhaust hood (kitchen) | 0.5 kWh/day | 0.25 kWh/interval | 0.5 | 80–96 | — | 76–96 | 68–92 |
As shown in the table, the washing machine is identified as a responsive electrical load (REL). This appliance typically completes about 6 cycles per day, with each cycle lasting approximately 90 minutes and consuming roughly 0.25 kWh, for a total daily consumption of about 1.5 kWh. Such appliances appear across all smart home types, while others, such as slow cookers, are limited to certain categories. The table further specifies the preferred operating intervals recommended by homeowners to maximize resident comfort across the different home configurations. These user-defined windows are processed using GAMS software to determine optimal scheduling for each appliance. All simulations are performed on a personal computer equipped with an Intel Core i5 processor operating at 2.40 GHz and 4 GB of RAM. The optimization tasks are solved using IBM ILOG CPLEX 12.4 within the GAMS modeling environment.
Within each smart home category, the bath heating system (BHS) scheduling is customized according to homeowner preferences. For Type 1 smart homes, the recommended BHS operating window spans intervals 72 to 96, distributed across six separate time slots. Type 2 homes utilize BHS between intervals 60 and 80 over the same six slots. For Type 3 homes, the suggested range spans 56 to 96 across eight slots, while Type 4 homes operate BHS between 40 and 88 across ten slots. Across all categories, BHS usage by occupants results in an energy consumption of 0.325 kWh per active interval.
It should be noted that, to reflect diversity among smart home configurations, not every possible REL or DER is included in every category. In particular, the air conditioning (AC) system is omitted from the RELs in Type 4 smart homes. Similarly, plug-in hybrid electric vehicles (PHEVs), energy storage systems (ESSs), and photovoltaic (PV) systems are excluded as DERs from Type 3, Type 2, and Type 1 homes, respectively. Figure 3 depicts the daily variation in the number of occupants present in smart homes across different time intervals. According to the AC temperature dynamics model, the number of residents significantly affects the system’s ability to maintain the desired indoor temperature.

Figure 3. The number of residents of smart homes.
In the model, the AC energy consumption per interval is set to 0.225 kWh for Type 1 smart homes, 0.25 kWh for Type 2, and 0.275 kWh for Type 3. The desired indoor temperature setpoint is fixed at 25 °C, with an allowable deviation margin of 10 °C. The room thermodynamic constant is uniformly set to 0.1 for all home types. The heat transfer coefficient between occupants and the environment is 0.005, human body temperature is held at 37 °C, and the AC cooling effect coefficient is –0.9. Outdoor ambient temperatures surrounding the smart homes are randomly sampled between 18 °C and 33 °C [26].
In modeling the smart homes, the configuration of energy storage systems (ESS) and plug-in hybrid electric vehicles (PHEV) follows the specifications provided in Table 3. This study assumes that every smart home within the SRMG employs the same ESS and PHEV models with uniform capacity ratings, although their initial state-of-charge levels may differ. To extend the service life of these devices, the minimum allowable charge and discharge rates for both ESS and PHEVs in each time interval are constrained to 26% of their respective maximum rates [23-25]. The central focus of this research is to develop and evaluate an effective decentralized peer-to-peer (P2P) energy trading mechanism involving smart homes and the SRMG operator (SRMGO), with particular attention to the coordination protocol, convergence behavior, and energy-sharing efficiency. Uniform ESS and PHEV parameters are therefore adopted to ensure that observed performance differences arise solely from the proposed optimization and trading logic rather than from equipment variability. At the same time, diversity across smart home categories is preserved to reflect realistic scenarios. As detailed in Table 3, four distinct smart home types are considered, each with a different energy profile: Type 1 and 4 are equipped with both ESS and PHEV; Type 2 includes PHEV but omits ESS; and Type 3 includes ESS but omits PHEV. This categorization accounts for different patterns of energy storage consumption and participation. The proposed framework remains flexible and scalable, readily capable of incorporating heterogeneous ESS and PHEV specifications. Future extensions of this work will explicitly address and validate this heterogeneity to enhance the approach’s real-world applicability.
Table 3. ESS’s and PHEV’s input data [25, 27].
Specification | Home category 1 | Home category 2 | Home category 3 | Home category 4 |
Initial stored energy of ESS and PHEV (kWh) | (0.531), (0.85) | (−), (0.425) | 0.7965, (−) | (1.062), (0.425) |
Time intervals when the PHEV is outside the residence | 36–56 | 28–60 | — | 32–52 |
Energy utilized by PHEV while away from home (kWh) | 4.25 | 5.1 | — | 5.95 |
Maximum storage capacity of ESS and PHEV (kWh) | (4.25), (6.8) | (4.25), (6.8) | (4.25), (6.8) | (4.25), (6.8) |
Upper limit of charging/discharging rate for ESS and PHEV (kWh/interval) | (0.2655), (0.425) | (0.2655), (0.425) | (0.2655), (0.425) | (0.2655), (0.425) |
Lower limit of charging/discharging rate for ESS and PHEV (kWh/interval) | (0.2655 × %26 = 0.06903), (0.426 × %26 = 0.1105) | (0.2655 × %26 = 0.06903), (0.426 × %26 = 0.1105) | (0.2655 × %26 = 0.06903), (0.426 × %26 = 0.1105) | (0.2655 × %26 = 0.06903), (0.426 × %26 = 0.1105) |
Efficiency coefficient for ESS and PHEV | (0.96), (0.96) | (0.96), (0.96) | (0.96), (0.96) | (0.96), (0.96) |
The photovoltaic (PV) system installed in each smart home has a rated capacity of approximately 1000 W, consisting of five 200 W solar panels. The solar array in every smart home occupies 6 square meters. Solar irradiance values are considered across intervals 22 to 78 for all smart homes. Although solar radiation data are typically reported at hourly intervals, the analysis in this study uses 15-minute intervals; therefore, irradiance is assumed constant within each set of four consecutive 15-minute slots. Figure 4 shows the power output from the PV systems across these smart homes.
![Figure 4. The generated power of the PV system [25].](https://isespub.com/storage/files/pub-article/f6925fce-b44e-44dd-8521-b67c7ba7e3ee-IUrokBQJG6XyuKb4/image.jpg)
Figure 4. The generated power of the PV system [25].
Figure 5 presents the time-varying electricity pricing structure applied over the planning horizon. The SRMG operator (SRMGO) broadcasts these tariff details to all home energy management (HEM) systems. As illustrated, the pricing follows a time-of-use structure with distinct rates in different periods. All HEM systems adjust their scheduling of responsive electrical loads (RELs) and operation of distributed energy resources (DERs) in response to these price signals.

Figure 5. Electricity price tariff.
The modeling framework accounts for nonresponsive electrical loads (non-RELs) in smart homes, treating them as fixed power demands. Figure 6 depicts the non-REL consumption profiles for the different categories of smart homes. These profiles reveal distinct daily usage patterns and reflect variations in the types and quantities of fixed electrical appliances across the home categories.

Figure 6. Smart home’s non‐RELs profile.
The following section examines the simulation outcomes obtained using the input data described above.
In this study, the smart homes within the SRMG can conduct peer-to-peer energy exchanges. Under the proposed decentralized framework, a portion of each home’s energy supply is obtained from neighboring residences. Table 4 summarises the values achieved for the objective functions under the decentralized model.
Table 4. Results of objective functions.
Description | Home-Type 1 | Home-Type 2 | Home-Type 3 | Home-Type 4 | |
|---|---|---|---|---|---|
Energy cost of each home ($) | 59.28 $ | 90.26 $ | 54.62 $ | 74.58 $ | |
The total energy cost of each type of home ($) | 5928 $ | 4528 $ | 10,924 $ | 11,187 $ | |
OF₁ point of view (first layer)OF₁ = COSTSRMG | 32,567 $ | ||||
LPDSRMG | 128.59 | ||||
OF₂ point of view (second layer)OF₂ = LPDSRMGS.t. COSTSRMG ≤ OF₁ | 123.13 | ||||
COSTSRMG | 32,567 $ |
The results in this table demonstrate that differences in consumption behaviors, combined with variations in the number and types of DERs across smart homes, lead to differences in daily energy costs. The table also reports the performance metrics for both the primary and secondary objective functions. When optimizing only the first objective function (upper layer), the SRMG total energy cost reaches $32,567, and the load profile deviation is 128.59. When subsequently optimizing the second objective function (lower layer) while holding smart home energy costs fixed, the load profile deviation improves to 123.13, while the energy cost remains $32,567. This corresponds to an approximate 4.25% reduction in load profile deviation without any increase in household energy expenditures. These findings confirm that decentralized P2P energy interactions can substantially improve the technical performance of the SRMG—specifically by smoothing the load profile—while preserving economic stability for smart home owners. All subsequent results presented are therefore based on optimization of the second objective function (lower layer). Table 5 presents the optimal scheduling of smart appliances for each smart home category. The optimal operating intervals determined in Table 5 align precisely with the homeowner-preferred time windows specified in Table 2. In other words, the scheduling respects the comfort-driven intervals recommended by the residents themselves in Table 2. As previously highlighted, the availability and characteristics of responsive electrical loads (RELs) vary across the different smart home categories.
Table 5. Optimal scheduling of smart appliances.
Residential Type | Laundry | Dishwasher | Tumble Dryer | Slow Cooker | Microwave Oven | Robotic Vacuum | Kitchen Exhaust Hood |
Type 1 | 75–80 | 77–80 | — | — | 77–80 | 91–96 | 95–96 |
Type 2 | 75–80 | — | 24–27 | 45–50 | 93–96 | 24–29 | — |
Type 3 | 75–80 | 91–94 | — | — | 93–96 | 57–62 | 90–91 |
Type 4 | 75–80 | 76–79 | 57–60 | 57–62 | — | — | 90–91 |
The table shows how the variable energy needs of individual smart appliances align with residents’ operating schedules while safeguarding their comfort preferences. Table 6 displays the carefully planned activation periods for the Battery Heating System (BHS), developed by carefully incorporating the preferred time windows provided by the smart home owners [6]. These carefully selected time slots aim to keep the total electricity expenses of the smart homes as low as possible. To achieve the greatest cost savings, residents should run the BHS only during these most advantageous periods.
By combining Internet of Things (IoT) capabilities with Home Area Network (HAN) infrastructure, smart homes can quickly receive and distribute information about these cost-effective operating windows. This real-time communication equips residents with the knowledge needed to make informed choices and take appropriate action at the right time.
Table 6. Optimal scheduling of BHS.
Category | Home category 1 | Home category 2 | Home category 3 | Home category 4 |
Designated Time Slots | 80, 90, 91, 92, 95, 96 | 61, 62, 77, 78, 79, 80 | 62, 63, 75, 76, 77, 78, 79, 80 | 57, 58, 60, 61, 74, 75, 76, 77, 79, 80 |
Achieving optimal performance from the air conditioning (AC) unit depends on several variables, including outdoor temperature, the number of people in the home, and all parameters in the AC system model. Figure 7 presents these optimized operating schedules for different categories of smart homes [7]. The time periods shown are derived from the second tier of the suggested decentralized evaluation architecture.

Figure 7. Optimal planning of AC systems.
One of the central results of the present work is the precise measurement of peer-to-peer (P2P) energy trading among smart homes within the Smart Residential Microgrid (SRMG). Figure 8 visualizes the P2P energy flows exchanged between homes at various moments throughout the day [8]. It is worth noting that in several intervals, no trading occurs, indicating that those homes did not generate any surplus power to share. In other intervals, however, clear bidirectional or unidirectional energy transfers are visible, demonstrating the internal balance of the SRMG—where total consumption across all homes exactly equals total generation. As a concrete example, during the 31st time slot, a Type 1 home and a Type 4 home each offer 0.097 kW and 0.096 kW of excess energy, respectively, after covering their own requirements. This surplus is then made available to neighboring homes. At the same moment, the Type 2 home purchases the entire available amount, totaling 0.193 kW (the sum of the contributions from Type 1 and Type 4).

Figure 8. P2P energy interactions between smart homes.
Given the multi-objective optimization targets defined for the SRMG, Figure 9 depicts the aggregated energy demand for each time interval [9]. The resulting load curve was intentionally shaped to lower overall energy costs while reducing sharp demand variations. The diagram also reveals several intervals during which zero power is imported from the upstream utility grid. This complete independence from the main network during those periods highlights the effectiveness of local energy coordination within homes, successful P2P trading among participants, and intelligent scheduling of Distributed Energy Resources (DERs).

Figure 9. SRMG’s load profile.
Figure 10 captures the net energy profile of individual smart homes under the influence of their Home Energy Management (HEM) systems [10]. Negative values on the graph during certain intervals clearly indicate times when a home is exporting (selling) energy to neighboring properties through P2P arrangements.

Figure 10. Energy consumption curve of smart homes.
Figure 11 outlines the scheduled charging and discharging windows for Energy Storage Systems (ESS) and Plug-in Hybrid Electric Vehicles (PHEV) across the different smart home types [11]. Under the evaluated framework’s rules, ESS units are not considered for Type 2 homes, and PHEVs are excluded from Type 3 homes.

Figure 11. Optimal operation of (A) ESS and (B) PHEV.
The behavior shown in the figure demonstrates that both ESS and PHEV operations respond directly to local price signals and operational restrictions in each home. Charging activity for both technologies is concentrated in low-price periods, whereas discharging is favored during high-price periods. The extent to which ESS and PHEV units contribute to meeting the overall optimization goals varies across home types, depending on the specific constraints applied. The diagram further confirms that PHEVs remain inactive (neither charging nor discharging) whenever the vehicle is outside the home. Before departure, the HEM system pre-calculates and ensures that a minimum state of charge is reached, ensuring the battery has sufficient energy for the planned trip.
The present research introduces an innovative energy management architecture tailored for a Smart Residential Microgrid (SRMG) composed of interconnected smart homes that actively participate in peer-to-peer energy trading. This fully decentralized solution simultaneously flattens the aggregate load curve, reduces residents’ electricity bills, and preserves occupant comfort through intelligent P2P cooperation. A two-layer optimization procedure lies at the core of the framework, with clear delineation of responsibilities at each layer and well-defined interfaces between individual Home Energy Management (HEM) controllers and the SRMG Operator (SRMGO).
Multiple smart home configurations were evaluated, each incorporating different combinations of Responsive Electrical Loads (RELs)—such as controllable appliances, Battery Heating Systems (BHS), and air conditioning units—together with Distributed Energy Resources (DERs) that include photovoltaic (PV) generation, Energy Storage Systems (ESS), and Plug-in Hybrid Electric Vehicles (PHEV). Numerical simulations showed that thoughtful coordination of these RELs and DERs, together with advanced energy management strategies inside the SRMG, delivers substantial gains in both technical reliability and financial performance.
A comprehensive mathematical model of the proposed SRMG was constructed, relying on several simplifying assumptions concerning the input parameters. All scenarios were solved using the GAMS optimization platform, which enabled detailed sensitivity analysis and comparison of alternative outcomes. This modeling approach deepened insight into the system’s dynamic behavior and enabled more reliable forecasting and decision-making.
Importantly, the simulations confirmed that local HEM controllers can autonomously align their individual consumption and generation plans with the broader SRMG objectives. Thanks to continuous information exchange within the decentralized structure, both the HEM units and the SRMGO benefit from improved coordination, ultimately achieving a 4.25% reduction in load-profile variance while keeping total energy expenditure unchanged.
None
None
None
None
Open Access The author(s) retain copyright. This article is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. It may be shared and adapted for non-commercial purposes with appropriate attribution, an indication of changes, and distribution of adaptations under the same license. Third-party material may be subject to separate terms identified in its credit line. View the license at https://creativecommons.org/licenses/by-nc-sa/4.0/.