1 s2.0 S2210537923000537 Main

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Sustainable Computing: Informatics and Systems 39 (2023) 100898

Contents lists available at ScienceDirect

Sustainable Computing: Informatics and Systems


journal homepage: www.elsevier.com/locate/suscom

Energy management of smart homes over fog-based IoT architecture


Muhammad Umair a,b ,∗, Muhammad Aamir Cheema c , Bilal Afzal d , Ghalib Shah e
a
School of Computer Science, The University of Sydney, Camperdown NSW 2006, Australia
b
Department of Electrical, Electronics and Telecommunication Engineering, New Campus, University of Engineering and Technology, Lahore, Pakistan
c
Faculty of Information Technology, MONASH University, Wellington Rd, Clayton VIC 3800, Australia
d
National Centre for Cyber Security, Air University, Islamabad, Pakistan
e Sultan Qaboos IT Chair, University of Engineering and Technology, Lahore, Pakistan

ARTICLE INFO ABSTRACT

Keywords: Existing research studies on home automation systems mostly conserve energy by modeling the occupancy of
Smart home users within home. Some others apply statistical approaches on the survey data about usage of appliances.
IoT Consequently, these research works either reduce wastage of electricity through automation or achieve energy
Home automation system
efficiency based on appliances’ usage estimations. However, they do not provide energy consumption modeling
Energy optimization
which is human comfort centric and also validated through practical implementation in real-world smart
Energy modeling
Fog-based architectures
homes. We present a Markov-chain-based probabilistic model to obtain users stochastic activity patterns
Markov chain which are used to forecast the energy consumption in a smart home environment. These predictions are
then leveraged by our novel comfort aware energy saving mechanism named as prediction- and feedback-based
proactive energy conservation (PF-PEC) algorithm. The PF-PEC algorithm reduces the total energy consumption
while ensuring standard human comfort. Furthermore, a fog-based Internet of Things (IoT) architecture is
implemented and deployed in a smart home to efficiently incorporate the proposed algorithm in real-world
scenarios. Experimental results show up to 36% energy conservation, marking substantial reduction in daily
electricity usage.

1. Introduction
significance of optimizing demand side management is discussed in [6,
7]. Several research works leverage different statistical approaches to
In the last decade, the proliferation of smart devices has remark-
determine user activity patterns [8–10]. Some others have conducted
ably improved and reshaped the lifestyles of their users [1]. A home
automation system (HAS) introduces smartness and intelligence within user surveys to obtain energy demand and to predict energy con-
home appliances to automate various household operations. The pri- sumption of households operations [11,12]. However, these energy
mal objective is to reduce the tiresome decision-making process thus management techniques are error-prone as they rely upon appliances
making the user’s life hassle-free and providing them with flexibility data acquired through user surveys. They may under-perform when ap-
of control [2]. An Internet of Things (IoT) enabled smart home is a pliances’ usage routines are changed due to variations in environment
smart place where the appliances are connected to the Internet so over a period of time.
that every appliance is identifiable, accessible and thus controllable Similarly, state-of-the-art Markov-chain-based solutions determine
across the globe [3]. IoT takes the conventional HAS systems to next user state probabilities to compute user activity states and their result-
step, to improve the services of various sub-systems and expand their ing impact on energy demand [13–15]. However, one of the limitations
outreach. The appliances are controlled based on the user activity in these approaches is that they do not consider the shared nature of
patterns, user preferences, and/or according to the changes in dynamic appliances’ usage for estimating the user activities and corresponding
environmental conditions. Major benefits include more rational use of states. In other words, the proposed models in these research works do
energy and other resources which in turn results in superior energy not determine the cumulative users’ activity patterns. Research papers
management as well as significant time and cost savings [4]. on computing household activities and predicting energy consumption
Particularly, the energy management of smart homes has been a also exist in literature [16,17]. In fact, many state-of the-art predictive
focus of the research community in recent years [5]. For instance, the

∗ Corresponding author at: School of Computer Science, The University of Sydney, Camperdown NSW 2006, Australia.
E-mail address: [email protected] (M. Umair).

https://doi.org/10.1016/j.suscom.2023.100898
Received 19 March 2020; Received in revised form 30 May 2022; Accepted 14 July 2023
Available online 20 July 2023
2210-5379/© 2023 The Author(s). Published by Elsevier Inc. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-
nc-nd/4.0/).
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

algorithms investigated for smart homes are described in [18]. Never- 2. Related work
theless, the results obtained from these algorithms and prior works in
this research area are not experimentally validated in real-world smart 2.1. Markov chain for energy optimization
home environments.
In our research, a novel fog-based IoT-enabled HAS system is de- Markov chain is a stochastic model in which the probability of each
signed and implemented to take practical results in real-world sce- event in a sequence depends only on the state attained in the previous
event [19]. We provide more details of Markov chain in Section 3.1
narios. Therein, user surveys only serve as an initial knowledge to
where we discuss how we apply Markov chain to obtain the user state
the system, which will be then updated by providing a continuous
probabilities for our work. Several research studies propose proba-
feedback about the real-time data reported from the appliances them-
bilistic methods to model user behaviors [8–10,20]. Authors in [8]
selves. Hence, compared to traditional prediction based algorithms that
established the user occupancy from sensors deployed in smart build-
use user surveys, real-time appliances data usage will provide better
ings. They proposed a Markov model to forecast the user occupancy.
estimates of energy consumption. To the best of our knowledge, there The model outperforms the existing techniques based on probability
exists no comprehensive work on IoT-enabled smart homes that gives sampling, support vector regression and artificial neural networks for
thorough explanation of getting user activity patterns, and computes predicting short term user occupancy. A preliminary version of our
state transition probabilities along with stochastic state probabilities work is presented in [21] that leverages Markov chain for energy con-
in order to estimate energy consumption; and in a further step, that sumption optimization. A building energy consumption model based on
applies optimization algorithm on the predicted energy consumption to stochastic Markov models is proposed in [9]. Similarly, authors in [10]
reduce electricity usage in smart homes while ensuring user comfort. presented a four-state user occupancy model. They applied first order
This paper proposes a Markov-chain-based stochastic model to cal- Markov chain on user activity data and presented significance of their
culate user state transition probabilities which are then used to predict method through correlation of occupancy states in multiple occupied
the energy demand in next few time slots. Initially, user daily life dwellings. Similarly, a stochastic model of household activity patterns
routines are acquired by conducting a survey. The survey is designed is presented in [20]. It investigates the empirical activity data and
in a way to simplify the mapping of user data to four activity states explores patterns in form of stochastic process with memory of variable
which include absent, sleep, active and hyper-active state. The obtained length.
data is then processed to calculate user state transition probabilities. A Markov chain model is proposed in [22] to manage the power
consumption prediction to prevent overload usage of electricity. It
These probabilities are provided as an input to the Markov chain model
is a 3 state model including normal, critical and emergency states of
which gives user state probabilities in specified time slots. In this
the load. The predicted states are then utilized in a smart residential
respect, we estimate power consumption ranges against user state prob-
load management system. A Hidden Markov Model based algorithm is
abilities that are updated later by real-time appliance usage through
proposed in [23] to predict energy consumption in Korean residential
feedback mechanism. Experimental results are taken to validate that
buildings using data collected through smart meters. The model is
the actual energy consumption mostly stays within the range of max- validated on four buildings. The results show better root mean square
imum probability predicted from the model. Further, a prediction- and error as compared to Artificial Neural Networks (ANN), Support Vector
feedback-based proactive energy conservation (PF-PEC) algorithm is pre- Machines (SVM) and Classification and Regression Tree (CART). The
sented to minimize electricity cost by optimizing the operation of above stated models although incorporate various factors which may
smart home appliances. To incorporate the proposed algorithms in directly or indirectly influence the energy consumption, but they do
real-world scenarios, a fog-based IoT architecture for smart homes is not provide the real world applications of their work in the context of
implemented and deployed which provides appliances control and local energy conservation.
data processing closer to end-users. Finally, performance evaluation of
proposed algorithms is conducted exhibiting significant reduction in 2.2. Smart home energy management
the energy consumption of a smart home. Below, we summarize our
contributions. A smart home energy management solution is proposed in [24]. It
considers a detailed set of attributes related to energy management in
• We present novel algorithms that exploit human occupancy pat- a smart home. These attributes are then linked to each other by mean-
terns for energy conservation in smart homes while ensuring ingful and useful relationships. A fuzzy logic based smart home energy
human comfort. management is proposed in [25]. It classifies appliances based on their
• We present details of our general-purpose fog-based IoT architec- energy consumption patterns. In this respect, a fuzzy logic is then
ture for smart homes discussing its functionalities and characteris- proposed to operate different classes of appliances. A bat algorithm
(BA) based solution with exponential inertia weight is proposed in [26]
tics. We create a real-world testbed by implementing the proposed
to save energy in a smart home without deteriorating the user comfort.
architecture in a real-world smart home system.
Temperature, illumination, and indoor air quality are considered to
• We implement and deploy the proposed algorithms in our real-
account for the user comfort. The proposed approach shows positive
world testbed and conduct a detailed experimental study. The
results due to improved convergence behavior.
results demonstrate that our algorithms provide significant im-
A research study in [12] proposed an algorithm which manages
provement compared to the existing algorithms in terms of smart
household loads according to their predefined priorities and guarantees
home energy efficiency without compromising human comfort. the total power consumption below certain levels. Another research
in [14] identified several factors related to climate that can influence
The rest of the paper is organized as follows. Related work is discussed the energy utilization of a building and analyzed their contribution
in Section 2. Section 3 presents the details of our stochastic model in energy consumption. A multi-agent model is proposed in [15] for
and an algorithm that estimates the energy consumption in future simulating human activities for achieving energy efficiency. Authors
timestamps. In Section 4, we introduce the proposed PF-PEC algorithm in [16] developed a novel household resource allocation model which
for energy conservation in smart homes. We present our fog-based incorporates multiple interactions (such as interaction between time of
IoT architecture for smart homes and the details of real-world testbed use and energy consumption, the intra household interaction) based on
in Section 5. Section 6 presents the experimental evaluations and multi-linear utility functions. They endogenously represented zero con-
Section 7 concludes the paper. sumption for both time and energy within the group decision-making

