1 Introduction

Over the past few decades, electricity demand has increased at a drastic pace. The ever-growing population is proportional to the demand for electricity as the dependence on electricity has increased. The primary concern of this increasing population is to have electricity in their households. In recent years, there is a huge increase in the consumption of electricity thereby increasing the electricity demand. The traditional grids are unable to meet such huge demand. They are insufficient to mitigate the grid challenges i.e., security, scalability, and robustness [1]. The existing grids have a few shortcomings such as one-way flow of electricity, manual handling of sensors, manual meter reading, centralized power generation, etc. In addition to that, 65% of produced electricity is wasted in the generation, transmission, and distribution phases [2]. Hence, a smart and advanced intelligent infrastructure of the existing grid is required to handle the above challenges. For this purpose, the concept of a smart grid (SG) has evolved, which includes bi-directional flow of electricity, self-monitoring of electricity, smart meter usage, self-healing mechanism, compatibility with new technologies, etc. The smart grid adds information and communication technologies (ICT) to the traditional grid. With the emergence of the smart grid, the consumers of electricity have become prosumers meaning they can also sell back the surplus electricity to the main grid. Thus, consumers can control their electricity consumption through two-way communication between them and the utility using smart meter devices in advanced metering infrastructure (AMI). A smart grid can be articulated as the upgradation of the traditional grid into a quick responsive electricity network by incorporating ICT-based solutions. SG enables the integration of renewable energy sources (RESs) into the power grid. The electricity can be generated from various RESs in nature i.e., hydropower plants, wind stations, water turbines, etc. However, this generated electricity should be managed effectively by the residential consumers since the energy consumption in residential areas is rapidly increasing as an effect of the growing population. The electricity required by the residential sector is about 40% of the total energy usage around the globe [3]. The service providers or the utilities are facing various problems to manage this demand in residential buildings. Residential load management programs usually aim at the following design objectives; (i) reducing consumption and (ii) shifting consumption. The former can be achieved by encouraging the consumers to use energy-aware consumption patterns or by installing new generation units for producing additional energy. This objective is not feasible as it takes a huge number of resources and is expensive to set up new generation units. Thus, it has become a need of the hour to use our electricity appliances carefully and shift the electricity consumption from peak hours to off-peak hours to reduce the peak-to-average ratio in load demand. To address this issue, the utilities have proposed to their users to balance their demand and supply profiles. This balance between demand and generation of energy, called energy management, is a vital requirement for the stable operation of a household power system. The primary objective for residential consumers is to use the electricity during the day and avoid the usage of electricity during peak hours when the rate of electricity is high. This method of efficient usage of electricity is called demand-side management (DSM). The demand-side management has emerged as an alternative method for energy management to maintain balance while focusing on the consumer side. In DSM, the consumers minimize the electricity cost and peak to the average ratio by efficiently scheduling their home appliances. DSM functions in the households are implemented by a home energy management system (HEMS) through optimal usage of home devices. These devices include household appliances as well as local distributed energy resources (DERs). The sole aim of DSM is to improve the stability and reliability of the grid by maintaining the balance between demand and generation. The DSM strategies include peak-clipping, valley filling, load shifting, load reduction, load growth, and flexible load shape [4]. The load curves for DSM strategies are shown in Fig. 1. These strategies encourage the consumers to actively reduce the peak demand by shifting the load from on-peak hours to off-peak hours efficiently.

Fig. 1
figure 1

Demand side management strategies [5, 6]

DSM functions can be classified as follows; Load Management and Demand Response [7]. Load management deals with the management of load in such a manner that it distributes the demand evenly as well as satisfies the consumers’ demands [8]. Consumers can avail of benefits such as reduced electricity cost, reduced peak-to-average ratio, and improved user satisfaction through the load management technique. Demand response allows the consumers to respond to the energy demands by appropriate appliance scheduling based on dynamic pricing models and thereby reducing electricity costs [9]. DR provides the opportunities for consumers to play an important role in the operation of the smart grid by reducing the electricity consumption or shifting their electricity consumption patterns from peak to off-peak hours based on dynamic pricing schemes or deploying methods that provide financial incentives to the users [10]. There are two types of DR programs; (i) incentive-based demand response and (ii) price-based demand response. The first type includes direct load control, capacity ancillary services, demand buy-back, etc. In incentive-based demand response, the utility directly controls a load of consumers when required [11]. In price-based demand response, consumers are encouraged to manage their electricity consumption based on dynamic pricing schemes regulated by utilities [12]. There are different pricing schemes used by utilities which include real-time pricing (RTP), critical peak pricing (CPP), day-ahead pricing (DAP), time-of-use pricing (TOU) tariffs, and inclined block rate pricing (IBR), etc. In this paper, we have focused on price-based demand response programs with the smart meters installed at the residential smart homes which provide the pricing signals. The pricing signals are announced by the utility well in advance. Thus, DR helps in changing the consumption pattern of electricity in residential households with respect to varying electricity prices. DR strategies help in solving the high electricity demand problem and also enable the consumers to reduce their electricity bills and peak load. However, these schemes cannot solve the demand and supply problem without the involvement of the consumers. However, due to a lack of information about electricity tariffs, the household energy demand may increase. Thus, the need for a home energy management system to intelligently switch the home appliances ON or OFF with varying electricity demands in SG is inevitable.

