Abstract
Worldwide energy demand is increasing exponentially, presenting significant challenges for existing power generation systems to meet this demand. Enhancing energy efficiency has become critical for reducing consumption and addressing the ongoing environmental crisis. Consequently, there is a need for smart control systems that optimize system costs and improve efficiency. Because of the introduction of smart grids, customers can now participate in demand-side management and integrate renewable energy sources (RESs). Electricity consumption during peak hours often leads to increased grid demand and higher costs. However, the integration of RESs enables consumers to operate appliances during peak hours, thereby reducing reliance on grid power. Therefore, residential load management seeks to reduce power peaks and electrical energy costs. In home energy management systems (HEMS), appliance scheduling is crucial because it continually monitors appliance usage, ensuring that energy supply and demand are balanced. This research aims to optimize power usage by reducing peak loads and electricity costs through the integration of RESs, such as solar or photovoltaic (PV) systems, while considering grid limitations, PV capacity, appliance ON/OFF schedules, and time-of-use tariffs. A genetic algorithm (GA) based optimization technique was employed to evaluate the performance of a HEMS and validated with particle swarm optimization (PSO) technique under identical initial conditions for each appliance and their corresponding energy pricing over different periods. The results show that GA achieved a 48% cost reduction compared to PSO, with significant peak load reduction and improved energy optimization when integrated with PV systems. GA also demonstrated better appliance scheduling, with appliances in the “ON” state for 82% of the time, compared to 52% with PSO.
Introduction
Existing power generation systems face significant challenges to meet rapidly increasing global energy demand. The U.S. Energy Information Administration (EIA) projects that global electrical energy demand could rise by one-third to three-quarters by 2050 (U.S. Energy Information Administration (EIA), 2023). In order to avoid problems with the energy supply, utilities may need to reschedule the generation and distribution of electricity due to this significant increase. The majority of energy users, especially in underdeveloped and developing countries, are unfamiliar with demand response programs, making them unable to optimally schedule grid energy usage for increased benefits such as bill reduction and efficient power consumption (Raza et al., 2024).
In a conventional power system, utility providers significantly lower users’ loads during peak time to maintain reliable service (Von Meier, 2024). In addition to considering end users’ demands, utility providers also provide incentives to encourage customers to reschedule their energy usage and help reduce peak demand (Schittekatte et al., 2024, Wang et al., 2024).
Smart grids are modern solutions to many power system challenges, enabling the integration of diverse energy sources for reliable, efficient, and high-quality power delivery to users. This self-sufficient system enhances grid resilience and adaptability (Olatunde et al., 2024). Demand-side management (DSM) is essential in smart grid development for enhancing system security, balancing electricity demand, and ensuring comfort for both customers and utilities. By enabling consumers to make informed energy decisions, DSM supports dynamic energy management (EM) in residential areas. This strategy minimizes the need for additional generation and transmission infrastructure by assisting utilities in lowering peak demand and reshaping the load curve (Williams et al., 2023). A hybrid system, compared to DSM, can significantly reduce electricity costs for customers. Home EM systems (HEMS) are integral to smart grids, enabling demand response applications for residential users. This setup enhances energy efficiency and cost savings in households (Han et al., 2023). Reducing peak demand, generating costs, and utility bills are the goals of HEM. Smart grid techniques including load prediction, price optimization, and appliance scheduling, enhance power management for users. These strategies enhance efficiency and cost-effectiveness for consumers (Sankhwar, 2024).
The HEM unit manages electricity consumption, load scheduling, price requests, renewable energy sources (RESs), grid power availability, appliance status, and battery bank state of charge levels. It connects with HEMS components like the grid, solar, combined heat and power, and smart meters. HEMS unit uses both wired and wireless protocols for data transfer, acting as a router between the Home Area Network and smart meters. These communication technologies enable real-time monitoring and efficient power management (Leitao et al., 2020, Sangswang and Konghirun, 2020).
A standard home contains various appliances that operate at either high or low voltage. Appliances like refrigerators, heating, ventilation, and air conditioning systems, dishwashers, blenders, water pumps, washing machines, juicers, and iron require significant energy, while devices such as lights, televisions, fans, computers, and other small electronics consume minimal power (Hamdan, 2021, Lu et al., 2020, Qayyum et al., 2019).
Establishing an automated intelligent HEM system that can modify energy consumption patterns based on customer preferences and lifestyle—while taking into account factors like power optimization and low price—is becoming increasingly necessary (Constantinou et al., 2024, Li et al., 2024a). These factors have brought attention to the need for smart EM strategies that can manage all kinds of loads and respond to fluctuations in cost.
Optimization techniques have been widely applied to large-scale systems to improve efficiency and reduce costs, particularly in sectors beyond residential applications. The enhanced performance of gas turbine-based combined cooling, heating, and power (CCHP) systems for large-scale uses such as industrial facilities, commercial buildings, and district energy systems is presented (Li et al., 2024b). Another study optimized microgrid operations by integrating demand response and thermal energy storage, reducing operational costs for larger energy networks (Jiang et al., 2022). An optimized CCHP system for a watersport complex, aiming to minimize energy, economic, and environmental losses, was proposed by the authors (Chen et al., 2022). By Han and Ghadimi (2022), a deep learning-based optimal approach was developed for efficient modeling of proton-exchange membrane fuel cells, targeting energy systems in vehicles, stationary power generation, and industrial applications. Additionally, Bo et al. (2022) designed a hybrid renewable energy system combining solar, wind, and fuel cells to electrify a remote area in Turkey, focusing on cost reduction and system reliability in non-residential energy systems. Another study presented an overview of the role of the Internet of Energy (IoE) and smart grids in advancing low-carbon, sustainable energy development to evaluate IoE's impact on reducing CO2 emissions (Ghiasi et al., 2023).
Recent research highlights the potential energy needs of greenhouse agriculture in cold climates by integrating RESs, such as solar and geothermal, with advanced control systems. It evaluates three types of polyethylene materials (Thermax, SolaWrap, and SunSaver) for their thermal insulation and light transmission properties. Using TRNSYS and SketchUp simulations, the research analyzes energy consumption, cost efficiency, and system performance to enhance sustainability in greenhouse operations (Ghiasi et al., 2025). Another study proposes a novel multi-objective optimization approach for greenhouse EM, minimizing grid energy consumption while maximizing battery capacity. Using the ellipse optimization method, key hyperparameters are optimized, and simulations in MATLAB/Simulink show a 50% reduction in the objective function compared to conventional EMS. The smart EMS demonstrates robustness under varying load and shading conditions, enhancing sustainability in GH operations (Jamshidi et al., 2024).
However, despite the significant advancements in HEMS, challenges persist in optimizing energy consumption and minimizing costs without compromising user comfort (Sankhwar, 2024). The variability of RESs, such as solar and wind power, adds further complexity to EM, necessitating robust optimization techniques capable of addressing these dynamic conditions (Olatunde et al., 2024).
An advanced control strategy for integrating renewable energy resources into microgrids using voltage-sourced converters was introduced (Ghiasi, 2022). Employing a multipurpose finite-control set-model predictive control approach, the scheme optimized voltage regulation, power sharing, and operational transitions between grid-connected and island modes. The method significantly reduced computational demand while maintaining efficiency, as validated through MATLAB simulations and hardware experiments.
A different study introduced an improved multi-objective differential evolutionary optimization algorithm for efficient energy dispatch in smart microgrids, balancing economic and environmental objectives. A nonlinear optimization model is developed, incorporating various operational constraints and renewable energy integration scenarios, demonstrating its effectiveness in minimizing costs and emissions (Ghiasi et al., 2021).
The motivation behind this research stems from the urgent need to develop energy-efficient solutions that address the rising global demand for electricity while minimizing environmental impact. With residential sectors contributing significantly to peak energy consumption, optimizing EM through smart systems has become a priority. This study aims to bridge the gap between theoretical advancements in heuristic optimization techniques and their practical implementation in real-world scenarios. By focusing on the integration of RESs and advanced control mechanisms, this research aspires to contribute to the development of sustainable energy solutions that ensure grid reliability, cost efficiency, and consumer comfort.
This study focuses on addressing these challenges by evaluating the performance of two widely used heuristic optimization techniques—genetic algorithm (GA) and particle swarm optimization (PSO)—in the context of residential EM. The primary objectives of this research are to minimize electricity costs, optimize power usage, and enhance the integration of RESs in smart grid environments. By employing MATLAB simulations, the study provides a comparative analysis of GA and PSO, assessing their effectiveness in achieving energy efficiency and cost reduction.
The contributions of this paper are threefold: (1) it introduces a smart HEMS framework that integrates renewable energy with grid power to optimize residential energy consumption; (2) it evaluates the performance of GA and PSO in achieving the desired optimization objectives; and (3) it provides actionable insights into the applicability of heuristic algorithms for real-world EM scenarios.
In the following sections, the methodology, results and discussions, and conclusions and future recommendations are presented, highlighting the advantages and limitations of each optimization technique. This research aims to provide a practical roadmap for enhancing residential EM, contributing to the broader goals of sustainability and grid efficiency.
Methodology
A modern energy grid typically consists of a utility provider and various demand sectors, including residential, commercial, and industrial consumers, with advanced technologies that enable efficient management of energy distribution and consumption, as shown in Figure 1. This study specifically focuses on the residential sector. The electricity demand for the residential sector is met through RESs, such as photovoltaic (PV) panels and electricity imported from the grid.