2
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

modeling framework. Likewise, a statistical method is presented in [17] 3. Probabilistic model


for modeling the behavior of home occupants to estimate residential
energy consumption. A behavioral artificial neural network model is We propose a Markov-Chain-based stochastic model which gives
proposed in [27] for simulating energy consumption in smart dwellings. probabilities of user activities in a smart home. Moreover, the proposed
A methodological framework is presented in [28] for validation of model results in probabilities of consuming certain amount of power in
domestic lightening model. The metrics affecting lightening behavior specified time slots. This probability versus wattage dataset will then
are identified and lightening model according to different scenarios be used to propose an algorithm to minimize the cost of electricity con-
are statistically evaluated. However, these models do not consider and sidering different electricity tariffs. The user activities are categorized
predict overall energy consumption of a home as they focus on limited into four different states. These states are named as absent, sleep, active
factors such as users’ occupancy and/or lightening demand within a and hyper-active. A user can only be in one state at a given time. The
home. description of these user activity states is given in Table 1. User states
are defined in such a manner that each and every appliance to be used
2.3. Feedback mechanism and new approaches for energy optimization at home is covered.

The research in [29] highlights the importance of information feed- 3.1. Computing user states probabilities
back for households’ daily activities to improve the accuracy of en-
ergy consumption computations. This method gives direct feedback Initially, we conduct a survey to receive user activity patterns
to households and the information is relevant since it emanates from throughout the day. This survey acquires information about the number
their own reported activities. Authors in [30] investigated the complex- of shared and personal appliances at home. It serves as an initial
ity of existing models for occupancy behavior. Some of the concepts knowledge to the model and is used to calculate user activities in
presented in these papers [29,30] are leveraged in our model such specified time slots. These activity patterns constitute a state transition
as the application of feedback to the system. Several models specific matrix of a single user. It is important to mention that the user activ-
to certain cultures and geography are also available in literature. For ities will be continuously updated using feedback mechanism by our
example, in [11], a tool for predicting the total energy consumption and proposed algorithm. In the next step, Markov chain is applied on the
associated greenhouse gas (GHG) emissions of Australian households state transition matrix to compute stochastic user state probabilities.
is developed. It integrates the thermal efficiency of building envelope, Every user has its own state probability matrix as there is a separate
installed equipment, and different occupancy profiles with energy end- Markov process for each user. The user activity states are taken as the
use modules for space and water heating, cooling, lighting, and plug-in Markov states. The Markov set of states are: {𝛿𝑛 ∶ 0 ≤ 𝑛 ≤ 3} where 0
appliances. However, these research works deal with specific use cases means absent; 1 represents sleep state; 2 is active; and 3 is hyper-active
and are not generic enough to the energy demand of every geographical state. Whereas, 𝛿𝑛 represents the 𝑛th state. Let 𝑁𝑖,𝑗 denote the number
region. Nowadays, homes typically have multiple power sources such as of transitions from 𝑖th state to 𝑗th which is obtained from the survey
solar, battery bank, and grid [31]. Due to COVID-19, daily routines of of activity patterns of each user. Probability of transiting to 𝑗th state
people have changed and they spend more time at home. So, domestic from 𝑖th state is denoted as 𝑃𝑖,𝑗 and is computed as:
energy consumption has increased significantly. In this respect, a list of
new approaches towards energy management is provided in [32]. 𝑁𝑖,𝑗
𝑃𝑖,𝑗 = ∑ (1)
3
𝑘=0 𝑁𝑖,𝑘
2.4. Fog-based architectures and human-comfort-based energy optimization
Note that 𝑃𝑖,𝑗 ≥ 0 and, for every state 𝑖,

Many fog-based and federated-learning-based architectures have ∑


3

been proposed and utilized in many applications in the past few years 𝑃𝑖,𝑗 = 1 (2)
𝑗=0
due to the increasing interest in fog and edge computing [33–37]. A
novel four-tier architecture for load optimization in fog environments is The following 4 × 4 Markov state transition matrix is obtained from
proposed in [38]. A fog computing structure is proposed for tier-3. The user activity patterns:
proposed architecture helps in reducing fog node failures. A machine ⎡𝑃0,0 𝑃0,1 𝑃0,2 𝑃0,3 ⎤
learning classifier is proposed in [39] to reduce the energy and latency ⎢ ⎥
𝑃 𝑃1,1 𝑃1,2 𝑃1,3 ⎥
at the fog nodes. It investigates the performance of different machine 𝑇𝑠 = ⎢ 1,0
⎢𝑃2,0 𝑃2,1 𝑃2,2 𝑃2,3 ⎥
learning classifiers on a fog node. An energy consumption model is ⎢𝑃 𝑃3,3 ⎥⎦
⎣ 3,0 𝑃3,1 𝑃3,2
then proposed for the fog nodes. In [36], a fog platform termed as
EHOPES is proposed which comprises different hardware and software where each row in 𝑇𝑠 represents transition probability of transiting
capabilities. Therein, authors investigated the network requirements of from one particular state to the other states. Fig. 1 shows the state
various smart living applications of IoT and presented the performance diagram representing these activity states. It is clear from the diagram
of their proposed platform in terms of latency and throughput. The that each state is accessible from itself and all other states. Hereafter,
simulation results reported in [36] showed considerable improvement unless clear from context, we use 𝑇𝑠𝑢 to denote the transition matrix for
in reducing the latency. However, our proposed fog based architecture a particular user 𝑢. We use 𝑃𝑛𝑢 (𝑡) to denote the probability that a user 𝑢
achieves better latency results in comparison to EHOPES fog plat- is in state 𝑛 at time 𝑡 where 𝑛 is between 0 and 3. The state probability
form. A context-aware energy saving algorithm (namely M-CHESS) is matrix of a user 𝑠𝑢 (𝑡) at time 𝑡 can then be obtained by using its state
proposed in [37] which reduces energy consumption in smart home probability matrix at the previous time 𝑡 − 1 and its transition matrix
environment considering human comfort constraints. Our proposed 𝑇𝑠𝑢 :
solution human-centric as it also considers human comfort constraints
𝑠𝑢 (𝑡) = [𝑃0𝑢 (𝑡) 𝑃1𝑢 (𝑡) 𝑃2𝑢 (𝑡) 𝑃3𝑢 (𝑡)] = 𝑠𝑢 (𝑡 − 1) × 𝑇𝑠𝑢 (3)
as per ANSI/ASHRAE standard while improving energy conservation.
Another design approach to operate HVAC in a smart home envi- The initial state matrix (at time 0) of a user 𝑢 can be obtained
ronment is proposed in [40]. It also considers the human comfort using its known state at time 0, e.g., if a user is in state 1 at 𝑡 = 0
threshold in energy consumption management. It combines the values then the initial state vector is 𝑠𝑢 (0) = [0 1 0 0]. Let 𝑈 be the
of humidity and temperature to define comfort zones. We compare our set of all users living in a home. The sample space is a set of all
PF-PEC algorithm performance with that of E-HOPES and M-CHESS possible outcomes (represented by 𝑈𝑛 ) for all users 𝑈 living in home,
algorithms in performance evaluation Section. i.e. 𝑆𝑎𝑚𝑝𝑙𝑒 𝑆𝑝𝑎𝑐𝑒 = (𝑈𝑛 )𝑈 . The possible outcomes are the combinations