Residential consumers have different habits of energy usage according to their lifestyles and want to keep their comfort in their life. The primary goal of all consumers is to reduce electricity costs. However, minimizing peak demand, peak to average ratio, and balancing the load profile of the home should also be considered in order to manage residential household energy demand. Also, smart home appliance consumption may exceed the power limit provided by the grid, thus the peak demand occurs at certain times of the day, i.e., in the evenings when all occupants are at home. The proposed residential appliance scheduling problem (RASP) addresses all the aforementioned issues and encourages users to manage their household consumption efficiently. In this paper, we have proposed two algorithms to solve the residential appliance scheduling problem which involves serial/uninterruptible and parallel/interruptible scheduling.

1.1 Contributions

  • In this work, we formulate the residential appliance scheduling problem using multiple knapsack problems. MKP helps in the effort of finding an optimal solution while employing dynamic programming and respecting the total capacity available at the particular time slot. We have mapped multiple knapsack problem to residential appliance scheduling.

  • We have proposed two MKP-based efficient appliance scheduling schemes namely MKSI and MKPI for serial and parallel scheduling respectively. The serial scheduling allows uninterruptible operation of appliances while parallel scheduling involves interruptible operation of appliances. The proposed algorithms are able to determine the final appliance schedule in a smart home.

  • We have compared both the proposed algorithms with the unscheduled scenario and the existing algorithm. The proposed algorithms MKSI and MKPI result in the reduction of electricity cost and PAR as compared to both unscheduled and existing algorithms. We have considered the reduction of electricity cost, peak to average ratio, and balancing load profile of the home as the primary objectives.

  • We have considered the time of use pricing and critical peak pricing which encourages users to shift their energy consumption from peak hours to off-peak hours.

The rest of the paper is organized as follows: Sect. 2 outlines related work. Section 3 formulates the residential appliance scheduling problem with the objectives and appliance classification. Two proposed algorithms MKSI and MKPI along with the illustration are discussed in Sect. 4. In Sect. 5, the performance of proposed algorithms concerning unscheduled scenarios and the existing algorithm is presented and discussed in detail. Finally, the conclusions and future work directions are given in Sect. 6.

2 Related Work

In the existing literature, a significant amount of work is done in the field of appliance scheduling for the residential sector to optimize electricity cost, peak-to-average ratio, and household electricity bills. In the last few years, various optimization techniques have been proposed which include classical techniques with mathematical optimization, heuristic and metaheuristic techniques, soft-computing techniques, fuzzy-logic and AI-based techniques, etc. Some of the related works in the field of home energy management for residential appliance scheduling are referred in this section.

In classical techniques with mathematical optimization, two sub-categories are involved; linear programming (LP) techniques and non-linear programming (NLP) techniques. Zhu et al. [13] employed an integer linear programming technique for power scheduling to reduce electricity usage during peak hours. A mixed integer linear programming (MILP) based technique is proposed in [14] for load balancing and cost optimization in smart homes for domestic users. Kurucz et al. [15] presented a direct load control-based linear programming model for appliance scheduling. The objectives such as cost reduction and PAR reduction are achieved using this model. In [16], LP based appliance scheduling scheme is proposed for smart homes. The scheme is evaluated based on the time-varying RTP tariff. The results show that the total cost of consumer households is minimized. Bradac et al. [17] formulated the residential appliance scheduling problem using the MILP technique. Six appliances are considered each for six dwellings. The electricity cost is minimized using the proposed model. The results show the reduction of cost from 3 to 16%. A MILP-based energy management framework for a better balance between demand and supply was proposed in [18]. Samadi et al. [19] proposed a home energy management approach using mixed integer non-linear programming (MINLP) based on time of use pricing. Pilloni et al. [20] proposed a greedy approach for smart home energy management to schedule home appliances for reducing electricity costs. The dynamic programming-based appliance scheduling technique is used in [21]. The optimization problem is divided into sub-problems and each sub-problem is solved by the DP approach. Ampimah et al. [22] proposed a non-linear programming-based approach to schedule appliances in residential households. Minimization of electricity cost and PAR were the objectives achieved using the proposed techniques. Wang et al. [23] proposed the MILP technique for residential appliance scheduling. The technique is evaluated for a single home with five home appliances. Time of use pricing scheme was incorporated to determine results. The results show the electricity bill and power consumption was reduced by 58 and 5%, respectively.