Representation of a smart power system with service provider and demand sectors.
Modeling of PV
PV systems work by converting light, typically from the sun, into electrical energy. This process occurs through the use of semiconductor materials, which generate an electric current when exposed to light. A PV-array is a collection of multiple PV cells arranged together. In a smart home, a rooftop-mounted PV system is installed to generate electricity. The EM controller links the PV system to the distribution grid when needed, as the smart home cannot fully meet its power requirements using the PV system alone. The PV system's hourly electrical power generation is determined by equation (1) and depends on the amount of solar radiation.
Objective function
One of the most important steps in solving an optimization problem is formulating the objective function. The main objective of this study focuses on optimizing power usage to minimize electricity consumption costs. The objective functions are defined by equations 2–4.
Appliances ratings.
The primary goal of the proposed strategy is to optimize the scheduling of daily load demands for residential customers, aiming to minimize power peaks, while also taking economic considerations into account. The optimal operating points for appliances and generation units are determined using optimization techniques to ensure equilibrium between power generation and consumption.
The proposed HEMS approach incorporates user comfort, appliance constraints, and user interaction alongside cost minimization. Appliance-specific requirements, such as maintaining refrigerator temperatures or ensuring cooking times, are embedded in the optimization model to ensure proper functionality and user satisfaction.
The system allows users to set preferences, such as maximum delays or preferred operation times, which are factored into the optimization process to balance energy efficiency and convenience. Users can also adjust optimization goals, such as prioritizing cost savings or renewable energy utilization, through an interactive interface. This flexibility and adaptability ensure the HEMS meets diverse household needs while promoting active user engagement and practical implementation.
This study presents a comparative analysis of two optimization techniques. The variations in price and power consumption were measured using both the GA and PSO approaches, with the effectiveness of each evaluated by comparing the outcomes.
A smart meter installed in the smart home communicates the customer's energy demand and priorities to the utility provider. The electricity company responds by sending a demand response signal that includes the required appliance scheduling arrangements and optimization guidelines.
The EM controller and the electrical grid communicate directly with the smart meter. The EM controller connects the household appliances through various communication methods and sets their operation schedule. Figure 2 illustrates the flowchart of proposed methodology.

