1 Introduction

The demand for electrical energy has risen significantly in recent years due to global population growth and economic progress. To tackle this issue, utility regulators are exploring different approaches to reduce end-user consumption, such as implementing demand response (DR) techniques and high tariff rates, including time of use (TOU) tariffs, due to power delivery constraints. In addition, energy authorities are taking steps to reduce reliance on fossil fuels due to depletion, price fluctuations, and environmental concerns regarding CO2 emissions (Gul and Patidar 2015).

To decrease energy usage, users must adopt energy-efficient products and appliances and adjust their energy consumption habits. Governments worldwide are promoting electricity conservation by raising awareness, incentivizing users who conserve energy, and advocating the use of renewable energy alternatives (Suryadevara et al. 2012).

An advanced framework called a home energy management system (HEMS) controls and monitors indoor device operations, allowing for peak shaving and load transformation to meet specific requirements (Aktas et al. 2017). Additionally, reducing energy consumption and enhancing energy efficiency are top priorities for HEMS customers. The smart grid (SG) refers to the electricity grid combined with a modern infrastructure that enables efficient, comfortable, stable, and reliable electricity use and is a highly positive concept for building an intelligent society (Bocklisch 2016). A smart grid (SG) consists of controls, automation, computers, new technologies, and equipment working together (Liu et al. 2016).

The smart grid boasts several features, including:

  • Transmission of electricity with high efficiency.

  • Quick restoration of electricity following a power outage.

  • Lowered management costs that reduce energy costs for users.

  • Decreased demand during peak hours, which also decreases electricity consumption costs for the consumer.

  • Integration of renewable energy systems with traditional sources of generation.

  • Improved security and protection of the electrical network.

Demand side management (DSM) refers to a variety of techniques and methods that enable end-users to control and manage their energy usage. It involves adopting measures to decrease overall energy demand during peak periods of consumption through diverse approaches such as energy efficiency, load shifting, and demand response (Broehl et al. 1984). Energy efficiency measures seek to improve the performance of energy-consuming devices and systems, such as HVAC, lighting, and appliances, to reduce energy consumption. Demand response entails modifying energy usage patterns in response to changes in energy supply or demand, often through incentives or time-of-use pricing. Load shifting aims to shift energy usage to low-demand periods, typically through the use of energy storage systems (Gellings 1985). DSM can enhance the efficiency and dependability of the power grid, minimize energy costs, and reduce the need for additional infrastructure and generation capacity (Davito et al. 2010). Figure 1 illustrates the DSM strategies.

Fig. 1
figure 1

DSM types

Peak clipping is a demand side management approach that aims to decrease peak electricity demand during high consumption periods. It involves implementing measures that reduce energy consumption during peak periods, such as turning off or decreasing the output of energy-consuming devices and systems. On the other hand, valley filling is a strategy that aims to increase electricity consumption during off-peak periods when demand is low. Load shifting is another demand side management strategy that involves shifting the timing of electricity consumption from peak periods to off-peak periods. This can help to reduce electricity demand during peak periods, which can delay or avoid the need for additional generation capacity. Lastly, energy efficiency is a strategy that aims to reduce energy consumption while maintaining or enhancing the level of service or output. This can be achieved through various methods, such as upgrading to more efficient lighting and appliances, improving building insulation, optimizing industrial processes, and implementing efficient transportation systems.

With the continuous rise in electricity costs and the emergence of smart grids, home energy management systems (HEMSs) have become a feasible solution to address demand response. The primary goal of these systems is to monitor, control, and optimize energy usage and flow. HEMS aims to shift demand and minimize it to enhance the energy consumption and production profile for consumers. Demand-side management (DSM) controls a multitude of loads that can be managed across different sectors, including industrial, commercial, government agencies, agricultural, and residential, among others. Figure 2 illustrates the electricity consumption in Egypt (2019–2020) across various sectors.

Fig. 2
figure 2

An illustration of the distribution of electricity consumption

2 Literature review

2.1 Smart home energy management

The concept of home energy management system (HEMS) was initially introduced in 1979 by Moen (1979). Since the introduction of personal computers in 1980 (Capehart et al. 1982), HEMS has undergone significant advancements. In 1982, the optimization algorithm was developed for power management, aimed at reducing electricity costs by minimizing demand and usage time (Rahman and Bhatnagar 1986). A HEMS was later developed for home-based applications that incorporated various technologies, such as video, radio frequency, and ultrasonic sensors to track customers and locate missing objects (Kidd et al. 1999). An innovative tactic involved developing a home automation communication system to manage and control electronic devices (Wacks 1991).

In Japan, a power-controlled system was implemented in 2003 to manage the energy consumption of 20 individuals. The system utilized gateways from each residence, which functioned as automation data loggers for power consumption and information controls. The power line communication network architecture was subsequently upgraded as an energy management controller to serve the same function. The controller was integrated with PCs to allow for the monitoring and control of electrical devices (Inoue et al. 2003).

Further HEMS strategies were created that utilized smart algorithms to track the activities of individual occupants and determine their status in similar environmental conditions. These techniques were discovered to reduce energy consumption, improve occupant comfort, and enhance performance levels (Das et al. 2006). Whirlpool Corporation abandoned a patent in 2006 for a HEM controller that could manage the energy consumption of home-based appliances (Ghent 2006).

In 2012, advanced HEMS technology was introduced with demand response (DR) capabilities aimed at reducing power consumption and costs for home appliances, including electric vehicles and air conditioning systems (Han et al. 2011). This marked a trend toward using sophisticated technology in HEMSs. Smart HEM systems were also developed around the same time to provide optimal electric energy in residential areas, using a controller based on event-driven binary linear optimization (Giorgio and Pimpinella 2012).