For solving problems like appliance scheduling, heuristic and meta-heuristic techniques offer good solutions. They rely on better search techniques to find solutions than conventional techniques which lowers the computation burden. Khan et al. [24] designed a generic model for optimizing energy consumption in residential households. The energy management controller (EMC) is used to control the energy consumption during peak hours. Mahmood et al. [25] proposed a heuristic-based technique to minimize the electricity cost of smart homes using binary particle swarm optimization. In [26], the authors proposed a genetic algorithm-based appliance scheduling technique for efficient home energy management in the residential area. They considered two pricing schemes for calculation; time of use pricing and real-time pricing. GA is used for cost and PAR reduction. Simulation results show that GA works better for a combination of TOU and RTP to minimize electricity cost and PAR. Di Somma and Graditi [27] proposed a stochastic-based technique for the optimal scheduling of appliances. The primary goal of the study is to reduce the electricity cost based on time-varying user constraints. A teaching-learning-based genetic optimization (TLGO) is demonstrated for residential appliance scheduling with a day-ahead pricing scheme [28]. Zhao et al. [29] proposed a genetic algorithm-based optimal power scheduling technique to minimize the electricity cost and user discomfort. It deals with a large number of appliances with complex systems. Rahim et al. [30] proposed a scheme to solve appliance scheduling problems using a meta-heuristic technique. The residential appliance scheduling problem is mapped to multiple knapsack problems and optimized using ant-colony optimization. A particle swarm optimization (PSO) based technique for scheduling appliances was proposed in [31]. The time of use pricing scheme is used for cost optimization in the proposed technique. In [32], the authors proposed a bat algorithm and flower pollination algorithm for modeling home energy management systems to reduce electricity bills and peak demand. Jamil et al. [33] proposed a two-tier energy management model using an earthworm optimization algorithm and cuckoo search algorithm to optimize energy consumption and reduce electricity cost and PAR. Javaid et al. [34] proposed dynamic programming and metaheuristic algorithms GA and PSO-based approaches to schedule household appliances. The proposed models are evaluated based on RTP and CPP. A flower pollination algorithm and harmony search algorithm was proposed in [35]. CPP scheme is implemented with 16 appliances in a smart home. EWA and HSA-based optimization technique is proposed for scheduling six appliances in a single home with TOU as a pricing scheme [36]. A combination of two or more meta-heuristic algorithms is considered a hybrid approach. Various hybrid techniques are studied in the literature for solving residential appliance scheduling problems. In [37], a combination of GA and PSO is used for scheduling home appliances. The results show the hybrid model is effective for solving the demand side management problem. A hybrid evolutionary approach is presented with a combination of PSO and neuro-fuzzy logic in [38] to evaluate appliance scheduling over 24 h. Javaid et al. [39] proposed a hybrid genetic-wind-driven (HGWD) algorithm for scheduling in a residential area. The hybrid approach outperforms both GA and WDO. Ahmad et al. [40] designed a hybrid approach consisting of GA and PSO. The hybrid model HGPSO model achieved a significant reduction in electricity bills and PAR. Manzoor et al. [28] have proposed a teaching-learning genetic algorithm as a combination of TLBO and GA. The proposed model used a day ahead pricing scheme to achieve cost savings. Apart from the aforementioned techniques, several appliance scheduling techniques have been proposed in the existing literature which are summarized in Table 1.

Table 1 Appliance scheduling techniques

3 Problem Statement

In this section, problem statement of our work and mathematical formulation of the proposed residential appliance scheduling problem are discussed. Here, the major emphasis is given to finding optimized appliance schedules based on user inputs. It is assumed that the consumers have provided an initial appliance schedule before scheduling which comprises of power ratings of appliances and their respective time durations. The energy consumption scheduler (ECS) in the home energy management system gives the best optimal schedule to the user for implementing it. The residential appliance scheduling problem is defined as the problem of scheduling appliances at appropriate periods considering dynamic pricing schemes without violating constraints. The objectives considered for residential appliances scheduling problem are as follows:

3.1 Minimization of Electricity Cost (EC)

The total electricity cost of all the appliances over a given day in a smart household is given by (1).

$$\begin{aligned} \sum _{n=1}^{N} \sum _{t=1}^{24} (P_{avg, n} \times S_{n,t} \times \beta _t) \end{aligned}$$
(1)

where, n denotes the number of appliances varies from 1 to N, \(P_{avg,n}\) is the average power rating of the nth appliance, \(S_{n,t}\) denotes appliance status whether it is ON/OFF where \(S_{n,t}=[0,1]\). 1 represents ON status and 0 represents OFF status. \(\beta _t\) is the electricity price at the particular hour \(t_i\) taken from the Nord pool cost dataset, \(\beta _t\) is the dynamic pricing scheme used by utilities which includes critical peak pricing, time of use pricing, real-time pricing, inclined block rate pricing, etc. In this paper, we have used time of use pricing and critical peak pricing for calculating the electricity cost of residential home appliances. The pricing schemes are discussed in detail in Sect. 3.4. t is the time varying from 1 to T; We have assumed that one day scheduling period is divided into 24-time slots. Thus, \(t \in T\), \(\forall T = {t_1,t_2, \ldots ,t_{24} }\).

Thus, the objective of minimizing the electricity cost is given by (2).

$$\begin{aligned} \text {minimize } \sum _{n=1}^{N} \sum _{t=1}^{24} (P_{avg, n} \times S_{n,t} \times \beta _t) \end{aligned}$$
(2)

3.2 Minimization of Peak-to-Average Ratio (PAR)

PAR is defined as the ratio of peak load to average load consumed by the appliances over a given day. PAR reduction is important for both utility providers and consumers for the proper management of smart appliances. It also helps in lessening the burden on utility providers and consumers. It reduces the peak load demand and also helps in reducing the operational time of power plants and backup generators. To have minimum PAR is necessary to bring balance between demand and supply between consumers and utility. It helps in achieving stable systems, and cost reduction in electricity bills. PAR ratio can be defined as follows given by (3).