Flow chart of the proposed methodology.
The objective function is defined by equation (5). M: total number of appliances, that is, 5, j: 1, 2…. 5,
First, the function will determine which power source, grid or solar, is greater. When the solar irradiance is sufficient to power the loads, the system will switch to using the power from the solar PV source. If the irradiance is insufficient, the grid will supply the power. Optimization is necessary to reduce grid costs and maximize power consumption when the loads are powered by the power grid. The total cost is calculated by equation (6).
The following limitations apply to the objective functions:
The power generated by the PV should be greater than the power needed to provide the load at specific instant. The total power from the PV and grid sources should precisely meet the required load demand. It is defined by equation (8). Control-variables limit:
Where,
Optimization techniques
The optimization techniques used in this study are as follows:
Genetic algorithm
Natural evolution acts as the inspiration for the optimization method known as a GA (Alhijawi and Awajan, 2024). It uses “chromosomes” to represent appliance on/off states, with the chromosome length indicating the amount of load items that need to be scheduled. GA is effective for computational optimization and works well in complex, multi-modal search spaces. The process involves:
Initialization: Creating a random population of chromosomes. Fitness evaluation: Assessing the fitness of each chromosome and selecting parent chromosomes. Crossover: Combining parent chromosomes to generate offspring using methods like single-point or two-point crossover. Mutation: Introducing genetic diversity by inverting selected bits in the offspring.
GA iterates through generations to find an optimal solution. Figure 3 displays the GA's workflow.