3
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

Table 1
Description of user activities.
States Description
Absent A user is in absent state, when he/she is outside the home.
Sleep When a user is present in the house but not engaged in any activity. Power consumed due to
his/her presence only comprises of cooling and heating of environment in corresponding room.
Active When a user is using his/her personal gadgets and appliances, i.e. computer, video-gaming,
chargers, etc. These appliances are other than the cooling or heating appliances.
Hyper-active When a user is utilizing one of the shared appliances at home. Shared appliances are the ones
which are in-use of every person at home, i.e. water pump, electric geyser, electric hearth,
washing machine, etc. These appliances also do not include heating or cooling appliances.

Fig. 1. User activities state diagram.

of different user activity states. Thus, an increase in number of users At least one user is hyper-active. The power consumption will be quite
increases the sample space essentially. Power consumption depends on high when at least one user is hyper-active because, as noted in Table 1,
the activity states of the users in the house, e.g., if all users are absent, the user will be using the shared appliances (which are usually the
the power consumption is low. Several combinations may correspond to high load appliances) in the home. Now, we show how to compute the
approximately same power consumption and considering all outcomes probability that at least one user is in state 3, the hyper-active state.
in the model will be redundant. Therefore, potential outcomes are The probability that a user 𝑢 is not in hyper-active state at time 𝑡 is
identified and only their combinations are considered. For instance, (1 − 𝑃3𝑢 (𝑡)). The probability that all user are in non-hyper-active state
one potential outcome is all users are in absent state; another possible ∏
can be computed as 𝑢∈𝑈 (1 − 𝑃3𝑢 (𝑡)). Thus, the probability that at least
outcome is at least one user is in hyperactive state, and so on. In essence, one user is in hyper-active state can be obtained as
only those outcome combinations are selected that correspond to fairly ∏
different power consumption. Hence, our first outcome combination 𝑃1+ℎ𝑦𝑝𝑒𝑟𝑎𝑐𝑡𝑖𝑣𝑒 = 1 − (1 − 𝑃3𝑢 (𝑡)) (6)
is all users in absent state. Reason to consider this combination in the 𝑢∈𝑈
model is because in most cases, it corresponds to minimum power At least one user is active. When at least one user is active (i.e., state
consumption range in the house. Next, we consider several possible 2), the power consumption will be lower than the case when at least one
combinations of activity states of the users living in the house and show user is hyper-active but will be higher than when all users are asleep
how to calculate their probabilities. or absent. Similar to Eq. (6), the probability that at least one user is
All users are absent. If all of the users are in state 0 (i.e., absent), the active can be computed as
power consumption will be the lowest. The Markov state probability ∏
matrix in Eq. (3) is specific to one user. The activity states of all users 𝑃1+𝑎𝑐𝑡𝑖𝑣𝑒 = 1 − (1 − 𝑃2𝑢 (𝑡)) (7)
are independent of each other. Therefore, to compute the probability 𝑢∈𝑈
of more than one user in a particular state, we simply need to find their Equations (4) to (7) provide the probabilities of different impor-
joint probability i.e. probability that two users 𝑢 and 𝑣 are both in state tant combinations of user states that can be used to estimate energy
0 at 𝑡th time slot is 𝑃0𝑢 (𝑡).𝑃0𝑣 (𝑡). Probability of all users in absent state consumption level. Hence, the principle defined for grouping of user
at time 𝑡 can is obtained as: activities into states and state probability data set along with current

𝑃𝑎𝑙𝑙−𝑎𝑏𝑠𝑒𝑛𝑡 = 𝑃0𝑢 (𝑡) (4) state of appliances (provided by feedback mechanism) help to estimate
𝑢∈𝑈 probability of consuming a certain amount of energy at a particular
All users are sleeping. If the users are present in home but are sleeping time slot. This data set is converted into a table as shown in Table 3a
(i.e., in state 1), the power consumption will still be low but higher than and Table 3b. These tables are specific to a use case described in
when all users are absent. The probability that all users are sleeping at Section 6. The values in these tables represent different probabilities
time 𝑡 can be obtained as of all users cumulatively consuming a certain power. Next, we present
∏ an algorithm that uses these probabilities to estimate probability of
𝑃𝑎𝑙𝑙−𝑎𝑠𝑙𝑒𝑒𝑝 = 𝑃1𝑢 (𝑡) (5)
consuming high power at a certain timeslot.
𝑢∈𝑈

4
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

Algorithm 1 : Energy Consumption Modeling Algorithm Table 2


ANSI/ASHRAE Standard factors for thermal comfort.
Input: User Activity Patterns
Factors Description
Output: 𝑃𝑐 , the probability of power consumption
Metabolic rate (met ) The energy generated from human body
1: Update 𝑇𝑎𝑢 for every user ⊳ where 𝑇𝑎𝑢 = Activity Pattern
Clothing insulation (clo) The amount of thermal insulation
2: Compute 𝑇𝑠𝑢 for every user ⊳ where 𝑇𝑠𝑢 = State Transition Matrix for user
person is wearing
u Radiant temperature The weighted average of all temperatures
3: while 𝑡 ∈ 𝜏 do ⊳ where 𝜏 = peak hours duration from surfaces surrounding an occupant
4: for each user 𝑢 in 𝑈 do Air velocity Rate of air movement given distance over
5: 𝑠𝑢 (𝑡) = 𝑠𝑢 (𝑡 − 1) × 𝑇𝑠𝑢 ; ⊳ Eq. (3) time
6: end for Relative humidity Percentage of water vapor in the air

7: 𝑃𝑎𝑙𝑙−𝑎𝑏𝑠𝑒𝑛𝑡 = 𝑢∈𝑈 𝑃0𝑢 (𝑡) ⊳ Eq. (4)

8: 𝑃𝑎𝑙𝑙−𝑎𝑠𝑙𝑒𝑒𝑝 = 𝑢∈𝑈 𝑃1𝑢 (𝑡) ⊳ Eq. (5)