The HEMS was further improved with the integration of advanced optimization algorithms that factored in big storage systems, renewable resources, and variable electricity costs to minimize energy consumption and keep a home functional. Additional advancements included the use of artificial bee colony as an optimization strategy and the application of intelligent lookup tables using associative neural networks to determine optimal energy efficiency (Squartini et al. 2013).

While HEMSs improved over time, early versions relied on infrared remote controls to manage lighting and electrical outlets, which could not cover the full distance between the central controller and outlets (Shahgoshtasbi and Jamshidi 2014; Missaoui et al. 2014).

Studies have investigated real-time energy control to facilitate the implementation of smart HEMS (Dittawit and Aagesen 2013). Additionally, a fuzzy controller has been proposed to optimize energy scheduling and regulate battery power consumption using rolling optimization techniques (Zhou et al. 2014). Various innovative algorithms have been developed to promote smarter electricity management and reduce electricity consumption through different energy management models.

Some studies have focused on incorporating renewable energy resources in HEMS Boynuegri et al. (2013), while others have developed adaptive smart HEMS that consider dynamic variables like weather patterns and electricity prices when scheduling power usage. Several companies have taken steps toward developing intelligent HEMS for energy management, including Honda in the US, which has deployed a hardware system for monitoring, controlling, and optimizing electricity generation and appliance usage at home (Honda 2018). General Electric Co. has also designed home appliances that can be managed using smartphones (Ge 2018; Hong et al. 2015). These home automation systems include energy storage batteries that can be used during peak hours of the day and solar PV.

Numerous algorithms have been utilized for home energy management system (HEMS). Due to the high energy consumption in residential buildings, many energy researchers have focused on developing HEMS for these types of buildings. In one study (Wang et al. 2021), a novel approach was proposed for HEMS optimization that is grounded on the Internet of Things (IoT). This method employs a multi-objective optimization strategy that considers both consumer comfort and energy consumption cost as primary objectives, and it is designed to operate in a smart grid environment. Another study (Shivam et al. 2021) presents a multi-objective predictive energy management approach that uses machine learning techniques for grid-connected hybrid energy systems in residential areas. The hybrid system consists of a photovoltaic array, a battery bank as the energy storage system, and a residential building serving as the electric load. In Tostado-Véliz et al. (2022), a stochastic many-objective solution framework is created using a mixed integer linear programming formulation. The proposed method relies on lexicographic optimization and scalarizing functions. Another study (Etedadi et al. 2023) aims to develop a distributed coordination technique that effectively coordinates transactive HEMS with electric baseboard heater thermostats enabled for demand response. The proposed technique focuses on achieving consensus in order to satisfy both individual and collective objectives. In Correa-Florez et al. (2018), a stochastic approach is applied to optimal Day-Ahead operation, taking into account solar photovoltaic resources, electric water heaters, and batteries. In Nan et al. (2018), the authors divide smart housing loads into various sectors to incorporate various demand response capabilities. Waseem et al. (2021) applied game theory to schedule home appliances for multi-objective optimization using an enhanced normalized normal constraint (ENNC) method. The authors used fuzzy compromising methods to improve gaseous emissions and overall energy cost. Alfageme et al. (2021) presented a comparison of the performance of two metaheuristic optimization algorithms, the Estimation of Distribution Algorithm (EDA) and Tabu Search, for scheduling home loads. Sadat et al. (2021) presented a machine learning method for anticipating consumer priorities in optimal scheduling of smart devices. In Liu et al. (2016), a survey was conducted to examine the latest trends and advancements in smart home energy management system (SHEMS), including the various components involved in SHEMS, energy management innovations, and the latest technologies employed in this field. Another study (Tsui and Chan 2012) proposed an agent-based scheme for managing home devices in an active distribution network, considering thermal constraints and network voltage. This scheme was implemented in a typical Dutch low voltage (LV) residential feeder. Additionally, a comprehensive study on non-invasive pregnancy monitoring (NILM) was conducted in Tsui and Chan (2012), which has implications for demand management in smart homes. Through the optimization of consumption and production schedules, HEMS can achieve various objectives, such as load profiling, cost reduction, convenience for consumers, and environmental sustainability.

In Aliero et al. (2021), the emphasis is on investigating smart home energy management systems and addressing unnecessary energy consumption. The study presents the top 10 SHEMs available in the market today, but reveals a deficiency in quality attributes such as security and privacy. Killian et al. (2018) presents a comprehensive approach using a mixed-integer quadratic programming model predictive control scheme based on the building energy management system and the thermal building model. Rahim et al. (2016) introduce an efficient demand-side management model for residential areas that aims to optimize user comfort while minimizing electricity costs, execution time, and PAR. The authors employ three optimization techniques, namely ant colony optimization (ACO), binary particle swarm optimization (BPSO), and genetic algorithm, and utilize inclined block rate (IBR) and time of use (TOU) pricing systems to calculate electricity costs. The study proposes an EMC for residential energy management (HEM), which performs better with GA than ACO and BPSO in terms of PAR and cost reduction. GA is also the fastest optimization method in terms of execution time. This study classifies appliances and users into three groups based on their energy usage patterns.

Jovanovic et al. (2016) have proposed a novel model for scheduling household loads for a group of households, where households are grouped based on socioeconomic parameters such as the number of occupants, employment status, and household dissolution. In another study, Gao et al. (2014) utilized plug-in electric vehicles (PEVs) and game theory for an autonomous energy management system that aimed to minimize energy costs, but did not consider consumer convenience. Mesarić et al. (2015) used electric vehicles and renewable energy sources to optimize house demand and reduce grid dependence, ultimately stabilizing microgrid. Vardakas et al. (2016) studied four different scenarios for scheduling power demand to reduce peak demand, accounting for both power compression and request postponement, with each scenario resulting in different social welfare and average electricity cost. In Shakeri et al. (2017), a new HEMS was proposed that allows residents to independently implement demand response programs, utilizing a photovoltaic system and battery to avoid peak hours throughout the day. Finally, in Pratt et al. (2016), interactive home energy management systems and their impact on the electrical network were investigated.