Workflow of GA technique.
Particle swarm optimization
PSO is an optimization method inspired by nature that overcomes obstacles by using intelligent swarms to address substantial complex optimization problems, such as the curse of dimensionality and delayed convergence faced by traditional analytical methods (Yao et al., 2024). Figure 4 shows the workflow of PSO.

Workflow of PSO technique.
In PSO, candidate solutions are represented as particles with positions and velocities. The algorithm evaluates the fitness of every location of particles and selects the best solutions for each particle. The global-best is determined by comparing the best solution values across all particles. The global-best, the control parameters, and the particles’ prior best locations are used by the algorithm to update the particle locations. This iterative approach continues until the stoppage conditions are satisfied, yielding the best appliance scheduling solution.
The HEMS system addresses the variability and uncertainty of RES generation through predictive modeling, energy storage integration, and hybrid operation. Predictive modeling uses historical and real-time data to forecast energy generation, enabling dynamic scheduling of appliances based on anticipated renewable availability.
Energy storage systems, such as batteries, play a crucial role in buffering excess energy during peak RES generation periods, ensuring consistent supply during low-generation intervals. Additionally, the HEMS operates in a hybrid mode, seamlessly integrating grid power to maintain stability and reliability when renewable energy is insufficient.
Optimization algorithms like GA and PSO incorporate constraints to balance renewable energy utilization and grid dependency, prioritizing critical loads and ensuring efficient operation. These mechanisms collectively enhance the system's resilience, prevent over-reliance on intermittent sources, and maintain grid stability.
Results and discussions
This section discusses the outcomes and efficacy of the scheduling schemes in terms of electrical energy cost savings and power optimization. To assess the performance of the HEMS, extensive simulations are conducted in MATLAB. Simulink is used to construct a smart grid and load management circuit. The values are subsequently imported to plot the outcomes. Two heuristic methods, GA and PSO, are used in these simulations to compare the objectives. The efficiency of both algorithms’ performances is assessed by comparing their output.
Power optimization and analysis
The power optimization profiles presented in Figures 5(a) and (b) highlight the differences in grid power consumption when applying GA and PSO. Using GA, a significant increase in solar power is observed compared to grid power. In contrast, PSO results in higher grid power consumption and a smaller solar power contribution during the last hour. Although both GA and PSO show peaks in solar power according to power analysis as indicated in Figure 6(a) and (b), the peak for grid power is more noticeable with PSO than with GA. This indicates that GA performs better in power optimization, achieving a more efficient use of energy. Specifically, when GA is applied, nearly 48% more energy is saved compared to using PSO.

Optimization of power using (a) GA, (b) PSO.

Power analysis using (a) GA, (b) PSO.
Cost analysis
The grid cost profile, analyzed using GA and PSO as shown in Figure 7(a) and (b), reveals that the hourly cost of grid power is higher at approximately 1, 2.5, and 7.6 h when PSO is applied compared to GA. These findings demonstrate that GA is more effective in reducing electricity costs, consistently resulting in lower grid power costs. Therefore, GA proves to be more efficient than PSO in terms of electricity cost reduction.