9: 𝑃1+ℎ𝑦𝑝𝑒𝑟𝑎𝑐𝑡𝑖𝑣𝑒 = 1 − 𝑢∈𝑈 (1 − 𝑃3𝑢 (𝑡)) ⊳ Eq. (6)
∏ the user behavior and power consumption of a smart home in near
10: 𝑃1+𝑎𝑐𝑡𝑖𝑣𝑒 = 1 − 𝑢∈𝑈 (1 − 𝑃2𝑢 (𝑡)) ⊳ Eq. (7)
11: 𝑡++ future. Next, we present a novel algorithm which uses the output of
12: end while Algorithm 1 to reduce electricity cost while ensuring appropriate user
13: Compute average probability of each combination over all timeslots comfort.
considering the probabilities computed in lines 7-10
14: Using the average probabilities, estimate the probability of power 4. Prediction and feedback based proactive energy management
consumption 𝑃𝑐 at each level algorithm
15: return 𝑃𝑐
In this Section, we present our PF-PEC algorithm that ensures
reduction of appliances over-usage in a smart home during peak load
hours, i.e., when electricity cost is typically higher than the normal
3.2. Energy consumption modeling algorithm
rates. Considering an appliance activity is schedulable, the proposed
algorithm schedules the activity from peak load hours to non-peak
In this section, we present our energy consumption modeling al-
gorithm (see Algorithm 1) which leverages the model proposed in hours without affecting the users’ comfort level. It does so if there is
Section 3.1. The algorithm employs the probabilities computed in a strong prediction of appliance(s) usage in a peak load hour. In a
Eqs. (4)–(7) to estimate the energy consumption. This estimated con- smart home, the above mentioned scheduling is achieved by scaling the
sumption can then be used to operate appliances in an optimal way various thresholds of appliances up and down. A threshold is the partic-
to save energy. The probabilities are only computed for peak load ular value of any environmental factor such as temperature, humidity,
hours during which the electricity is relatively costly. Afterwards, the etc., which determines the switch-on or switch-off operation(s) of the
estimated probabilities of high power consumption are fed to another corresponding appliance(s). Hence, a change in the threshold value
algorithm (Algorithm 2 to be presented in Section 4) which controls implies that the operation of the appliance can be advanced or delayed.
the operation of appliances. Next, we present the details of Algorithm While, a change in threshold value of an appliance is dependent upon
1. its current as well as future probabilities of certain amount of power-
Algorithm 1 takes the user state transitions as an input and returns consumption. Some other parameters are also incorporated to avoid any
the probability of power consumption at future timestamps. Specifi- compromise on user comfort.
cally, given different ranges of power consumption (e.g., low, medium,
high), the algorithm returns, for each range, the probability that the 4.1. Calibration of threshold ranges on a common scale
power consumption in future timeslots will be within this range. Firstly,
the algorithm takes user activity pattern of each user 𝑢 (denoted by 𝑇𝑎𝑢 ) To propose a single energy saving algorithm for all home appliances,
and computes the state transition matrix of the user (denoted as 𝑇𝑠𝑢 ). It it is necessary to calibrate environmental parameters on a common
is worth mentioning that the feedback from Algorithm 2 continuously scale. These parameters are measured in frequently used units, i.e. tem-
updates the vector 𝑇𝑎𝑢 for each user (line 1) to take into consideration perature is measured in degree Celsius (◦ C), luminance is measured
any update in the user activity pattern, thus, 𝑇𝑠𝑢 is recomputed for every in 𝑙𝑢𝑥 and humidity is measured in percentage. To calibrate the tem-
user accordingly (line 2). Then, the algorithm iterates through each perature thresholds, ANSI/ASHRAE Standard 55 [41] is considered.
time slot 𝑡 in the desired duration for which energy consumption needs This standard provides minimum requirements for acceptable thermal
to be predicted (line 3). In our implementation, we use the algorithm indoor environment conditions. It establishes the acceptable ranges
to estimate energy consumption only during the peak hours 𝜏. In each of environmental parameters to achieve optimal comfort for smart
iteration, the algorithm first updates the user state probability matrix homes users. The thermal comfort is achieved by controlling the factors
𝑠𝑢 (𝑡) for each user 𝑢 using Eq. (3) (line 5). Then, the state probability mentioned in Table 2.
matrices of the users are used to compute the probabilities of different According to ANSI/ASHRAE Standard 55, the range of Predicted
combinations using Eqs. (4)–(7) as described earlier (lines 7 to 10). In Mean Vote (PMV) for thermal comfort is −0.5 to 0.5 [42]. To make
each iteration, for each 𝑡, these probabilities are computed and stored the computations easy, some factors are assumed constant for particular
in an array to be used when the while loop terminates. Specifically, environmental conditions. A constant value of 1 is assumed for clothing
the algorithm uses the stored probabilities for each 𝑡 and computes the level, which considers that the user is wearing a light business suit.
average probability of each combination over all timestamps (line 13). Similarly, relative humidity is assumed to be 25% while the radiant
Based on these probabilities, the algorithm then estimates the proba- temperature is 25 ◦ C.
bility of power consumption at each level 𝑃𝑐 (line 14). For example,
if 𝑃1+ℎ𝑦𝑝𝑒𝑟𝑎𝑐𝑡𝑖𝑣𝑒 is quite high for each timeslot 𝑡 (there is at least one 4.2. PF-PEC algorithm operations
hyperactive user), then the algorithm will return a high probability
of the power consumption to be within the high range. Finally, the Algorithm 2 outlines the pseudocode of PF-PEC algorithm which
algorithm returns 𝑃𝑐 which is to be used by Algorithm 2 presented in is executed in peak load hours. Peak load hours are denoted using 𝜏,
the next section. and 𝑃𝑐 represents the probability of power consumption obtained from
Tables 3a and 3b in Section 6 show the output of Algorithm 1 when Algorithm 1. The parameter 𝑃 𝑀𝑉𝑥 is initialized to 0, which represents
deployed in our real-world testbed. This data can be used in predicting the Predicted Mean Vote (PMV) of user comfort for an appliance 𝑥

5
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

Table 3a
Probabilities of specified energy consumption obtained from Algorithm (1).
KWh ranges Time slots
8am–9am 9am–10am 10am–11am 11am–12pm 12pm–1pm 1pm–2pm 2pm–3pm 3pm–4pm
Probability of power 0.01–0.02 0 0.0003 0.0006 0.0007 0.0007 0.0007 0.0007 0.0007
consumption in 0.05–3.025 0.11 0.1639 0.1878 0.1983 0.2029 0.2048 0.2057 0.2060
KWh ranges 0.01–0.03 0.6875 0.5673 0.5143 0.4880 0.4741 0.4664 0.4620 0.4595
0.02–0.04 0.0391 0.0454 0.0452 0.0441 0.0431 0.0424 0.0420 0.0417
0.02–0.03 0.3129 0.3996 0.4308 0.4450 0.4525 0.4567 0.4590 0.4602
Actual Energy Practical 0.01 0.05 0.02 0.04 0.01 0.04 0.01 0.01
Consumed (KWh)

Table 3b
Probabilities of specified energy consumption obtained from Algorithm (1).
KWh ranges Time slots
4pm–5pm 5pm–6pm 6pm–7pm 7pm–8pm 8pm–9pm 9pm–10pm 10pm–11pm 11pm–12am
Probability of power 0.01–0.02 0 0.0012 0.0011 0.0009 0.0008 0.0007 0.0007 0.0007
consumption in 0.05–3.025 0.6 0.3819 0.2838 0.2405 0.2215 0.2130 0.2093 0.2076
KWh ranges 0.01–0.03 0.8250 0.6693 0.5702 0.5148 0.4895 0.4713 0.4640 0.4603
0.02–0.04 0.1250 0.0935 0.0677 0.0540 0.0473 0.0441 0.0426 0.0420
0.02–0.03 0.1200 0.2620 0.3559 0.4087 0.4360 0.4494 0.4559 0.4589
Actual Energy Practical 0.027 0.03 0.06 0.05 0.04 0.03 0.01 0.01
Consumed (KWh)