$$\begin{aligned} PAR = \frac{Load_{peak}}{Load_{avg}} \end{aligned}$$
(3)

here, \(Load_{peak}\) is the maximum load consumed by the home appliances in a smart home in one hour and \(Load_{avg}\) is the average load consumed by home appliances in one day. The hourly load (\(Load_h\)) is a load consumed in one hour which is given by (4) and the average load \(Load_{avg}\) in a single day is given by (5).

$$\begin{aligned}{} & {} Load_h = \sum _{i=1}^{n} P_{avg,n} \end{aligned}$$
(4)
$$\begin{aligned}{} & {} Load_{avg} = \frac{\sum _{t=1}^{24} \sum _{i=1}^{n} P_{avg,n}}{24} \end{aligned}$$
(5)

The formula for peak to average ratio is given by (6)

$$\begin{aligned} PAR = \frac{max(Load_{h})}{Load_{avg}} \end{aligned}$$
(6)

The objective function to reduce the peak-to-average ratio is given by (7).

$$\begin{aligned} \text {minimize } PAR \end{aligned}$$
(7)

Thus, the main objectives of the residential appliance scheduling problem are to minimize electricity cost and PAR and thereby reducing the electricity bill of consumers and balancing the energy profile of a smart home.

Table 2 Appliance classification with power rating and operating time duration

3.3 Categorization of Appliances

The residential appliance scheduling is strictly based on consumers’ appliance schedules and their usage preferences. The smart home is monitored with appliances’ power information and their usage pattern. The categorization of appliances is done based on user assumptions and preferences. A sample dataset comprising appliances and their power & usage information is given in Table 2. In this paper, we have taken the appliance usage information and pricing rates from the Pecan street dataport [54], Nordpool dataset [55], US energy information administration [56], and Waterloo north hydro Inc. [57].

Smart home appliances are classified into two sub-categories; shiftable appliances and non-shiftable appliances. Mostly, scheduling is done for shiftable appliances as it’s mandatory for non-shiftable appliances to function at their respective time. The classification of appliances can vary from season to season. For example, a refrigerator in the summer season acts as a non-shiftable appliance as it is mandatory to keep it ON, whereas it may act as a shiftable appliance in the winter season as its operation is different in different seasons. The classification of the appliance are as follows:

  • Non-shiftable Appliances: These appliances cannot be used for scheduling and are kept out of the optimization problem as they must be switched on at the prescribed time slots because of their fixed pattern. For example, refrigerator, AC, TV, etc.

  • Shiftable Appliances: These appliances can be shifted to other time slots for scheduling where the pricing rate is minimum and are referred to as schedulable appliances. They can be scheduled at any time within their stipulated time horizon. While considering serial scheduling of appliances, these appliances cannot be delayed or interrupted while their functioning is on. However, in parallel scheduling, these appliances can be interrupted and scheduled the remaining duration to some other time slots. Shiftable appliances include vacuum cleaner, washing machines, dishwashers, electric kettles, etc.

3.4 Pricing Schemes

The key component of a smart grid is the ability to enable dynamic pricing schemes to incentivize consumers to schedule their household appliances in an efficient manner. There are several variants of dynamic pricing signals [58]. The idea of dynamic pricing is a key component in a residential smart grid in which utility creates a time-varying structure with respect to time. There are two pricing schemes that are implemented in this paper i.e., time of use pricing and critical peak pricing. In this section, we have discussed both the aforementioned pricing schemes in detail with examples.

3.4.1 Time of Use Pricing

A TOU is a pricing scheme where electricity rates vary according to the time of the day. The pricing is adjusted on different blocks of the day. Generally, a day is divided into 3 blocks each of approximately 8 h. The pricing rates in each block remain the same throughout the season. The pricing during the peak periods and off-peak period is different. The rate of electricity in the peak period is kept high by the utility. Figure 2 shows different rates of electricity at different times. The TOU rate is 4.2 cents/hour in an off-peak period and 9 cents/hour during peak hours. As we can infer, the cost of electricity is high when consumed during peak periods. Therefore, consumers are encouraged to minimize their consumption during peak hours or shift it to off-peak hours to balance the energy profile of a smart home. A time of use pricing rate is published well in advance by the utility service provider.

Fig. 2
figure 2

Time of use pricing (TOU)

3.4.2 Critical Peak Pricing (CPP)

CPP is a pricing scheme applied at intervals where electricity usage is very high (Approx. 10–20 kWh). This period is called a critical period where consumption is very high. These critical periods are decided by the utility where total electricity consumption is beyond the threshold value. The main purpose of implementing CPP is to aware consumers when they can schedule the appliances. It defines the higher price rates in critically overloaded periods. This pricing scheme is similar to TOU but the peak pricing of CPP is very high as compared to normal TOU peak pricing. Figure 3 shows the CPP pricing scheme where the critical period electricity rate is 108 cents/hour and the non-critical period rate is 10 cents/hour. Thus, it is advisable to schedule the appliances in non-critical periods to save the electricity bills. Usually, this pricing scheme is required in summer periods when prices change periodically and the system is overloaded.