Cost analysis using (a) GA, (b) PSO.
Appliances’ time of operation
The operating times of various appliances, such as central cooling, refrigerator, washing machine, dishwasher, and generic load, are analyzed using GA and PSO. In Figures 8(a) and (b) and 9(a) and (b), the results show that with GA, appliances like central cooling and refrigerator remain “on” for 80% of the time and “off” for 20%, while with PSO, they are “on” for 55% and “off” for 45%.

Time of operation of central cooling using (a) GA, (b) PSO.

Time of operation of refrigerator using (a) GA, (b) PSO.
The operation times of the washing machine, dishwasher, and generic load are shown in Figures 10(a) and (b), 11(a) and (b), and 12(a) and (b), respectively. For both the washing machine and generic load, when GA is used, the appliances remain “on” for 84% of the operation time and “off” for 16%. In contrast, with PSO, the appliances are “on” for 50% and “off” for 50%. For the dishwasher, with GA, the appliance stays “on” for 85% and “off” for 15%, while with PSO, it operates “on” for 50% and “off” for 50%.

Time of operation of washing machine using (a) GA, (b) PSO.

Time of operation of dishwasher using (a) GA, (b) PSO.

Time of operation of generic load using (a) GA, (b) PSO.
Table 2 shows the appliances and their respective operating times. It indicates that when GA is applied, appliances are in the “on” state for 82% of the total operating time and in the “off” state for 18% of the total operating time. When PSO is applied, appliances are in the “on” state for 52% and in the “off” state for 48% of the total operating time. So, GA proves to be more effective compared to PSO.
Appliances’ time of operation.
Conclusions and future recommendations
Home EM within smart grids has become a prominent research topic in recent years. The optimization methods for DSM and the integration of RESs into the smart grid are proposed in this paper. In order to help consumers and the grid as a whole, the main goal of this research is to optimize power usage by reducing peak loads and lowering grid electrical energy costs.
To achieve these objectives, optimization methods such as GA and PSO have been employed, and a comparison of their outcomes in terms of optimization of power and electrical energy cost reduction has been conducted. This research demonstrates the effectiveness of heuristic optimization techniques, specifically GA and PSO, in enhancing residential EM. The comparative analysis shows that GA outperforms PSO in achieving greater energy cost savings and better utilization of RESs, with cost reductions of approximately 48%. Additionally, GA ensures a more consistent optimization of appliance schedules, maintaining user comfort while minimizing reliance on grid power. In terms of operational efficiency, when GA was applied, appliances were in the “on” state for 82% of the total operating time, while with PSO, appliances were “on” for only 52% of the time. This demonstrates that GA is more effective in optimizing energy consumption and reducing costs.
These findings highlight the potential of heuristic algorithms as practical solutions for addressing challenges in smart grid environments, particularly with the integration of RESs. However, the study also acknowledges the computational demands of these algorithms, suggesting that future research could explore hybrid optimization methods to balance efficiency and complexity.
Overall, the study contributes to the ongoing efforts toward sustainable EM by providing actionable insights and a robust framework for implementing advanced optimization techniques in real-world applications. By addressing both economic and environmental goals, this research supports the transition to smarter, greener energy systems.
The simulations provide a controlled platform to evaluate the proposed HEMS system's feasibility using real-world data, such as residential energy consumption patterns and renewable generation profiles. While the simulations closely reflect practical conditions, no experimental studies or field trials have been conducted yet.
Future work will focus on implementing the HEMS in real-world residential settings equipped with renewable energy systems and storage to validate its effectiveness. These trials will assess cost savings, grid reliability, and user satisfaction, ensuring the system's scalability and adaptability for practical deployment.
The proposed HEMS approach faces limitations, including dependence on accurate real-time data and the computational complexity of optimization algorithms, which may challenge real-time implementation. High upfront costs for renewable energy systems and storage also limit widespread adoption, particularly in low-income settings. Additionally, the variability of RESs introduces challenges in maintaining consistent energy supply and grid stability.
Future research could focus on lightweight optimization algorithms, machine learning-based forecasting to improve energy prediction, and cost-effective energy storage solutions. Addressing these challenges will enhance the scalability, reliability, and affordability of the HEMS framework for broader implementation.
Footnotes
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The authors received no financial support for the research, authorship, and/or publication of this article.