(line 1). The algorithm iterates a while loop for the desired peak hours usage in the house. The greater the probability, farther will be the new
duration (line 2). In each iteration, the algorithm computes 𝑃 𝑀𝑉𝑥 for threshold. Algorithm 2 also takes into account the difference between
each appliance 𝑥 (line 3) and its corresponding thresholds (i.e. 𝑇𝑃𝑥𝑀𝑉 ) user-defined threshold and minimum threshold required for human
in a given environment (line 4). Afterwards, it computes the overall comfort. If this gap is greater, user threshold moves faster to minimum
load of appliances in on-state at time 𝑡 (line 5) along with the user- value (𝑇𝑃𝑥𝑀𝑉 ). As this difference decreases, pace of threshold towards
state based on the computed load (line 6). Then, the algorithm passes minimum value slows down. The reduction in user threshold eventually
the user-states to Algorithm 1 that returns 𝑃𝐶 (line 7), which is used
results in more energy saving.
to get average probability of consuming maximum power in remaining
It is noteworthy that Algorithm 1 is also invoked in Algorithm 2 by
peak load hours. Next, appliances in on-state are selected (line 8). For
each selected appliance (line 9), the algorithm first obtains the user- passing user-states at time slot 𝑡 which actually works as a feedback to
defined on-off threshold 𝑇𝑢𝑥 for the appliance (line 10). The subsequent the Algorithm 1. This feedback is necessary because the user activity
steps (lines 11 to line 13), are executed for these appliances if the user patterns may change with time according to change in environment
defined threshold 𝑇𝑢𝑥 is greater than the threshold of human comfort or circumstances. Hence, there is a need to estimate user states for
𝑇𝑃𝑥𝑀𝑉 for the appliance 𝑥. Therein, it computes the difference (denoted current timeslot 𝑡. This makes system adaptable to the changes in user
by 𝛥) between the user-defined threshold (𝑇𝑢𝑥 ) and minimum threshold activities. A user state is thus estimated at run time based on the
required for human comfort (𝑇𝑃𝑥𝑀𝑉 ) (line 12). The threshold value 𝑇𝑢𝑥 type and number of appliances in on-state and their power consump-
is updated based on this difference (𝛥) (line 13). tion at a certain time slot. This user state is accurately determined
using the real data obtained from the smart home. This estimated
Algorithm 2 : PF-PEC Algorithm user state is then considered by Algorithm 1 which re-computes the
Input: Human comfort constraints and parameters, 𝜏; peak hours duration probabilities according to this new data to achieve more precise results.
Output: 𝑃 𝑀𝑉𝑥 , 𝑇𝑢𝑥 , 𝑇𝑃𝑥𝑀𝑉 One immediate benefit of this feedback is that it somewhat solves the
1: 𝑃 𝑀𝑉𝑥 ← 0 convergence problem of Markov chain process. As the data set on which
2: while 𝑡 ∈ 𝜏 do Markov chain process operates changes consistently due to feedback,
3: Compute 𝑃 𝑀𝑉𝑥 for all type of loads the results produced by Markov chain process now converge after a
4: Compute 𝑇𝑃𝑥𝑀𝑉 for all type of loads longer period. Another advantage of enabling feedback in the system
5: Compute load in on-state at 𝑡
is achieving higher accuracy of the produced results. One drawback of
6: Find user state from computed load
7: Invoke Algorithm 1 and save value of 𝑃𝑐 this feedback however, is that the system has to perform more number
8: 𝐴 ← Appliances in on-state at 𝑡 of computations. A visual description of this feedback mechanism is
9: for each appliance 𝑥 in 𝐴 do shown in Fig. 2.
10: Obtain user defined on-off thresholds (𝑇𝑢𝑥 ) of the appliance To carry out all the above stated operations efficiently as well as
11: if 𝑇𝑢𝑥 > 𝑇𝑃𝑥𝑀𝑉 then ; effectively, a fog-based architecture for IoT enabled HAS system is
12: 𝛥 = 𝑇𝑢𝑥 − 𝑇𝑃𝑥𝑀𝑉
designed such that the data about usage of appliances is seamlessly
13: 𝑇𝑢𝑥 = 𝑇𝑢𝑥 + 𝑃𝑐 × 𝛥
fetched to the cloud. A database is maintained at the cloud to save
14: end if
15: end for various forms of data sent by the appliances of a smart home. An appli-
16: 𝑡++ cation running on the IoT cloud thereby computes appliance usage time
17: end while for each user. Using this appliance-usage time, user states at different
18: return time slots are computed and fed back to the Markov chain process.
Hence, analyzing appliance usage data at cloud helps in predicting
In this way, the algorithm iteratively changes the threshold set user’s current state in real-time which will then update the user activity
for different appliances in peak load hours without compromising on data. Markov chain is then applied on this latest user activity data to
human comfort. Moving the threshold away actually delays the switch- arrive at new state transitions and this process repeats for every next
on event of appliances based on the average probability (𝑃𝑐 ) of energy time slot.

6
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

also provided within these modules to achieve better decision making


while forwarding the sensed information. These features are incorpo-
rated with reasonably smaller footprint to fulfill the requirements of
an intelligent sensor module for our fog based IoT architecture which
is illustrated in Fig. 3 along with a snapshot of sensor module.

5.2. Actuation

To enable smart actuation of appliances, an actuation module is


designed to replace existing switch outlets in conventional and smart
homes. The specifications of microcontroller used in actuation module
are similar to that of sensor modules. A Wi-Fi SoC is available for wire-
less connectivity. There can be multiple switches in a single actuation
module. TRIACS are used as control switches and relays are included
to cater for high load appliances. The major messages communicated
through actuation modules are about the operation of appliances. These
messages are translated into device on-off operations, fan(s) speed con-
trol, lamp dimmers, temperature settings of AC/heaters, etc. To ensure
synchronization, devices respond with acknowledgment messages upon
each actuation. The module constantly publishes its switches states via
wireless link to local server to facilitate the ML and data analytics
techniques. Actuation module snapshot is shown in Fig. 3.

5.3. IoT fog node


Fig. 2. Feedback mechanism of Algorithm 2.

A large number of sensing and actuation modules are mostly in-


stalled in a smart home. To maintain the connectivity of each module
5. Our proposed fog-based architecture and a real-world testbed with IoT cloud can be expensive in terms of resources. There is a need of
for smart homes IoT fog node that can maintain connection with the cloud while acting
as an edge device for sensor and actuation modules. It enables these
In this section, we provide architectural details of the smart home end-devices to log their data at local server and then to report it to the
that we use as a test bed. A fog based IoT architecture for smart cloud. Some of the benefits of fog node include low latency, network
homes is presented to realize the implementation of proposed energy scalability, and heterogeneity [43].
optimization algorithms in a smart home environment. The efficacy of The functional architecture of our IoT fog node is depicted in Fig. 4.
any smart home can get restrained depending upon its architecture. It operates in two distinct modes, i.e. an online mode and an offline
Traditionally, a HAS system may under-perform due to the limitations mode. The offline mode ensures that appliances can be used within
of underlying technology while the technology can itself under-achieve the local network when Internet connectivity is not available, and
if the hardware and/or software platforms are not chosen appropri- also synchronizes the appliances’ states with the cloud when Internet
ately. IoT offers various innovative features in HAS systems such as low connectivity is available again. The synchronization module period-
complexity, power efficiency, small footprint and less communication ically performs this synchronization and also ensures that the sync
intensive connections to the Internet. Another critical attribute that IoT time is not much significant as compared to user lag faced, or latency
brings to the table is data dissemination. However, this data dissem- introduced by removing the fog node. Whenever a user sets his/her
ination is relatively weak in conventional smart home architectures preferences, it is made sure that those preferences are saved in both
and resultantly the useful data or its timely relevance gets lost usually. the local database on fog node and the database on the cloud. It
Hence, it is imperative to develop a fog based IoT architecture to makes the appliances directly controllable from fog node based on
incorporate favorable techniques such as data analytics and machine the defined user preferences. Moreover, fog node is equipped with
learning (ML) to enhance the capabilities of a smart home. A novel fog various constrained protocols in its communication stack. At applica-
based IoT architecture for smart homes is therefore proposed to better tion layer, it communicates with sensors and actuators using Message
utilize the algorithms for energy demand prediction and conservation Queuing Telemetry Transport (MQTT) protocol. To enable user defined
as presented in previous Sections. There are four main building blocks intelligence in appliances, a local intelligence module is defined. In
of proposed architecture, i.e. Sensing and Data Acquisition, Actuations, addition, a specific service is responsible for data dissemination among
Fog/Edge Node and Cloud. Each of these network entities have some different application programming interfaces (APIs) running on IoT fog
predefined operating principles and standard protocols. This Section node. Device identification and device/user authentication services are
constitutes the functional and architectural details of these entities. also included. At transport layer, Transmission Control Protocol (TCP)
is used along with Secure Socket Layer (SSL) for reliable and secure
5.1. Sensing and data acquisition connectivity of devices with the cloud. Other services including Secure
Shell (SSH), Secure File Transfer Protocol (SFTP), Web and Android
Sensor modules are designed for data acquisition that resides multi- APIs are implemented to access the fog node for configuration purposes.
ple sensors. The microcontroller used in these modules contains 8kB of The proposed fog node is implemented using Raspberry Pi 4, shown
RAM and 16 channel 12 bit ADCs which makes it suitable for sensing in Fig. 3, which has a quad core processor with 1 GB RAM, Ethernet,
modules. For wireless connectivity, state of the art Wi-Fi System-on- USB ports and Wi-Fi making it suitable for fog node. The proposed
Chip (SoC) is used. To make the operation of sensor module energy fog node has rich resources that have the capability to manage all the
efficient, they are equipped with 5 Volt batteries along with electrical end nodes in a single smart home setup. It simplifies the management
power lines as the backup. To attain further energy efficiency, the of data from multiple smart homes on the cloud i.e., single fog node
sensor modules are also capable of duty cycling while their processor is per smart home setup. Moreover, it enables the smooth operation of
capable of going into deep sleep mode. Some front-end intelligence is fog nodes due to reduced network overloading. There are two limiting

7
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

Fig. 3. Proposed fog based IoT architecture for smart home.

Customized Android and Web APIs are designed to enable flexible


control over appliances in a smart home. A monitoring module is re-
sponsible for generating alerts/warnings. FTP, SFTP and SSH protocols
are also employed.

5.5. Real-world scenario to operate the test bed

The experiments are conducted on a real-world smart home system.