Fig. 3
figure 3

Critical Peak Pricing (CPP)

4 Proposed Work

In this paper, a residential appliance scheduling problem is formulated and solved using the multiple knapsack technique. The electricity cost and PAR are optimized using two scheduling techniques i.e, serial scheduling (uninterrupted scheduling) and parallel (interruptible scheduling) scheduling. Two novel appliance scheduling algorithms using multiple knapsack perspectives are proposed. The first algorithm serially considers appliance scheduling and the second one schedules the appliances parallelly. To schedule appliances, The proposed schemes consider only shiftable appliances for scheduling to minimize cost and PAR as it is mandatory for non-shiftable appliances to function according to user preference and fixed operating patterns. The goal of the proposed schemes is to optimally schedule all the schedulable appliances using multiple knapsacks so that they meet all the constraints given by utility and consumer.

The knapsack problem is a problem in the combinational optimization field to find the maximum number of elements having maximum profit with a weight capacity equal to sack capacity. The multiple knapsack problem is a generalization of the single knapsack problem [59,60,61,62,63].

It is a resource allocation problem where the set of n objects and m knapsacks are considered. In a single knapsack problem, each object in the set of n objects has two important attributes which are the value and weight of the object. Every knapsack has a capacity of \(C_j\) which represents the maximum weight a knapsack can accommodate. The objective of MKP is to allocate all the objects within the bins such that the net value of all objects is maximized. We have formulated our residential appliance scheduling problem as the optimization problem using a binary multiple knapsack problem in which the total energy consumption of all types of appliances cannot exceed a given capacity or threshold per hour. For electricity cost and PAR reduction, the knapsack problem formulation technique is used as follows:

Keeping the total energy consumption of each household appliance under a certain energy threshold with maximum benefit is regarded as a knapsack problem for appliance scheduling. We have mapped the residential appliance scheduling problem with multiple knapsack problems. The mapping of multiple knapsack problems and residential appliance scheduling is given below:

  • The knapsack takes the input as value, weight, and capacity. Here, we take 24 knapsacks for 24-time slots in a given day to schedule the appliance in that particular hour keeping in mind the threshold value for the hour. As a day is divided into 24 hly slots, the maximum number of knapsacks that can be used is 24.

  • A number of objects/items correspond to a number of appliances.

  • The value of the item in that particular hour is the cost consumed by the appliances in that hour.

  • The weight of each item is mapped to the power rating/energy consumption of that appliance.

  • The capacity of the knapsack corresponds to the threshold value allowed by the utility in a particular hour. The threshold is the maximum energy that can be allowed by the grid in that time slot.

4.1 Scenario 1—Proposed Algorithm 1: MKSI

In this scenario, the RASP problem is solved with respect to the serial scheduling of smart home appliances. The serial scheduling means appliances can be scheduled in ordered manner and cannot be interrupted. The algorithm is referred to as MKSI (multiple knapsacks with serial implementation). The proposed MKSI algorithm is discussed in detail in this section.

Algorithm 1
figure a

Residential Appliance Scheduling using MKP in a serial manner - MKSI.

The working of Algorithm 1 is as follows: The inputs of the algorithm are power ratings of each appliance, operational time duration of each appliance, threshold capacity in a particular hour published by utility, and electricity pricing rates. The best cost value and index of appliances to be scheduled in a particular hour are given in steps (3) and (4) using the knapsack technique. Step (6) stores the index of the appliances to be scheduled. The scheduling of appliances is denoted by representing 1 in the specific time slot and the duration of that appliance LOT is reduced by 1 as given in steps (10) and (11). This process gets repeated until the time duration of every appliance is finished. In serial scheduling, the operation of an appliance cannot be interrupted. It operates its full duration and terminates when its duration is completed. Step (16) to (22) describes serial scheduling. To illustrate this, as shown in Table 5, the 5th hour of the day schedules vacuum cleaners and dishwashers as it is mandatory to finish their entire duration in serial scheduling. Then the remaining appliances are scheduled with updated capacity.

4.2 Proposed MKSI—Illustration with an Example

The inputs required by the MKSI algorithm are the power rating of each appliance, length of operational time (LOT) for each appliance, electricity pricing rates (TOU and CPP in this case), and hourly threshold provided by the utility. To have a better understanding of the algorithm, a numerical example of the proposed MKSI is illustrated using the following tables. For simplicity, we have considered 7 shiftable appliances. A day is divided into 24-hour timeslots. Table 3 shows the appliances taken into consideration with their respective power rating and length of operational time. Each appliance is presented in the form of a matrix of zeros and ones. For example, Fig. 4 shows a \(24 \times 7\) matrix depicting the initial appliance schedule with 7 home appliances operating in one day. The initial appliance schedule is provided by the user in which the status of the appliance is denoted by 0 or 1. Highlighted value of 1 in Fig. 4 indicates the ON status of an appliance at that particular hour and zero shows the appliance is OFF at that particular hour. As we can see the Fig. 4, the highlighted values lie in the middle of the day as provided by the user where pricing rates are high (peak hours). Our goal here is to shift these appliances from peak hours to off-peak hours so that electricity costs and PAR are minimized.

Table 3 Appliances’ power ratings and duration of their operation
Fig. 4
figure 4