The issue of peak-to-average ratio (PAR) and its impact on utility and generation units, as well as seasonal price signals or future pricing, was not taken into account by the authors in Jovanovic et al. (2016); Vardakas et al. 2016; Elkazaz et al. 2016). This oversight has created problems in managing energy consumption during peak and non-peak hours. Additionally, the authors in Gao et al. (2014); Vardakas et al. 2016; Bradac et al. 2015; Adika and Wang 2014; Chavali et al. 2014) did not prioritize consumer convenience in their studies. In Zhou et al. (2016), the authors analyze and review house devices and HEMS infrastructure in smart homes, as well as the use of various renewable energy sources such as solar, geothermal, biomass, and wind. Additionally, they discuss different scheduling strategies for household devices aimed at optimizing power generation efficiency and reducing residential electricity bills. Bradac et al. (2015) used mixed-integer linear programming (MILP) to schedule home devices with the goal of minimizing power peaks, reducing electricity bills, and ensuring consumer convenience. Their model takes into account the scheduling of both electrical and thermal devices simultaneously, with the aim of significantly reducing the total energy cost while ensuring user convenience. In Hafeez et al. (2018), binary particle swarm optimization (BPSO), wind-driven optimization (WDO), and genetic algorithm (GA) are used to schedule home loads under integrated bilateral contracts (IBR) and real-time pricing (RTP) combined schemes. The system aims to lower the PAR and reduce electricity costs while taking into account user convenience. Adnan Ahmad et al. (2017) have presented optimization methods and models for HEMS, using various back problems and optimization algorithms such as GA, BPSO, WDO, hybrid GA-PSO (HGPO), and bacterial search optimization (BFO) to schedule home loads. Nan et al. (2018) presented optimization models and methods for residential communities to decrease the peak-valley difference of residential load profiles and the maximum load without affecting user convenience. They used meta-heuristics and other optimization algorithms to achieve this goal.

Various algorithms have distinct pros and cons, such as susceptibility to getting trapped in local minima or having inadequate memory. Therefore, while they can provide optimal solutions for straightforward mathematical problems, obtaining satisfactory yet not ideal outcomes often necessitates numerous iterations, complex parameter adjustments, and tuning endeavors. Given the shortcomings of current methods, continual endeavors are necessary to enhance or introduce novel algorithms. Hence, this study aims to introduce a fresh approach to attain optimal home energy management systems. The contributions of this research are as follows:

Improved energy efficiency: HEMS can substantially reduce energy consumption and utility expenses by providing real-time feedback and control over energy usage.

Enhanced comfort and convenience: HEMS can better regulate home automation and energy usage, resulting in increased convenience and comfort for homeowners.

Development of a home energy management system using the improved bald eagle search optimization (IBES) algorithm.

Coordination among home appliances to minimize electricity bills, PAR, and maximize user comfort.

The computational tools developed can be utilized in smart grid and industrial applications.

The rest of this paper is organized as follows: First, we will define and provide a characterization of HEMSs. Next, we will present information and a mathematical formulation regarding the proposed IBES algorithm. We will then introduce the problem and the implementation of scheduling household appliances. Finally, we will discuss the results and draw our conclusions.

3 Problem statement

The problem statement of optimal home energy management systems is to balance the conflicting objectives of minimizing energy consumption and cost, while at the same time ensuring the comfort and reliability of homeowners. This problem is compounded by the increasing complexity of home energy systems, which involve a multitude of appliances, energy sources, and storage devices. Therefore, there is a need for an intelligent and effective approach to manage the energy consumption in homes, which can optimize energy usage, reduce energy costs, and maintain user comfort and convenience.

4 Proposed system model

The increasing demand for energy, particularly in the residential and commercial sectors, has resulted in a growing interest among energy researchers in optimizing HEMS for maximum energy utilization. HEMS comprises three units, namely management, control, and monitoring. The management unit schedules household appliances while the control unit regulates their working hours. The monitoring unit oversees and tracks various parameters, such as user power demand. To achieve the system’s goals, the HEMS must operate in coordination with the consumer, thus necessitating a scheduling system under the supervision of the management unit. The management unit schedules electrical appliances by considering the user’s operating time, price signals, current electricity generation, and other relevant factors.

Figure 3 illustrates how information is exchanged among the components of the system, including energy and data flow between the smart home and the service provider. To ensure energy reliability, power is transferred from generating stations to transmission lines for the service provider. Each smart home is equipped with a HEMS and a smart meter that receives information from the utility network, including the price of the generated energy. Data transmission between the utility and consumer is facilitated by the smart meter, which is scheduled by an embedded computing platform. The smart meter comprises several components, such as the embedded computing platform. The proposed optimization technique schedules the user’s load demand in real-time and day-ahead basis using dynamic programming and meta-heuristic. In case of a consumer-generated interrupt, dynamic programming is utilized to facilitate real-time scheduling and coordination between the scheduler and the consumer.

Fig. 3
figure 3

The system presented and the method of transmitting data between the consumer and the service provider

The proposed study aims to achieve two main objectives, which are to reduce PAR and electricity costs by utilizing load shifting. Load shifting aims to adjust the load curve to match the objective load curve, which should be inversely proportional to electricity cost. To ensure flexibility and responsiveness to real-time changes, the system should be able to adapt quickly. Additionally, real-time scheduling is another key objective, which considers consumer convenience to ensure the flexibility of the system. To achieve these goals, Logenthiran et al. (2012) have conducted demand-side management to reduce PAR and modify the load profile.

5 Problem formulation