We leverage the proposed system architecture presented in this section
to implement a smart home system. A fog node, two sensor nodes and
one actuation module is used in the test bed. The implemented smart
home system is connected to the cloud being implemented using the ar-
chitecture proposed in Fig. 5. It is worth mentioning that the deployed
system have a centralized database in which the on-off thresholds of
appliances are saved. These thresholds are set by the corresponding
users. These thresholds are used by our proposed algorithms to operate
the appliances accordingly. Algorithms 1 and 2 are deployed on the
Fig. 4. Functional architecture of fog node. cloud. The outcome of Algorithm 2 is used to send commands to the
fog node to operate the appliances accordingly.
The energy consumption model is validated by the experiments
factors in the operation of the proposed fog node: the range of the Wi- conducted in a 1125 square feet home with 3 occupants. It is a multi-
Fi and the number of requests that can be entertained simultaneously. story dwelling located in Lahore. Eight spots in the home are identified
Wi-Fi repeaters can be installed in relatively bigger and multi-story for system deployment. The experiments are conducted during spring
dwellings to enhance the range. Simultaneous requests in a fog node season. All the occupants have different daily routines. First is a part-
can be entertained by using threads. However, increasing the number of time worker, second is a housewife and third one is a retired person
threads overload the fog node and creates a lag in fulfilling the requests. who normally stays at home. The results are taken from morning (8am)
In the proposed fog node, a high number of requests can be entertained to midnight (12am).
simultaneously because we are using a high-end device.
6. Experiments and results
5.4. IoT cloud
In this Section, the performance analysis of proposed algorithms is
Our smart home architecture includes customized implementation presented. Firstly, the prediction results of energy consumption estima-
of IoT cloud whose functional diagram is shown in Fig. 5. The IoT cloud tion model (Algorithm 1) are discussed followed by the evaluation of
is equipped with multiple services and plug-ins to facilitate interaction proposed PF-PEC (Algorithm 2) which reduces the energy consumption
with fog node, users and developers. TCP/IP stack is incorporated of a smart home. The probability distribution of a particular user in
to provide connection oriented services together with SSL for secure different states at each time slot is shown in Fig. 6. It should be noted
communication. Our Algorithm 1 and Algorithm 2 are implemented in that our model includes all the appliances in use within a home.
the cloud within Machine Learning module. Data dissemination layer The numerical results are illustrated in Table 3a and 3b. In that
is integrated to classify the data reported from appliances as well respect, different KWh ranges are specified that corresponds to the
as sensor devices and to disseminate it to concerned services before potential combination of outcomes considered by Algorithm 1. The
saving into database. A copy of database is continuously replicated predicted power consumption is provided in terms of the probability
to another Virtual Machine (VM) in the cloud to incorporate ML and of consuming energy in a particular KWh range for different time slots.
data analytics techniques without compromising the original data re- The values in Table 3a and 3b are not specific to a single user. These
ported from appliances. Relaying service is responsible to entertain the probabilistic values represent the likelihood of all users cumulatively
service-accessibility requests for a specific device originated from users. consuming a certain power. The real energy consumed (KWh) at each

8
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

Fig. 5. Functional architecture of IoT cloud.

Fig. 6. Example of probability distribution of single user in four states.

Fig. 7. Comparison between actual and predicted energy consumption.

time slot is also reported in the table and can be compared with the probability. Similarly, for other time slots, the results obtained from
KWh range of highest probability event. For example, in 3a for time our energy consumption prediction model in terms of KWh ranges and
slot 8am–9am, the actual energy consumed is 0.01 KWh whereas the their corresponding probabilities fairly match with that of actual energy
corresponding predicted KWh range, i.e. 0.01–0.03, has the highest consumption of the smart home. In Fig. 7, the percentage similarity

9
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

Table 4
Results of PF-PEC Algorithm (2), lights and fan readings.
Days Manual Smart Smart + PF-PEC Algorithm
Light 1 Light 2 Fan Light 1 Light 2 Fan Light 1 Light 2 Fan
Monday 6 h,3 m,9 s 6 h,3 m,9 s 6 h,3 m 5 h,49 m 5 h,49 m 5 h,58 m 4 h,54 m 4 h,54 m 5 h,45 m
Tuesday 6 h,42 m 6 h,42 m 6 h,42 m 6 h 6 h 6 h 4 h,1 m 3 h,51 m 5 h,46 m
Wednesday 7 h,32 m 7 h,32 m 7 h,32 m 5 h,50 m 5 h,50 m 6 h,1 m 3 h,18 m 1 h,18 m 5 h,37 m
Thursday 6 h,49 m 6 h,49 m 6 h,49 m 6 h,27 m 6 h,27 m 6 h,38 m 3 h,35 m 35 m 6 h,22 m
Friday 7 h,5 m 7 h,5 m 7 h,5 m 5 h,33 m 5 h,33 m 7 h,5 m 3 h56 m 6 m 6 h,48 m

Fig. 8. Mean Absolute Error results to determine prediction accuracy.

of predicted energy consumption with that of actual is shown on 𝑦-


axis and the events probabilities are shown on 𝑥-axis. This similarity
measure is simply the percentage number of predictions matching with
actual power consumption. It shows that the highest probability events
in 3a and 3b have more chances to correctly predict the actual energy
usage which in turn means that the actual energy consumed have
more chances of falling in the KWh range of highest probability event.
These chances gradually decrease if we move towards lower probability
events. As the user states are defined on the basis of their appliances us-
age and number of appliances installed at home are pre-known, so KWh
ranges are calculated using the information from feedback mechanism
about user activity and the amount of load active at that time. So, user
survey and feedback data helps to estimate the KWh range against each
useful combination of user activity states which are aforementioned in
Section 3. Thus, Fig. 7 demonstrates that actual energy consumption
is very much closer to the highest probability event predicted by the
model. Moreover, to validate the predicted results, Mean Absolute Error
(MAE) is used as an evaluation criteria as shown in Fig. 8. It is evident
that Mean Absolute Error for highest probability event (also mentioned
in Fig. 7) is least whereas its value increases as we move towards lower Fig. 9. Comparison of PF-PEC algorithm with baseline and simple smart home.
probability events. More specifically, MAE for highest probability event
is only 0.008 which shows the accuracy of prediction algorithm.
Algorithm 2 is tested in a different scenario as compared to Al-
remained in on-state. These results validate that the PF-PEC algorithm
gorithm 1. The performance of PF-PEC algorithm is validated in an
further reduces energy consumption of a smart home. Fig. 9 graphically
office equipped two lights, one fan and an AC, with a single occu-
pant from 9:00am to 5:00pm for five working days. The light and demonstrates these energy consumption in three different scenarios,
temperature sensors are installed on the walls and accordingly PMVs i.e. manual home (normal operations with manual switches), smart
for human comfort are calculated. Initially, Algorithm 1 is applied home (occupancy, temperature and luminance based intelligence), and
on user activity data and probabilities are generated against power smart home with PF-PEC algorithm. It can be visualized that appliances
consumption. Afterwards, Algorithm 2 is applied on this data to op- usage decreases further when we simultaneously apply smartness and
timize the appliances’ usage in peak load hours. The experimental PF-PEC algorithm. Additional analysis determines that Light 2 and fan
results are considered for a duration of one week as shown in Ta- usage timings are reduced further after applying PF-PEC algorithm.
ble 4. It shows the daily time period for which both lights and a fan This reduction in Light 2 usage is essentially due to the fact that only

10
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

Fig. 10. Event response time results with and without fog node.

Fig. 11. Comparison of our architecture with EHOPES fog platform.