Initial appliance schedule based on consumer preferences for MKSI

Fig. 5
figure 5

Final appliance schedule after MKSI—serial/non-iterruptible scheduling

In this example, we have used the hourly threshold capacity as 8 kW. Each appliance is designated with its power rating. Thus, the MKSI algorithm schedules as many appliances in a particular hour to accommodate within the capacity bin of 8 kW.

In serial scheduling of appliances, it is assumed that the appliances get scheduled in an ordered fashion and shifted from peak load hours to non-peak load hours. The final appliance schedule after applying the MKSI algorithm is given in Fig. 5. Using the above model, the consumer’s electricity bill and peak-to-average ratio are minimized. Also, it is beneficial for the main grid/utility as it lowers the burden of the grid.

4.3 Scenario 2—Proposed Algorithm 2: MKPI

In this scenario, the RASP problem is solved with respect to the parallel scheduling of smart home appliances. Here, parallel scheduling means the appliances can be interrupted and simultaneously other appliance can be scheduled based on knapsack policy. The algorithm is referred to as MKPI (multiple knapsacks with parallel implementation). The proposed MKPI algorithm is discussed in detail in this section.

Algorithm 2
figure b

Residential Appliance Scheduling using MKP in a Parallel/interruptible manner.

The working of Algorithm 2 is as follows: The inputs of the MKPI algorithm are the power rating of each appliance, operational time duration of each appliance, threshold capacity allowed in an hour, and pricing rates. Steps (4–7) calculate the best value and index of appliances to be scheduled in a particular hour using the knapsack technique. Step (8) stores the index of the appliances to be scheduled in an array. The appliance scheduling is denoted by inserting 1 in the particular time slot meaning the appliance is scheduled in that hour and the duration of that appliance is reduced by 1 hr as given in steps (10) and (11). This process gets repeated until the time duration of every appliance is finished. If the timeslot of that appliance is finished, then it is said to be scheduled completely given by steps (12) and (13). In parallel scheduling, the operation of the appliance can be interrupted. To illustrate this, as shown in Fig. 7, appliances such as dishwashers, clothes washers, and electric iron are interrupted and scheduled to other slots considering the interruptible scheduling of the appliances. If all the appliances in the items array are scheduled, then the remaining time slots are represented with zero.

4.4 Proposed MKPI—Illustration with an Example

A numerical example of the proposed MKPI algorithm is illustrated using Figs. 6 and 7 to get a better understanding of the algorithm. The inputs required by the MKPI algorithm are the power rating of each appliance, length of operational time (LOT) of the appliances, electricity pricing rates (TOU and CPP in this case), and hourly threshold given by the utility. For user simplicity, we have considered 7 shiftable household appliances. A day is divided into 24 hly timeslots. The same appliance information is used as the previous algorithm given in Table 3. It shows the appliances taken into consideration for scheduling with their respective power ratings and length of operational time. Figure 6 shows a \(24 \times 7\) matrix depicting the initial appliance schedule with 7 appliances operating over a day. The initial appliance schedule is provided by the consumer in which the status of the appliance is denoted by 0 or 1. Highlighted value of 1 in Fig. 6 indicates the ON status of the appliance at a particular hour and zero shows the appliance is OFF at that hour. As we can see the Fig. 6, the highlighted values lie in the middle of the day when the pricing rate is high (peak hours). Our goal for scheduling is to shift these appliances from peak to off-peak hours so that cost and PAR gets reduced.

In this example, the capacity for each hour given by the utility is 8 kW. Every appliance is designated with its power rating. The MKPI algorithm schedules maximum appliances in a particular hour to accommodate the appliances within the given capacity of 8 kW. Using the above model, the consumer’s electricity bill and PAR are minimized. Also, it is useful for the grid as it lessens the stress of the grid. In the MKPI algorithm, the appliances are allowed to be get interrupted in between and finish their operation in some other time slots which gives the consumer the flexibility to schedule their appliances. The final appliance schedule after applying the MKPI algorithm is shown in Fig. 7.

5 Simulation Results and Discussion

In this section, the performance of proposed algorithms is discussed and validated through performing simulations in MATLAB 2022b. Two individual smart homes with a different number of appliances are considered for evaluation of proposed algorithms. The proposed schemes are analyzed on the basis of dynamic pricing tariffs TOU and CPP. The datasets considered for the study are obtained from the pecan street dataport and Nord pool datasets. Dataset 1 consists of 7 smart home appliances while dataset 2 contains 11 appliances. Both datasets have different TOU and CPP rates.

Fig. 6
figure 6

Initial appliance schedule based on consumer preferences

Fig. 7
figure 7

Final appliance schedule after MKPI—parallel/iterruptible scheduling

5.1 Dataset 1 Results Using TOU Pricing