The scheduling of HEMS load is addressed in this paper for both day-ahead and real-time basis. However, optimizing smart grid components using DSM and DR can be challenging. To tackle this challenge, various strategies have been developed for achieving single or multi-objective optimization. Some studies, like (Nan et al. 2018; Waseem et al. 2021), formulate it as a multi-objective optimization, while others, like (Liu et al. 2016; Alfageme 2021; Sadat-Mohammadi et al. 2021), consider it as a single-objective optimization. In our proposed system, we aim to achieve multi-objective optimization Ç.

The goal of this study is to accomplish several objectives, including decreasing PAR, reducing the electricity bill, and minimizing the difference between the actual load curve pattern and the objective load curve.

5.1 Load shifting

One of the primary goals is to align the load curve with the objective load curve from instrumentation tables, which can be mathematically determined as outlined in Logenthiran et al. (2012).

$$ O_{1} = \min (E_{{{\text{load}}}}^{{{\text{sch}}^{{{\text{hour}}}} }} - {\text{obj}}_{{l_{{{\text{curve}}}} }}^{{{\text{hour}}}} ) $$
(1)

The objective load curve \({\text{ob j}}_{{l_{{{\text{curve}}}} }}^{{{\text{hour}}}}\) and the price of electricity market \(E_{{{\text{price}}}}^{{{\text{hour}}}}\) have an inverse relationship between them, as shown below:

$$ {\text{obj}}_{{l_{{{\text{curve}}}} }}^{{{\text{hour}}}} \propto \frac{1}{{E_{{{\text{price}}}}^{{{\text{sch}}^{{{\text{hour}}}} }} }} $$
(2)
$$ E_{{{\text{load}}}} = \mathop \sum \limits_{d = 1}^{M} {\text{App}}_{{p _{{{\text{rate}}}} }}^{d} \times {\upphi } $$
(3)

where \(E_{{{\text{load}}}}^{{{\text{sch}}^{{{\text{hour}}}} }}\) is for every hour the electrical energy load. It is calculated by Eq. 3, \(E_{{{\text{load}}}}\) is the total load of operating appliances during a specific hour and \(\varphi\) is 0 (OFF) or 1(ON) device status within a specific hour.

The fitness function (\(F_{f}\)) is calculated by using Eq. 4, fitness function enables to obtain the optimal solution, fitness function chooses from the given population PoP the fittest individual, to get away the peak through the off-peak hours