one light serves the purpose according to the visual comfort threshold Finally, the percentage energy conservation corresponding to dif-
of the user. ferent PMVs is shown in Fig. 12. It provides the comparison of PF-PEC
Fig. 10 shows the performance comparison of monitoring results algorithm with M-CHESS algorithm proposed recently [37]. Therein,
with and without fog node in terms of average response time of the authors reduced the energy consumption of smart home consid-
different independent events along with their corresponding energy ering various human comfort thresholds. In particular, the M-CHESS
consumption. Therein, a single event is defined by ‘a message commu- algorithm sacrifices the human comfort to attain higher energy savings.
nicated by sensor/actuation module to the cloud or fog node with a Thus, as shown in Fig. 12, the M-CHESS algorithm achieves energy
specific payload size, number of MYSQL queries executed and messages conservation up to 33.7% with human comfort threshold of 1.0 which is
exchanged with other applications at the cloud or fog node, and finally increased to 38.6% by further compromising human comfort threshold
to 1.5. On the contrary, PF-PEC provides the energy conservation up
sending back an acknowledgment (ACK) which completes an event
to 36% while achieving the human comfort threshold of 0.5 as per the
cycle’. It can be visualized that the average event response time and
ASHRAE standard. Therefore, the M-CHESS algorithm though flexibly
corresponding energy consumption is remarkably reduced with the
change the human comfort range to attain more energy conservation.
introduction of fog node in smart home architecture.
However, the average energy savings achieved by PF-PEC algorithm
Similarly, in Fig. 11 we compare the latency results calculated with for a similar value of PMV is always higher than that of M-CHESS
our proposed architecture with the average latency results achieved algorithm. Hence, our PF-PEC algorithm improves the human comfort
with another fog architecture based platform for smart environments, as well as energy savings in a smart home.
termed as EHOPES [36]. It can be seen that the average latency results
in our case are reasonably better than the latency results attained with 7. Conclusion
that of EHOPES platform. These improvements are achieved due to
the modular implementation of architectural functionalities of fog node The paper presents energy management and optimization tech-
and its seamless interaction with cloud architecture. niques to minimize energy consumption in smart dwellings. A Markov

11
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

[6] Adia Khalid, Nadeem Javaid, Mohsen Guizani, Musaed Alhussein, Khursheed Au-
rangzeb, Manzoor Ilahi, Towards dynamic coordination among home appliances
using multi-objective energy optimization for demand side management in smart
buildings, IEEE Access 6 (2018) 19509–19529.
[7] Minyoung Sung, Younghoo Ko, Machine-learning-integrated load scheduling for
reduced peak power demand, IEEE Trans. Consum. Electron. 61 (2) (2015)
167–174.
[8] Zhaoxuan Li, Bing Dong, A new modeling approach for short-term prediction of
occupancy in residential buildings, Build. Environ. 121 (2017) 277–290.
[9] João Virote, Rui Neves-Silva, Stochastic models for building energy prediction
based on occupant behavior assessment, Energy Build. 53 (2012) 183–193.
[10] Eoghan McKenna, Michal Krawczynski, Murray Thomson, Four-state domestic
building occupancy model for energy demand simulations, Energy Build. 96
(2015) 30–39.
[11] Zhengen Ren et al., A model for predicting household end-use energy consump-
tion and greenhouse gas emissions in Australia, Int. J. Sustain. Build. Technol.
Urban Dev. 4 (3) (2013) 210–228.
[12] Manisa Pipattanasomporn, Murat Kuzlu, Saifur Rahman, An algorithm for in-
telligent home energy management and demand response analysis, IEEE Trans.
Smart Grid 3 (4) (2012) 2166–2173.
Fig. 12. PF-PEC algorithm comparison with an energy saving scheme (M-CHESS) that [13] A.D. Wills, Ian Beausoleil-Morrison, V.I. Ugursal, Adaptation and validation of an
considers standard human comfort level. existing bottom-up model for simulating temporal and inter-dwelling variations
of residential appliance and lighting demands, J. Build. Perform. Simul. 11 (3)
(2018) 350–368.
[14] Zhun Yu, et al., A systematic procedure to study the influence of occu-
chain model is proposed to compute probabilities of power consump- pant behavior on building energy consumption, Energy Build. 43 (6) (2011)
tion in different time slots. This data set is leveraged by our prediction 1409–1417.
and feedback based energy management algorithm which minimizes [15] Edouard Amouroux, Thomas Huraux, François Sempé, Nicolas Sabouret,
energy consumption during peak load hours. To efficiently incorpo- Yvon Haradji, Simulating human activities to investigate household energy
consumption, in: ICAART (2), 2013, pp. 71–80.
rate the proposed algorithms in a real world scenario, a fog based
[16] Biying Yu, Junyi Zhang, Akimasa Fujiwara, A household time-use and energy-
IoT architecture is implemented. Experimental evaluations are con- consumption model with multiple behavioral interactions and zero consumption,
ducted in a home having 3 occupants. Experiments reveal that the Environ. Plan. B: Plann. Des. 40 (2) (2013) 330–349.
forecasted energy estimates are very close to actual energy consumed [17] Brandon Johnson, et al., A method for modeling household occupant behavior to
within home. Moreover, it is observed that the energy consumption and simulate residential energy consumption, in: Innovative Smart Grid Technologies
Conference (ISGT), IEEE PES, IEEE, 2014, pp. 1–5.
electricity costs are significantly reduced without degrading standard
[18] Shaoen Wu, et al., Survey on prediction algorithms in smart homes, IEEE Internet
human comfort. We consider that this work can be instrumental for Things J. (2017).
employing proactive and precise demand side management in future [19] Paul A Gagniuc, Markov Chains: From Theory to Implementation and
energy systems. Experimentation, John Wiley & Sons, 2017.
[20] José Luis Ramírez-Mendiola, Philipp Grünewald, Nick Eyre, Residential activity
pattern modelling through stochastic chains of variable memory length, Appl.
CRediT authorship contribution statement Energy 237 (2019) 417–430.
[21] Muhammad Umair, Ghalib A. Shah, Energy management of smart homes, in:
Muhammad Umair: Conceptualization, Methodology, Software, 2020 IEEE International Conference on Smart Computing, SMARTCOMP, IEEE,
2020, pp. 247–249.
Validation, Formal analysis, Investigation, Writing – original draft,
[22] Cristian Chiñas-Palacios, Jesus Aguila-Leon, Carlos Vargas-Salgado, Edith X.M.
Visualization, Resources. Muhammad Aamir Cheema: Methodology, Garcia, Julian Sotelo-Castañon, Elías Hurtado-Perez, A smart residential security
Data curation, Writing – review & editing, Supervision, Visualization, assisted load management system using hybrid cryptography, Sustain. Comput.
Investigation. Bilal Afzal: Writing – original draft, Writing – review & Inform. Syst. 32 (2021) 100611.
editing, Supervision, Visualization. Ghalib Shah: Writing - Review & [23] Israr Ullah, Rashid Ahmad, DoHyeun Kim, A prediction mechanism of energy
consumption in residential buildings using hidden markov model, Energies 11
Editing, Supervision, Visualization, Project administration.
(2) (2018) 358.
[24] Djamel Saba, Youcef Sahli, Abdelkader Hadidi, An ontology based energy
Declaration of competing interest management for smart home, Sustain. Comput. Inform. Syst. 31 (2021) 100591.
[25] Rabiya Khalid, Nadeem Javaid, Muhammad Hassan Rahim, Sheraz Aslam, Arshad
Sher, Fuzzy energy management controller and scheduler for smart homes,
The authors declare that they have no known competing finan- Sustain. Comput. Inform. Syst. 21 (2019) 103–118.
cial interests or personal relationships that could have appeared to [26] Mohamad Razwan Abdul Malek, Nor Azlina Ab Aziz, Salem Alelyani, Mohamed
influence the work reported in this paper. Mohana, Farah Nur Arina Baharudin, Zuwairie Ibrahim, Comfort and energy
consumption optimization in smart homes using bat algorithm with inertia
weight, J. Build. Eng. 47 (2022) 103848.
References [27] Zhipeng Deng, Qingyan Chen, Simulating the impact of occupant behavior on
energy use of HVAC systems by implementing a behavioral artificial neural
[1] Bilal Afzal, Muhammad Umair, Ghalib Asadullah Shah, Ejaz Ahmed, Enabling network model, Energy Build. (2019).
iot platforms for social iot applications: vision, feature mapping, and challenges, [28] Da Yan, Xiaohang Feng, Yuan Jin, Chuang Wang, The evaluation of stochastic
Future Gener. Comput. Syst. 92 (2019) 718–731. occupant behavior models from an application-oriented perspective: Using the
[2] Davit Marikyan, Savvas Papagiannidis, Eleftherios Alamanos, A systematic review lighting behavior model as a case study, Energy Build. 176 (2018) 151–162.
of the smart home literature: A user perspective, Technol. Forecast. Soc. Change [29] Anders Nilsson, Misse Wester, David Lazarevic, Nils Brandt, Smart homes, home
138 (2019) 139–154. energy management systems and real-time feedback: Lessons for influencing
[3] Zahrah A. Almusaylim, Noor Zaman, A review on smart home present state and household energy consumption from a Swedish field study, Energy Build. 179
challenges: linked to context-awareness Internet of Things (IoT), Wirel. Netw. 25 (2018) 15–25.
(6) (2019) 3193–3204. [30] Isabella Gaetani, Pieter-Jan Hoes, Jan L.M. Hensen, Occupant behavior in
[4] A.R. Al-Ali, Imran A. Zualkernan, Mohammed Rashid, Ragini Gupta, Mazin building energy simulation: Towards a fit-for-purpose modeling strategy, Energy
Alikarar, A smart home energy management system using IOT and big data Build. 121 (2016) 188–204.
analytics approach, IEEE Trans. Consum. Electron. 63 (4) (2017) 426–434. [31] Muhammad Umair, Bilal Afzal, Asad Khan, Atiq Ur Rehman, Y. Ahmet Seker-
[5] Jinsoo Han, Chang-Sic Choi, Wan-Ki Park, Ilwoo Lee, Sang-Ha Kim, Smart home cioglu, Ghalib A. Shah, Self-configurable hybrid energy management system for
energy management system including renewable energy based on ZigBee and smart buildings, in: 2018 15th International Conference on Control, Automation,
PLC, IEEE Trans. Consum. Electron. 60 (2) (2014) 198–202. Robotics and Vision, ICARCV, IEEE, 2018, pp. 1241–1246.