As shown in Fig. 8a, the TOU pricing rate is plotted against time. TOU pricing varies according to the time slots. Usually, a day is divided into 3 slots of 8 h each. The TOU pricing during the off-peak period and on-peak period is 1.2 cents/hr and 3 cents/hr respectively as shown in Fig. 8a. The pricing rate for the peak period is more than the off-peak period which encourages consumers to schedule their appliances in off-peak hours or to shift the electricity consumption from peak to off-peak period. Figure 8b denotes the hourly electricity load of the unscheduled scenario and proposed algorithms. As we can deduct from Fig. 8b, the load during peak hours is reduced and shifted to off-peak hours after the scheduling of appliances using MKSI and MKPI. It helps in maintaining balance and uniformity of the energy profile of the home. As a result, the hourly cost of household appliances during peak hours is also reduced using the proposed algorithms as shown in Fig. 8c.

Fig. 8
figure 8

a TOU pricing, b electricity load per hour, and c electricity cost per hour for dataset 1, respectively

5.2 Dataset 2 Results Using TOU Pricing

As shown in Fig. 9a, TOU pricing during the off-peak period and on-peak period is 4.2 cents/hr and 6 cents/hr respectively. The pricing rate for the peak period is more than the off-peak period which encourages consumers to schedule their appliances from peak period to off-peak period. Figure 9b denotes the hourly electricity load of the unscheduled scenario and proposed algorithms. As we can infer from Fig. 9b, the load during two peak periods is reduced and shifted to off-peak periods after the scheduling of appliances using MKSI and MKPI. Thus, balancing of load profile of a home is also achieved. As a result, the hourly cost of the appliances during peak hours is reduced as shown in Fig. 9c.

Fig. 9
figure 9

a TOU pricing, b electricity load per hour, and c electricity cost per hour for dataset 2, respectively

Total electricity cost over a day and PAR ratio for both datasets are given in Figs. 10 and 11. For dataset 1, the total cost of electricity for the unscheduled scenario, MKSI, and MKPI is 267.6 cents, 192.36 cents, and 185.16 cents respectively. The proposed algorithms MKSI and MKPI reduce the cost by 28.11% and 30.87% respectively as compared to the unscheduled scenarios. As shown in Fig. 11, PAR values for the unscheduled scenario, MKSI, and MKPI are 3.09, 1.25, and 1.25, respectively which achieves a PAR reduction of 59.60% as compared to the unscheduled scenario.

Similarly, for dataset 2, the total electricity cost for the unscheduled scenario, MKSI, and MKPI is 1610 cents, 1410 cents, and 1388 cents, respectively. The cost reduction achieved by proposed algorithms MKSI and MKPI is 12.42% and 13.78% respectively compared to unscheduled cases. As shown in Fig. 11, PAR values for the unscheduled scenario, MKSI, and MKPI are 2.8143, 1.9544, and 1.8762, respectively thereby reducing PAR by 30.55% and 33.33% for MKSI and MKPI respectively in comparison with the unscheduled scenario. Figure 12 depicts the comparison of the monthly electricity bill for all three cases. The results show that the proposed algorithms significantly reduce the monthly bill of consumers as compared to the unscheduled scenario.

5.3 Dataset 1 Results Using CPP

As shown in Fig. 13a, CPP rates during the off-peak period and on-peak period are 1.2 cents/hr and 8 cents/hr, respectively. The difference between the pricing rate in the off-peak and on-peak periods is very high as compared to normal TOU pricing. This pricing scheme is applied when the load during a particular hour is beyond the critical threshold provided by the utility. Thus, it is advisable not to schedule appliances during the critical period as the rates of electricity are very high. Figure 13b denotes the hourly electricity load achieved by the unscheduled scenario and proposed algorithms. As we can see from Fig. 13b, the load during the critical period is reduced and shifted to the off-peak period after MKSI and MKPI scheduling. As a result, the hourly cost of household appliances during peak hours is also reduced as shown in Fig. 13c.

5.4 Dataset 2 Results Using CPP Pricing

In the given dataset, CPP rates during the off-peak period and on-peak period are 4.2 cents/hr and 12 cents/hr respectively as shown in Fig. 14a. Thus, we try to schedule appliances in off-peak hours rather than critical hours where electricity rates are too high. Figure 14b denotes the hourly electricity load of the unscheduled scenario and proposed algorithms. We can infer from Fig. 14b that load during the critical period is reduced using MKSI and MKPI compared to unscheduled cases. As a result, the hourly cost of household appliances during peak hours is also reduced as shown in Fig. 14c.

Fig. 10
figure 10

Total electricity cost for both datasets

Fig. 11
figure 11

PAR for both datasets

Fig. 12
figure 12

Monthly Electricity bill for both datasets

Fig. 13
figure 13

a CPP rates, b electricity load per hour, and c electricity cost per hour for dataset 1, respectively

Fig. 14
figure 14

a CPP rates, b electricity load per hour, and c electricity cost per hour for dataset 2, respectively

Total electricity cost over a day and PAR ratio for both datasets are given in Figs. 15 and 16. For dataset 1, the total electricity cost for the unscheduled scenario, MKSI, and MKPI is 620 cents, 336 cents, and 309 cents, respectively as given in Fig. 15. Thus, the proposed algorithms MKSI and MKPI reduce the cost by 45.80% and 50.16% compared to the unscheduled scenario. As shown in Fig. 16, PAR values for the unscheduled scenario, MKSI, and MKPI are 3.09, 1.25, and 1.25, respectively which achieves a PAR reduction of 59.60% compared to the unscheduled scenario.