$$ F_{f} = \min \left( {F_{{\text{POP }}} } \right) $$
(4)
$$ F_{{\text{POP }}} = \left\{ {\begin{array}{*{20}l} {E_{{{\text{load}}}}^{{i \in {\text{POP}}}} \ge P_{l1} } \hfill & {{\text{if}}} \hfill & {H_{p}^{{{\text{off}}}} } \hfill \\ {E_{{{\text{load}}}}^{{i \in {\text{POP}}}} > P_{l2} \wedge E_{{{\text{load}}}}^{{i \in {\text{POP}}}} < P_{l3} ,} \hfill & {{\text{if}}} \hfill & {H_{p}^{{{\text{on}}}} } \hfill \\ \end{array} } \right. $$
(5)
$$ P_{l1} = {\text{sum}} \left( {{\text{load}}_{N}^{h} } \right) - {\text{std}}\left( {E_{{{\text{load}}}}^{{{\text{unsch}}}} } \right) $$
(6)
$$ P_{l2} = {\text{std}}\,\left( {E_{{{\text{load}}}}^{{{\text{unsch}}}} } \right) + \eta \times \min \left( {E_{{{\text{load}}}}^{{{\text{unsch}}}} } \right) $$
(7)
$$ P_{l3} = {\text{mean}}\left( {E_{{{\text{load}}}}^{{{\text{unsch}}}} } \right) $$
(8)
$$ {\text{load}}_{N}^{h} = \frac{{E_{{{\text{load}}}}^{{{\text{unsch}}}} \left( h \right) - \min \left( {E_{{{\text{load}}}}^{{{\text{unsch}}}} } \right)}}{{\max \left( {E_{{{\text{load}}}}^{{{\text{unsch}}}} } \right) - \min \left( {E_{{{\text{load}}}}^{{{\text{unsch}}}} } \right)}} $$
(9)

where \(\eta\) is determined so that the minimum load limit of on-peak hours must be less than the minimum load limit for off-peak hours, where \(P_{l1}\) is determined by Eq. 6 and power limit in off-peak and \(P_{l2}\) is determined by Eq. 7 and power limit in on-peak. Home pregnancy management scheduling achieves at the end of the user an equitable distribution of the load.\( E_{{{\text{load}}}}^{{i \in {\text{POP}}}}\) is calculated by using Eq. 3. It is determined load for one house or one bacteria i from the created solution area. \( H_{p}^{{{\text{on}}}}\) is on-peak hour and \(H_{p}^{{{\text{off}}}}\) is off-peak hour. \(H_{p}^{{{\text{on}}}}\) is more than the electric price list \(E_{{{\text{price}}}}\) and \(H_{p}^{{{\text{off}}}}\) is less than or equal \(E_{{{\text{price}}}}\).

5.2 Par reduction

The second objective, which is crucial for ensuring network stability, is to reduce PAR. This objective is mathematically calculated as described in Khalid et al. (2018):

$$ O_{2} = \min \left( {{\text{PAR}}} \right) $$
(10)
$$ {\text{PAR}} = \frac{{\max \left( {\left( {E_{{{\text{load}}}}^{{{\text{sch}}^{N} }} } \right)} \right)^{2} }}{{\left( {{\text{avg}}\left( {E_{{{\text{load}}}}^{{{\text{sch}}^{N} }} } \right)} \right)^{2} }} $$
(11)
$$ E_{{{\text{load}}}}^{{{\text{sch}}^{N} }} = \left\{ {E_{{{\text{load}}}}^{{{\text{sch}}^{1} }} ,E_{{{\text{load}}}}^{{{\text{sch}}^{2} }} ,E_{{{\text{load}}}}^{{{\text{sch}}^{3} }} , \ldots E_{{{\text{load}}}}^{{{\text{sch}}^{24} }} } \right\} $$
(12)

where \(E_{{{\text{load}}}}^{{{\text{sch}}^{N} }}\) is scheduled electricity load in per hour.

5.3 User comfort maximization

The third objective aims to provide flexibility in scheduling home appliances to reduce the waiting time for users to operate the required device. It involves empowering users to set up schedules for turning on or off devices based on their needs, allowing for rescheduling on demand. With this approach, waiting time can be reduced to zero, regardless of when the user made the previous request. The goal is to minimize any discomfort experienced by the consumer, and it is calculated mathematically, as detailed in Khalid et al. (2018).

$$ O_{3} = \max\, \left( {{\text{comfort}} } \right) $$
(13)

When the user sends a message to a scheduler to turn off a specific appliance and request rescheduling in real time from \({\text{App}}^{\alpha }\), it must be in the integration of coordination among consumer and the scheduler so that the convenience of the user is achieved. It is expressed mathematically as:

$$ {\text{App}}^{\alpha } = \left\{ {\begin{array}{*{20}l} {\begin{array}{*{20}l} {\begin{array}{*{20}l} {1;\quad {\text{if}}\quad \hat{1}} \hfill \\ {0;\quad {\text{otherwise}}} \hfill \\ \end{array} } \hfill \\ \end{array} } \hfill \\ \end{array} } \right. $$
(14)

The inverse relationship between waiting time and user comfort can be expressed as:

$$ {\text{comfort}} \propto \frac{1}{{{\text{App}}_{{w_{t} }}^{d} }} $$
(15)

The waiting time of a specific device is \({\text{App}}_{{{\text{w}}_{{\text{t}}} }}^{{\text{d}}}\), which can be written as follows:

$$ {\text{App}}_{{w_{t} }}^{d} = \min \left| {{\text{App}}_{{D_{h} }}^{d} - {\text{App}}_{{S_{h} }}^{d} } \right| $$
(16)

5.4 Electricity cost minimization

The cost minimization is final objective where \(E_{cost}^{total}\) is calculated using Eq. (18), and it is considered a primary objective in the proposed system. This objective is calculated mathematically as mentioned in Khalid et al. (2018):

$$ O_{4} = \min \left( {E_{{{\text{cost}}}}^{{{\text{total}}}} } \right) $$
(17)
$$ E_{{{\text{cost}}}}^{{{\text{total}}}} = \mathop \sum \limits_{{{\text{hour}} = 1}}^{24} E_{{{\text{cost}}}}^{{{\text{hour}}}} $$
(18)
$$ E_{{{\text{cost}}}}^{{{\text{hour}}}} = \mathop \sum \limits_{d = 1}^{M} E_{{{\text{price}}}}^{{{\text{hour}}}} \times {\text{App}}_{{p _{{{\text{rate}}}} }}^{d} \times \varphi $$
(19)

6 Proposed algorithm

The proposed HEMS employs two types of scheduling, namely next-day and real-time scheduling, which yield different outcomes. Next-day scheduling aims to achieve various goals such as reducing PAR, minimizing electricity costs, and minimizing the deviation between actual energy consumption and the objective load curve. Single-objective optimization (SOO) mainly focuses on minimizing PAR, electricity cost, and user discomfort, which are interdependent and create a trade-off among them. To mitigate this trade-off, a constraint-dependent multi-objective optimization (MOO) method is proposed, where the main objectives are expressed through linear Eqs. 5 and 16, while their constraints are represented by other equations. As shown in Fig. 4, linear Eq. 5 depicts the proposed solution for both off-peak and on-peak hours, which maintains the load curve, prevents peak formation, and reduces costs. Real-time rescheduling is employed to achieve the third objective of maximizing user convenience. The MOO weighted addition method mentioned in Aliero et al. (2021) is utilized to reduce the trade-off among the objectives, expressed mathematically as follows:

$$ \lambda *\left( {O_{1} } \right) + \left( {1 - \lambda } \right)O_{3} $$
(20)

where λ = 1, the user comfort is ignored at day-ahead scheduling, \(O_{1}\) is the objective load curve and \(O_{3}\) is user comfort.

Fig. 4
figure 4

A graphical representation of the available search space

6.1 Improved bald eagle search optimization algorithm

The Improved bald eagle search algorithm is an enhanced version of the original bald eagle search (BES) algorithm, which was initially proposed by Alsattar in 2020 (Alsattar et al. 2020). The original BES algorithm is a novel nature-inspired optimization algorithm that emulates the intelligent hunting behavior of bald eagles. BES performs its hunting process in three main steps: (1) selecting the search area, where the eagle determines the area with the highest density of prey; (2) searching for prey within the selected area; and (3) attacking the prey by determining the optimal attack point based on the search results. Once the best point of attack is identified, all other moves are directed toward that point. Figure 5 illustrates the different phases of the hunting process.

  1. (1)

    Select step

Fig. 5
figure 5

Bald eagle behavior while hunting

The identification stage of bald eagles involves selecting the optimal hunting area that contains a large number of prey, which can be expressed mathematically as follows:

$$ P_{{{\text{new}},i}} = P_{{{\text{best}}}} + r*\alpha \left( {P_{{{\text{mean}}}} - P_{i} } \right) $$
(21)

The parameter “r” denotes a random number with a value ranging from 0 to 1, while “α’ regulates the changes in position. The area chosen for the search by the bald eagles is denoted by “A,” and it is based on the best position they have found during their previous search. To explore the surrounding area, these eagles randomly search all nearby points that surround the previously chosen search space. Additionally, “IBES” refers to a technique where eagles have already gathered all the information from the points, and “α” is the controlling parameter for changes that has a constant value in BES. However, in IBES, this parameter can be expressed mathematically as follows:

$$ \alpha = \frac{{1.5*\left( {{\text{Max}}_{{{\text{iter}}}} - t + 1} \right)}}{{{\text{Max}}_{{{\text{iter}}}} }} $$
(22)

where \(t\) has a value from 1.5 to 2 and \({\text{Max}}_{{{\text{iter}}}}\) is the maximum number of iteration.

During the selection stage, the bald eagles use information from the previous step to determine a new search area. This new area is randomly selected and must be different from the previous area, while still being in close proximity. The best search area from the previous step \(P_{{{\text{best}}}}\) is represented by the position that yielded the best result. The flowchart of the improved bald eagle search (IBES) is presented in Fig. 6.

  1. (2)

    Search step

Fig. 6
figure 6

Searching for prey in the spiral space

Mathematically, in the search step, bald eagles move in a spiral pattern to search for prey within the selected search space. The movement of the eagles is random and is guided by the following formula:

$$ P_{{i,{\text{new}},}} = P_{i} + y\left( i \right)*\left( {P_{i} - P_{i + 1} } \right) + x\left( i \right)*\left( {P_{i} - P_{{{\text{mean}}}} } \right) $$
(23)
$$ x\left( i \right) = \frac{{{\text{xr}}\left( i \right)}}{{\max \left( {\left| {{\text{xr}}} \right|} \right)}},\;y\left( i \right) = \frac{{{\text{yr}}\left( i \right)}}{{\max \left( {\left| {{\text{yr}}} \right|} \right)}} $$
(24)
$$ {\text{xr}}\left( i \right) = r\left( i \right)*\sin \left( {\theta \left( i \right)} \right), {\text{yr}}\left( i \right) = r\left( i \right)*\cos \left( {\theta \left( i \right)} \right) $$
(25)
$$ \theta \left( i \right) = a*\pi *{\text{rand}}\; r\left( i \right) = \theta \left( i \right) + R*{\text{rand}} $$
(26)

The variables R and theta are used to determine the number of search cycles and the angle between the search points in the central point, respectively. R ranges from 0.5 to 2, while theta ranges from 5 to 10. During this step, bald eagles spiral around the search space, moving in various directions to increase their chances of finding the optimal point for attack. Figure 7 illustrates the spiral movement of bald eagles in the search space, and how they select the best point to attack the prey.

  1. (3)

    Swooping step

Fig. 7
figure 7

Flowchart of IBES

During the attack phase, the bald eagles focus on attacking the prey from the optimal point in the search area, while the other points also move toward the optimal point. This process can be expressed mathematically as follows:

$$ P_{{i,{\text{new}},}} = {\text{rand}}*P_{{{\text{best}}}} + x1\left( i \right)*\left( {P_{i} - c1*P_{{{\text{mean}}}} } \right) + y1\left( i \right)*\left( {P_{i} - c2*P_{{{\text{best}}}} } \right) $$
(27)
$$ x1\left( i \right) = \frac{xr\left( i \right)}{{\max \left( {\left| {xr} \right|} \right)}}, y1\left( i \right) = \frac{yr\left( i \right)}{{\max \left( {\left| {yr} \right|} \right)}} $$
(28)
$$ {\text{x}}r\left( {\text{i}} \right) = r\left( {\text{i}} \right)*\sinh \left( {\theta \left( i \right)} \right),yr\left( {\text{i}} \right) = r\left( {\text{i}} \right)*\cosh \left( {\theta \left( i \right)} \right) $$
(29)
$$ \theta \left( i \right) = a*\pi *{\text{rand}}\;{\text{and}}\;r\left( {\text{i}} \right) = \theta \left( i \right) $$
(30)

where \( P_{best}\) represents the best search area that was chosen by bald eagles based on the best position that was identified during the previous search, c2, c1 \( \epsilon \left[ {1,2} \right]\), \( P_{{{\text{mean}}}}\) shows that these eagles have consumed all of the knowledge from the earlier points,, r represents a random number, it has a value from 0 to 1 and \(a\) is to determine the angle between the search for the points in the central point and its value lies between 5 and 10.

7 Real-time scheduling

Scheduling devices for the current hour can be challenging as it requires balancing the user’s comfort while minimizing the impact on peak hours and electricity bills. To tackle this issue, the study proposes a coordination mechanism between the scheduler and the consumer to manage device activation or deactivation during the current hour. Figure 7 illustrates the process of turning on or off a device during a specific hour.

7.1 As a scenario

The consumer may request to reschedule certain devices and sends a list of those devices to the scheduler. The rescheduling problem can be formulated as a knapsack problem, where the bag capacity represents the available time period, the weight of each item represents the operating time for the appliance, and the value of each item represents the cost incurred during a specific hour based on the price signal and operating time. The objective is to find the optimal solution of selecting items that have maximum value with minimum weight, such that the total weight of selected items is equal or less than the capacity limit. Figure 8 illustrates the coordination between devices during rescheduling (Table 1).

Fig. 8
figure 8

Coordination between devices

Table 1 Performance analysis of IBES, BES and GA (Khalid et al. 2018)

Dynamic programming is a problem-solving technique that was originally developed by Bellman et al. (1957) to solve the backpack problem. The technique divides a difficult problem into overlapping sub-problems, which are then solved from the bottom up using the recursive method. Dynamic programming is an effective method for collecting results in real-time scenarios. The theory behind dynamic programming involves dividing a large, complex problem into several smaller problems, which are then solved and recorded in a table. The mathematical equations used in dynamic programming are formulated as follows:

$$ {\text{KS}}_{{{\text{D}}_{{\text{e}}} }}^{{1,2}} = \left[ {{\text{T~}}\left[ {i - 1,j} \right],{\text{~value~}}\left( {i - 1} \right) + {\text{~T~}}\left[ {i - 1,ij - {\text{list}}_{{{\text{time}}}} \left( {i - 1} \right)} \right]} \right]{\text{~}} $$
(31)
$$ {\text{T}}~\left[ {i,j} \right]~ = \left\{ {\begin{array}{*{20}l} {{\text{max}}~\left( {{\text{KS}}_{{{\text{D}}_{{\text{e}}} }} } \right),} \hfill & {{\text{if}}} \hfill & {{\text{H}}_{{\text{p}}}^{{{\text{off}}}} } \hfill \\ {\min \left( {{\text{KS}}_{{{\text{D}}_{{\text{e}}} }} } \right),} \hfill & {{\text{if}}} \hfill & {{\text{H}}_{{\text{p}}}^{{{\text{on}}}} } \hfill \\ \end{array} } \right. $$
(32)
$$ S~\left[ {i,j} \right]~ = \left\{ {\begin{array}{*{20}c} {1,\quad {\text{if}}\;T~\left[ {i,j} \right] = {\text{KS}}^{2} _{{D_{e} }} ~} \\ {0,\quad {\text{otherwise}}} \\ \end{array} } \right. $$
(33)

8 Simulation results and discussion

In this section, a comparison between the IBES approach and BES algorithms is presented. The experiments were conducted on a MATLAB (R2016a) running PC with an Intel(R) Core i5-4210U Processor clocked at 2.40 GHz and 8 GB of RAM. A total of 200 iterations were performed for all approaches, with a maximum of 50 populations. MATLAB software was used to verify the robustness and performance of the proposed system, and the results are discussed in the following section. The IBES approach was applied before and after coordination, as well as with three different pricing scenarios, namely terms of use (TUO), critical peak pricing (CPP), and RTP. The results of the original technique (BES) were also compared with the new and improved IBES approach. Additionally, the results of the genetic algorithm (GA) in Khalid et al. (2018) were compared with the proposed system.

In this study, the scheduling of nine appliances (M = 9) in a single household was considered. The appliances were categorized into three groups based on their usage throughout the year. The intermittent load appliances, such as water pump, vacuum cleaner, dishwasher, and water heater, which can be operated at any time during the day, were classified under Group A. The uninterruptible appliances, namely the dryer and washer, which cannot be separated during the operating cycle, were classified under Group B. Group C consisted of the basic and interchangeable devices such as air conditioner, refrigerator, and oven. It was assumed that the clothes dryer would always run after the washing machine, and the user had the flexibility to switch on or off any device at any time.

To enable coordination, the study considered electrical devices with an operating time equal to or less than an hour, such as the vacuum cleaner and dishwasher. These devices could be operated up to 6 to 8 times a day. Before scheduling, the consumer would set the working time for each device, and for simulation purposes, the working time was randomly selected. The time taken to boot up one device and reschedule another device was denoted by. The weight of the backpack was formulated as: = 60-. In this case, the weight of the backpack for any item represented the ready working period of the device in the α list. The value of the item was calculated using Eq. 7 during a specific interrupted hour. Table 2 in Khalid et al. (2018) provides information on the daily use and energy rating of the devices.

Table 2 Different performance standard of IBES and their effects

The price signals RTP and TOU were categorized into different time periods: MID-peak hours from 7:00 am–10:00 am and 5:00 pm–6:00 pm, off-peak from 1:00 am–6:00 am and 7:00 pm–12:00 pm, and on-peak hours from 11:00 am–4:00 pm. The CPP pricing signal was divided into two periods: off-peak from 1:00 am–10:00 am and 5:00 pm–12:00 pm and on-peak hours from 11:00 am–4:00 pm.

8.1 Price tariff

The proposed work utilizes three distinct price signals, which are elaborated upon below:

  1. (1)

    RTP

The dynamic rate is a type of real-time pricing (RTP) that is calculated based on the electricity usage per hour. The RTP is divided into several components, and the total bill is the sum of these components. The following are the components of the RTP:

  • The consumer basic bill is based on the basis of the standard tariff specified for a specific user based on the user’s basic load (CBL).

  • As for the other bill, it is calculated based on the hourly consumption and this shows the difference between the user usage and the CBL bill. Each consumer is required to pay a flat fee per hour \(wQ_{*}\) regardless of the pricing scheme adopted.

RTP pricing system makes the customer save an amount (\(P_{{\text{h}}}\) − \(W_{s}\)) \(\Delta Q_{H}\), where \(Q_{H}\) is the electricity unit,\( P_{{\text{h}}}\) is the power rating required by the applicant, and \(W_{s}\) is the charges of standard energy tariff. The RTP rate can be expressed mathematically as follows:

$$ P_{{{\text{RTP}}}} = \left\{ {\begin{array}{*{20}c} {{\text{WQ}}_{* } , if\; E_{{{\text{load}}}} < Q_{*} } \\ {{\text{WQ}}_{*} + P_{L } ,\;{\text{otherwise}}} \\ \end{array} } \right. $$
(34)
  1. (2)

    CPP

During periods of high electricity demand or market price hikes, utilities apply CPP pricing to consumers. This pricing structure consists of two types of costs: the first is based on the predetermined time and duration of the peak rate, while the second is aimed at reducing the load when the increase in price is due to electricity demand. CPP is typically applied during hot summer days.

  1. (3)

    TOU

The TOU pricing system is determined by the time of day, where the prices differ based on peak hours. The day is divided into several categories, and each category has a set price. The pricing system can be expressed mathematically as:

$$ D_{{{\text{TOU}}}} = \zeta \left( {\sigma_{0} - \sigma_{1} } \right) \times Q_{{{\text{TOU}}}} $$
(35)

where \(D_{{{\text{TOU}}}}\) is the total amount of joint provision between user and Local Distribution Company (LDC). Cost minimization (\(\sigma_{0} - \sigma_{1}\)) is accomplished by converting the total amount of saving \(\zeta\) and a maximum load demand that the LDC goes through.

8.2 Results before coordination

To discuss the proposed solution method in detail, three different signal pricing rates are tested, namely RTP, CPP, and TOU. The cost of unscheduled loading is found to be high for all the different price tariffs, as illustrated in Figs. 9 and 10. Specifically, the total unscheduled electricity cost for a given critical day is 7102 cents for CPP, 1795 cents for TOU, and 1,878 cents for RTP. Simulation results before coordination are shown in Figs. 9, 11, 12, and 13. Figure 11 depicts the electrical load for 24 h before and after scheduling, which has an impact on the results in Figs. 9, 12, and 13. The load curve scheduled by IBES is similar to the objective load curve in different price strategies, and the cost paid is high compared to the scheduled load through on-peak hours, due to shifting the load to off-peak hours while avoiding creating a peak. Figure 14 shows a graph of the hourly cost of each algorithm. Additionally, Table 3 illustrates the trade-off between PAR and total cost.

Fig. 9
figure 9

For each hour a scheduled load with objective load line and the tariff rate before coordination. a RTP. b TOU. c CPP

Fig. 10
figure 10

Electric load profile and impact on coordination during scheduling. a RTP. b TOU. c CPP

Fig. 11
figure 11

Before coordination electricity cost with various price signals. a RTP. b TOU. c CPP

Fig. 12
figure 12

Electricity total cost after coordination of each hour during a day with price signals. a RTP. b TOU. c CPP

Fig. 13
figure 13

Waiting time of devices. a RTP. b TOU. c CPP

Fig. 14
figure 14

Waiting time of devices and Effect of real-time rescheduling. a RTP. b TOU. c CPP

Table 3 Impact of different performance parameters of IBES without coordination

Using IBES, the proposed solution method was tested with three different price signals: RTP, TOU, and CPP. The results showed that the PAR for RTP was 2.7, which was 46.64% lower compared to the unscheduled PAR using IBES. The PAR for TOU was 2.72 by IBES, which was 45.27% lower compared to BES. The PAR for CPP was 2.25 by IBES, which was 19.64% lower compared to BES and 54.08% lower compared to unscheduled PAR. In terms of cost, the RTP signal resulted in a cost of 1569 cents, which was a 16.45% decrease compared to an unscheduled value. The TOU signal resulted in a cost of 1481 cents, which was a 17.49% decrease compared to an unscheduled value. The CPP signal resulted in a cost of 3846 cents, which was a 45.84% decrease compared to an unscheduled value using IBES.

8.3 Results in coordination

After formatting, the rescheduling task is completed in just 0.0061 s, indicating that switching between appliances happens rapidly. To accommodate the random behavior of users, the suggested approach employs different formatting loads. Figures 12 and 14 demonstrate that formatting modifications did not affect the relationship between the scheduled load curve and the objective load curve. Figure 15 shows that electricity costs are highest during on-peak hours for all three pricing signals, with unscheduled costs also being high during these hours. Figure 12 depicts the load for a single household under three tariffs per day, with load shifting to off-peak hours and its impact on cost shown in Fig. 13 and on PAR shown in Fig. 9.

Fig. 15
figure 15

PAR for without coordination

The aggregate graphs illustrate the gap between before and after formatting in terms of lower total required load and higher peak load. With coordination, as the load decreases, the cost also decreases, but the PAR increases due to the trade-off between PAR and cost resulting from a large load. Figures 13 and 16 show the waiting time of appliances before and after coordination, with a higher waiting time before coordination for interruptible loads since the used devices belong to this category (Table 4).

Fig. 16
figure 16

PAR with coordination

Table 4 Scheduling algorithms and summary of results after coordination

Using RTP, the IBES algorithm resulted in a cost reduction of 7%, compared to 5% with BES and GA. Meanwhile, without scheduled coordination, using TOU, the cost decreased by 8% with IBES, compared to 3% and 4% with BES and GA, respectively. The IBES algorithm consistently outperformed BES and GA in terms of cost reduction for different tariff types, including RTP, TOU, and CPP. With CPP, IBES reduced waiting time by 22% compared to no scheduled coordination, while with RTP, the waiting time decreased by 14%, 15%, and 23% for GA, BES, and IBES, respectively. Additionally, IBES increased the PAR ratio by 15% for TOU. The results indicate that IBES has the highest condensed interval, with only a 17% difference between lower and upper cost and a 25% difference for PAR using RTP and CPP, compared to GA. Overall, the proposed algorithm outperforms existing techniques in terms of waiting time, PAR ratio, and electricity cost reduction (Figs. 17, 18).

Fig. 17
figure 17

For one day, the total electricity cost without coordination on

Fig. 18
figure 18

For one day, the effect of coordination on the total electricity cost

9 Conclusion

In this paper, a load shifting strategy for HEMS has been presented, aiming to achieve desired objectives. The study focuses on a single house with nine electrical appliances, and scheduling of each appliance is done using the improved bald eagle search (IBES) algorithm, which takes system constraints into account. Scheduling can be carried out either in real-time or for the next day. To handle interruptions and coordinate with other devices, dynamic scheduling is implemented using dynamic programming techniques. Multiple pricing charts are used to evaluate the HEMS performance, and simulation results indicate that real-time rescheduling and coordination have no significant impact on PAR and electricity bill. The IBES algorithm is compared with the original bald eagle search algorithm, and the results show that rescheduling has no significant effect on electricity cost and PAR. The proposed IBES technique efficiently schedules home devices across all pricing signal strategies, and time of use (TOU) is found to be the most economical pricing strategy compared to others. The results of the IBES algorithm demonstrate its potential to tackle complex optimization problems in power systems, including both single and multi-objective challenges such as energy management, smart grid systems integrating renewable energy sources, a large number of electric vehicles, and smart homes. In the future, this algorithm could be extended to include other scenarios, such as increasing the number or power capacity of household appliances and adjusting their time intervals. Additionally, the proposed algorithm has the potential to be implemented in the context of microgrids.