12
M. Umair et al. Sustainable Computing: Informatics and Systems 39 (2023) 100898

[32] Muhammad Umair, Muhammad Aamir Cheema, Omer Cheema, Huan Li, Hua Muhammad Aamir Cheema is an ARC Future Fellow,
Lu, Impact of COVID-19 on IoT adoption in healthcare, smart homes, smart an Associate Professor and Director of Research at the
buildings, smart cities, transportation and industrial IoT, Sensors 21 (11) (2021) Department of Software Systems and Cybersecurity, Faculty
3838. of Information Technology, Monash University, Australia.
[33] Mohammad Sadegh Aslanpour, Adel N. Toosi, Muhammad Aamir Cheema, Raj He obtained his PhD from UNSW Australia in 2011. He is
Gaire, Energy-aware resource scheduling for serverless edge computing, in: the recipient of 2012 Malcolm Chaikin Prize for Research
The 22nd IEEE/ACM International Symposium on Cluster, Cloud and Internet Excellence in Engineering, 2013 Discovery Early Career
Computing, CCGrid, 2022. Researcher Award, 2014 Dean’s Award for Excellence in
[34] Mohammad S. Aslanpour, Adel N. Toosi, Raj Gaire, Muhammad Aamir Cheema, Research by an Early Career Researcher, 2018 Future Fel-
WattEdge: A holistic approach for empirical energy measurements in edge lowship, 2018 Monash Student Association Teaching Award
computing, in: International Conference on Service-Oriented Computing, ICSOC, and 2019 Young Tall Poppy Science Award. He has also
2021, pp. 531–547. won two CiSRA best research paper of the year awards,
[35] Junaid Akram, Muhammad Umair, Rutvij H Jhaveri, Muhammad Naveed two invited papers in the special issue of IEEE TKDE on the
Riaz, Haoran Chi, Sharaf Malebary, Chained-drones: blockchain-based privacy- best papers of ICDE, and three best paper awards at ICAPS
preserving framework for secure and intelligent service provisioning in internet 2020, WISE 2013 and ADC 2010, respectively. He is the
of drone things, Comput. Electric. Engrg. 110 (2023) 108772. Associate Editor of IEEE TKDE and DAPD and served as PC
[36] Jianhua Li, Jiong Jin, Dong Yuan, Marimuthu Palaniswami, Klaus Moessner, co-chair for ADC 2015, ADC 2016, 8th ACM SIGSPATIAL
EHOPES: Data-centered fog platform for smart living, in: Telecommunication Workshop ISA 2016 & 2018, IWSC 2017, proceedings chair
Networks and Applications Conference (ITNAC), 2015 International, IEEE, 2015, for DASFAA 2015 & ICDE 2019.
pp. 308–313.
[37] Ching-Hu Lu, et al., Context-aware energy saving system with multiple comfort-
constrained optimization in M2M-based home environment, IEEE Trans. Autom. Bilal Afzal is a graduate from National University of Science
Sci. Eng. 14 (3) (2017) 1400–1414. and Technology, Islamabad, Pakistan. He has worked as
[38] Shivi Sharma, Hemraj Saini, A novel four-tier architecture for delay aware Research Officer and Senior Research Officer at KICS, UET
scheduling and load balancing in fog environment, Sustain. Comput. Inform. Lahore, Pakistan. His research interests include Computer
Syst. 24 (2019) 100355. and Wireless Networks, Internet of Things (IoT), IoT Se-
[39] Nagender Kumar Suryadevara, Energy and latency reductions at the fog gateway curity, and 5G radio technology. He has served as the
using a machine learning classifier, Sustain. Comput. Inform. Syst. 31 (2021) program committee member, co-chair and session manager
100582. in several IEEE conferences. He is regular reviewer of
[40] Daniel Fernando Espejel-Blanco, Jose Antonio Hoyo-Montano, Jaime Arau, many impact factor journals including Elsevier FGCS, JNCA,
Guillermo Valencia-Palomo, Abel Garcia-Barrientos, Hector Ricardo Hernandez- COMPELECENG, SAGE JDSN, IEEE Network Magazine, and
De-Leon, Jorge Luis Camas-Anzueto, HVAC control system using predicted mean IEEE Consumer Electronics Magazine.
vote index for energy savings in buildings, Buildings 12 (1) (2022) 38.
[41] Standard 55-Thermal Environmental Conditions for Human Occupancy, ASHRAE
Dr. Ghalib A. Shah is an IEEE Senior Member, and Pro-
American Society of Heating, Refrigerating and Air-conditioning Engi-
fessor at the Department of Cyber Security, Air University
neers, (ISSN: 1041-2336) 2013, Available: https://www.ashrae.org/resources--
Islamabad. He has worked as a Sultan Qaboos IT Co-Chair at
publications/bookstore/standard-55-and-user-s-manual.
UET Lahore. He joined Al-Khawarizmi Institute of Computer
[42] Jermy Thomas, Tiffany Swenson, Amanda D Smith, Quantifying the importance
Science, UET Lahore in 2012 and established Internet of
of measured metabolic rates and clothing levels for effectively using a predicted
Things (IoT) Lab, where he received many research grants
mean vote model: A global sensitivity analysis, ASHRAE Trans. 125 (2019).
from HEC and ICT R & D Fund and several projects are
[43] Mohammad Aazam, Sherali Zeadally, Khaled A Harras, Deploying fog computing
in progress at this Lab. He also received a research grant
in industrial Internet of Things and Industry 4.0, IEEE Trans. Ind. Inform. (2018).
for Cyber Security in IoT and is working on many projects.
He actively works in the area of communication protocols
and cyber security in IoT. Dr. Shah started his academic
career at College of EME, National University of Sciences
Muhammad Umair is a PhD student at the School of and Technology Islamabad as an Assistant Professor in 2007
Computer Science, The University of Sydney. He is also and served for three years. He has been at the School of
a Lecturer at the Department of Electrical, Electronics and Computer Science, Australian National University as a visit-
Telecommunication Engineering, New Campus, UET Lahore. ing research fellow during 2009-10. He then joined the Next
He completed his B.Sc. Electrical Engineering and M.Sc. Generation Wireless Networks Lab, Koc University, Istanbul
Electrical Engineering from University of Engineering and as a Research fellow and produced significant research
Technology (UET) Lahore in 2014 and 2017, respectively. publications in the area of cognitive radio sensor networks.
He has worked as a Research Officer at Internet of Things Dr Shah received his B.Sc. major Math and M.Sc degree
(IoT) lab at Al-Khwarizmi Institute of Computer Sciences, in Computer Science from Bahauddin Zakariya University
UET Lahore. He has also worked at Sultan Qaboos IT Multan, Pakistan in 1997 and 2000 respectively and PhD
Research lab as a Research Officer. His survey on Social degree in computer engineering from Middle East Technical
IoT platforms is the most cited survey for SIoT applications. University, Ankara Turkey in January 2007.
He has designed graduate level courses on IoT. His areas of
interests include Internet of Things, Embedded Systems, Net-
work Systems, Machine Learning, Algorithms Development,
Pervasive Computing, Ubiquitous Computing, Cloud Based
Systems, Data Analytics and working on application layer
of any of the defined problems.

13

You might also like