Similarly, for dataset 2, the total cost of electricity for the unscheduled scenario, MKSI, and MKPI is 2802 cents, 1702 cents, and 1609 cents, respectively. The results show that the proposed algorithms MKSI and MKPI achieve cost reduction by 39.25% and 42.57% compared to the unscheduled scenario. As shown in Fig. 16, PAR values for the unscheduled scenario, MKSI, and MKPI are 2.42, 1.95, and 1.87, respectively which means PAR is reduced by 19.42% and 22.72% for MKSI and MKPI. Finally, Fig. 17 shows the comparison of monthly electricity for unscheduled cases, MKSI and MKPI. The results show that the proposed algorithms significantly reduce the monthly bill of consumers.

Fig. 15
figure 15

Total electricity cost for both datasets

Fig. 16
figure 16

PAR for both datasets

Fig. 17
figure 17

Monthly Electricity bill for both datasets

The graphical and numerical results of the electricity load and electricity cost validate that electricity cost minimization using both proposed algorithms is significant compared to the unscheduled scenario. The proposed MKSI and MKPI outperforms unscheduled case for both datasets and pricing schemes. The average cost reduction in MKSI and MKPI for both datasets is 20.26% and 22.33%, respectively when the TOU signal is considered and 42.52% and 46.36%, respectively when the CPP signal is considered. Similarly, the average PAR ratio in MKSI and MKPI shows a 45.07% and 46.36% reduction for the TOU pricing scheme and 39.51% and 41.16% for the CPP scheme. The parallel/interruptible scheduling algorithm MKPI outperforms both unscheduled and MKSI scenarios. The average cost reduction achieved by MKPI is 2.7% for TOU pricing and 6.73% for CPP when compared to MKSI.

5.5 Performance Compared to the Existing Algorithm

Mahmood et al. [64] proposed an Optimized approach for Home Appliance Scheduling (OHAS). They have categorized load into three types; baseline load, regular load, and burst load. Six home appliances are considered for the study. The existing knapsack technique is used for limited slots scheduling and whole-day scheduling. We have taken a whole day scheduling knapsack case to compare with our proposed algorithms since we intend to schedule home appliances over a day. The performance of these algorithms is evaluated using TOU and CPP signals. The results are shown in Tables 4 and 5.

As it can be seen from Tables 4 and 5, the proposed algorithms significantly reduce the electricity cost compared to the unscheduled scenario and existing case. The proposed algorithms MKSI and MKPI achieve 29.67% and 32.67% cost reduction respectively for the TOU pricing scheme and 14.17% and 18% for CPP. Also, PAR evaluation shown in the results with and without scheduling depicts the significant change in the existing and proposed algorithm. Both MKSI and MKPI achieve PAR reduction as compared to the unscheduled scenario and existing algorithms. The PAR reduction achieved by MKSI and MKPI is 14.88% for TOU cases and 45.60% for CPP, respectively.

Table 4 Comparison with existing algorithm OHAS using TOU
Table 5 Comparison with existing algorithm OHAS using CPP

6 Conclusions and Future Scope

The purpose of residential home energy management is to schedule the household appliances with the objective of reducing electricity cost and peak load. In this paper, we have proposed two appliance scheduling algorithms based on the multiple knapsack technique. The first algorithm MKSI enables the serial scheduling of residential household appliances while MKPI attempts to schedule them in a parallel manner. For the implementation of these algorithms, we have mapped the residential scheduling problem to multiple knapsack problem. The proposed algorithms are designed using two dynamic pricing schemes; TOU and CPP with performance parameters such as electricity cost, PAR, monthly electricity bill, and balancing household load profiles. The proposed schemes encourage the consumers to shift the energy consumption from peak hours to off-peak hours and balance the load profile of the smart home. The two proposed algorithms are compared with an unscheduled scenario and an existing algorithm. The proposed MKSI algorithm achieves cost reduction of 20.26% and 42.53% for TOU and CPP, respectively as compared to the unscheduled scenario while PAR is reduced by 45.07% and 39.51% for TOU and CPP, respectively. The proposed MKPI algorithm achieves 22.33% and 46.36% cost reduction compared to the unscheduled case for TOU and CPP while the PAR ratio is reduced by 46.47% and 41.16% for TOU and CPP respectively. From the results, it is clear that the parallel/interruptible scheduling algorithm MKPI outperforms all the three cases which include unscheduled scenario, existing algorithm, and MKSI.

The proposed schemes consider electricity cost and PAR as optimization parameters. However, these schemes can be extended for optimization of few more parameters such as consumer comfort, waiting time of the appliances, temperature, weather related parameters, seasonal changes, carbon minimization, etc. The efficacy of the proposed schemes can be further enhanced by adding information about the parameters which are directly or indirectly related to smart grid. Also, the proposed models can be validated using larger datasets. Apart from this, our future work direction will be to investigate the proposed appliance scheduling schemes with respect to the integration of renewable energy sources and energy storage systems. Also, similar techniques can be extended to industrial appliance scheduling problems for industrial DR implementation. Appliances scheduling can also be solved by operating system concepts such as priority scheduling, CPU scheduling, etc. This work can be extended to a multi-microgrid scenario where multiple homes with coordination between appliances exist.