You are on page 1of 5

A Smart Home system using Artificial Intelligence and

integration with Energy Storage and Microgeneration


Alisson Trindade Souza and Rafael Gressler Milbradt, Christian Tiago Augusto Silva Santana
Luciane Neves Canha Luã Lemos and Cássio Michels Smart Grid Superintendency and
CEESP – Center of Excellence in Polytechnic College Special Projects
Energy and Power Systems Federal University of Santa Maria COPEL Curitiba, Brazil
Federal University of Santa Maria Santa Maria, Brazil Email: tiago.santana@copel.com
Santa Maria, Brazil Email: rmilbradt@gmail.com,
Email: alissontsouza@hotmail.com christianlualemosc@hotmail.com and
and lucianecanha@ufsm.br cassiomichels@gmail.com

Abstract—The Smart Grids environments tend to bring more to react to the fluctuating daily electricity prices. This is called
freedom and motivation to residential users become producer of automated demand response (ADR) [1]. An alternative to seek
electrical energy, however the increase of distributed generation ADR is the Smart Homes systems.
systems can bring important concerns to utility companies, such
as the electrical energy two-way flow. Demand response (DR) Smart Homes can play a key role in smart power
programs support the companies to provide better planning management, with the ability to perform intelligent demand
actions for the grid and encourage residential users to shift your response actions automatically. Smart home is one of the
behaviors of use residential loads. However it tends to be applications of smart technologies in residential buildings that
difficult to users make different actions along the day. Thinking can provide opportunities for improved energy management,
about this, Smart Home systems can carry out intelligent DR energy saving, reduced energy consumption, reduced
actions automatically in order to reduce energy consumption of greenhouse gas emissions, and improved home automation
users. The present work aims to provide a system that applies [2]. Systems called Home Energy Management System
artificial intelligence methods and concepts of Internet of Things (HEMS) can assist to reduce overall energy consumption by
to manage residential lighting loads and HVAC systems. optimal residential load scheduling of appliances and allowing
Monitored residential environmental data, power generation achieving various goals and functions inside the homes such
and status of battery management system are used in the as automatic control, shifting or curtailing the demand
decision-making process.
consumption [3].
Index Terms—Artificial intelligence, Demand response, HVAC Smart Home uses concepts of home automation and
systems, Internet of things, Smart home. Internet of Things (IoT). The IoT is a new paradigm that
emerged in order to integrate and connect objects like sensors,
I. INTRODUCTION electrical appliances and mobile devices to improve the
The role of residential users tends to become more quality of life [4]. Among residential loads, HVAC (heating,
significant in Smart Grids environment, especially with more ventilation, and air conditioning) systems play an important
freedom and motivation to become producer of electrical role in the use of electricity. The HVAC control system aims
energy. The insertion of distributed generation (DG) systems to maintain the indoor room temperature at a comfortable
by residential users tends to grow along with concerns from level automatically and manage energy efficiency [5].
utility companies in system management. Issues such as From this standpoint about possibilities of residential
information flow and two-way communication, advanced environment management, the present work aims to present a
detection and measurement infrastructure tend to be applied residential load management system based on user behavior,
by utility companies. climate variables and the possibility of integration with
The technologies developed in Smart Grids tend to bring distributed generation and Smart Grid. It is called Smart
for utility companies the possibility of have more knowledge Residential Load Management System (IRLMS), focusing on
of residential users, what can provide actions in the system the management of HVAC systems.
with greater intelligence. Demand response (DR) programs The results presented in this article are part of a project
will tend to be more widely used, however, in order to achieve under development between COPEL DISTRIBUTION (PD
these potential benefits, a certain level of automation is 2866-0462 / 2016) and the Federal University of Santa Maria
required to reduce both the uncertainty in the consumer (UFSM), controlled by Electrical Energy National Agency
response to price signals and the complexity for the consumers (ANEEL)-Strategic R&D for the Brazilian Electricity Sector-

978-1-7281-3103-0/20/$31.00 ©2020 IEEE


Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 24,2020 at 22:24:17 UTC from IEEE Xplore. Restrictions apply.
P021/2016. This study was also financed in part by the the MQTT protocol to the actuation devices responsible for
Coordenação de Aperfeiçoamento de Pessoal de Nível each load.
Superior - Brasil (CAPES/PROEX) - Finance Code 001.
Decision-making techniques have been in use for some
II. SMART RESIDENTIAL LOAD MANAGEMENT SYSTEM time to produce results in natural language based on the
(SRLMS) analysis and modeling of complex scenarios. The results are
obtained from computational intelligence heuristics, for
It’s proposed for the management of residential loads the
example, decision trees, neural networks, fuzzy logic, etc.
system called Smart Residential Load Management System These methods can deal with complex variables, by
(SRLMS). The SRLMS applies artificial intelligence (AI) classifying and/or predicting results to assist decision-making.
methods and concepts of IoT for residential lighting [6].
management and HVAC systems, as air conditioners. It
consists of three elements: Control and Monitoring To enable users to execute actions on lamps or HVAC
Residential Unit (CMRU), Monitoring Devices (MD) and system, CMRU provides an interface that can be access by
Actuation Devices (AD), represented in Figure 1, below. using computer, Smartphone or any other device that has web
access via browser. Below, the Figure 2 shows the interface
that present lamps connected to the actuation devices in each
room and buttons to control these residential loads.

Figure 1. SRLMS – Elements

The CMRU is responsible for making the intelligent


management of each residential load connected to the system,
making communication with monitoring devices and
actuation devices. In addition to data monitored by load Figure 2. Lighting Control - Interface
connected devices, the CMRU receives data from the Smart
Meter, Battery Energy Storage Systems (BESS) installed and The HVAC management process is composed with three
the inverter connected to the installed photovoltaic system. modules, which are: Propositional module: It is trial-based
module and aims to provide users with comfortable operating
III. CONTROL AND MONITORING RESIDENTIAL UNIT temperatures. Performs increase and decrease of air
(CMRU) conditioning temperature of 1°C actions; Prediction module: it
The proposed system has a central device called Control uses storage actions, performed in air conditioning by the user
and Monitoring Residential Unit (CMRU), in charge of and the propositional module, as training and test data to apply
receiving monitored data and creating intelligent decision Machine Learning algorithms. Its purpose is to send actions to
making for the different actuation devices, connected to controlled air conditioners according to users behaviors;
residential loads. The CMRU receives data from sensors of Fuzzy Controller Module: It is responsible for load shedding
monitoring and actuation devices installed in the different according to scenarios of generation, storage and consumption
rooms of the residence via the MQTT protocol. Besides these of electricity.
data, the CMRU receives other data such as power In Fuzzy system it acquiesce intermediate values between
consumption, tariff value and current state of power
conventional evaluations like black/white, yes/no, true/false
generation.
and so on. In conventional logic theory with contrast, where
The proposed system uses algorithms belonging to we have two-valued logic set of binary: zero or one, fuzzy
Artificial Intelligence to create intelligent decisions-making. It system variables might have a truth-value that limits in
is used in HVAC management the Fuzzy Logic and Machine degree between zero and one. Fuzzy system continued to
Learning algorithms, while for lighting management it was control the approach of partial truth, and the range of truth-
decided to use only Fuzzy Logic. The hardware used in value completely true and false [7]. Thus, ranges can be
CMRU is Raspberry PI 3, which has the necessary processing represented in data such as: “hot”, “comfortable” and “cold”
capacity to execute the developed algorithms present in the temperature; electricity consumption “high”, “medium”,
system. The decision-making created by the system is sent via “low”. The Machine Learning belongs to the area of AI,

Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 24,2020 at 22:24:17 UTC from IEEE Xplore. Restrictions apply.
whose objective is to develop computational methods able to After carry out this calculation, the module verifies the
make decisions based on existing knowledge [8]. In ML some need to increase or decrease the temperature set in the HVAC
changes happen in behavioral aspects of the algorithm as system in order to be as close as possible to the “Comfortable”
experience is gained from data monitoring. range. After that, if necessary, the system sends the new
temperature command and waits a period of time for user
Three types of operating modes have been proposed: acceptance verification. The attempt is seen as a failure if the
Comfort Mode: non-intrusive, as it does not make restrictions user changes the air conditioner temperature via interface
on the use of residential loads; Standard Mode: Rules within this user feedback check time. If the proposed
developed to make actions with less restrictions on the use of temperature command is not changed, the system understands
residential loads in certain scenarios like tariff and high that the attempt was successful. The timing of the next
consumption, low generation, etc; Economy Mode: This is the attempts to be made by the system adapts according to the
most intrusive operating mode of the system, which is used for success and failure of previous attempts.
users who want to reduce power usage even in low generation
power scenarios. B. Temperature Management – Prediction Module.
A. Temperature Management – Propositional Module. 1) Aplication of Machine Learning.
With the increasing demand for intelligent and personalized
HVAC management can bring to users, in addition to services, context-aware systems have been implemented in a
convenience, a healthier environment. The propositional
smart home to support these services with reasoning and
module is part of decision process for HVAC management,
learning mechanisms [10]. The temperature prediction
and works in conjunction with the prediction module. The
propositional module aims to try to offer users intermediate module aims to predict temperature actions according to the
temperatures, which can bring comfort to the residential habit of residential users. For this, the proposed module uses
environment and can be are easier to maintain. In order to be stored data of actions performed by users through the
accepted by users, the propositional module is not intrusive. interface provided by the system and actions performed by
the propositional module.
It uses the Kawamura’s Discomfort Index ( ) [9].
Through research to study different types of indices it was According to [11], the ML algorithms learning process can
found that the can be used in outdoor and indoor be divided into three categories: supervised learning,
environments, being possible to verify conditions of thermal unsupervised learning and semi-supervised learning. It was
comfort felt by people only with the use of ambient air decided to use supervised learning by having both inputs
temperature (ºC), dew point temperature (°C) and relative (different monitored data) and the result of actions taken by
humidity. Using the , the system calculates the index using users (on/off, for example). In supervised learning, the
data collected by sensors that measure temperature and learning task can be classification or regression, depending on
humidity in each room of the residence. Monitored data is the type to which the predicted attribute belongs. According
used in the following equation: to [12], when the class attribute (output) assumes a discrete
value, such as class A, class B, or class C, the problem is
  known as a classification problem, in which case the

objective is to classify future cases of each pre-established
Where, is the Kawamura’s Discomfort Index (ºC), Ta classes. When the attribute assumes continuous values, such
is the air temperature (ºC) and Td is the dew point as the expected price of a product, the problem is generally
temperature (ºC), which can be estimated from the following known as a regression problem, and the objective is to predict
equations: the value of this attribute based on the characteristics of the
others examples.

  Algorithms with supervised learning by classification were
chosen for this proposed system. Actions performed by users
and propositional module were categorized as: “Increase
 Temperature”, “Decrease Temperature”, which are equivalent
 
to commands of 1°C in relation to the parameterized
Being: a= 17.27 and b= 237.7 (°C) and UR is the relative temperature in the HVAC system. In addition to these
humidity divided by one hundred. With the calculated index actions, the actions “Keep Temperature”, “On”, “Off” were
it is possible to verify possible situations that may impact the categorized. According to Table 2, the data used are arranged:
comfort of users inside the residence and thus make attempts TABLE I. DATA LAYOUT – MACHINE LEARNING
to increase or decrease 1°C of controlled load setting. The (1) (2) (3) (4) (5) (6) (7) Output
proposed ranges of the index are: > 80 “Stress due to
heat”; 75 < ≤80 “Uncomfortable due to heat”; 60 < Ok 21 74 0 21 1 21 Turn off
≤75 “Comfortable”; 55 < ≤60 “Uncomfortable due to User
activity 23 91 1 22 0 21 Turn on
cold”; ≤55 “Stress due to cold”.
Increase
Not Ok 29,5 72 1 30,5 1 22 Temp.
Ok 6,5 67 1 7,5 1 24 Keep

Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 24,2020 at 22:24:17 UTC from IEEE Xplore. Restrictions apply.
Temp. i.e. it compares the data in each row and returns the position
Where: (1) Type of action; (2) Sensor temperature (° C); (3) of each in a ranking. The ranking is shown in Table 3.
Room humidity; (4) Presence of people; (5) Outside TABLE III. ALGORITHM VALIDATION PROCESS - RANKING
temperature (°C); (6) Condition of the HVAC system; (6)
HVAC temperature (°C). The input called “Type of Action” Tests (1) (2) (3) (4) (5) (6)
(Random
has three possible values: “User Activity”, which represents State)
actions performed by users via the interface; “Ok” and “Not 1 3 4 2 6 5 1
Ok”, which represent indirect user feedback to the 2 5 4 2,5 6 2,5 1
temperature control actions proposed by the propositional 3 2,5 4 2,5 6 5 1
module. 4 4,5 4,5 2 6 3 1
5 4 5 3 6 2 1
2) Algorithm Validation Process. 6 4 5 2 6 3 1
The validation process for choosing the Machine Learning 7 3 5 2 6 4 1
8 5 2,5 2,5 6 4 1
algorithm was consisted of: carry out ten cross-validation 9 5 2,5 4 6 2,5 1
tests using StratifiedKFold from Sklearn. The ten tests are 10 2,5 2,5 5 6 4 1
applied to a training database, and each test has output Average 3,9 3,9 2,8 6,0 3,5 1,0
represented by the average accuracy and after that, each Looking at the Ranking it was possible to verify that the
tested algorithm is ranked. XGBoost, Gradient Boosting Classifier and Random Forest
algorithms had better performance in the cross validation
In each test, the database was divided into 10 parts (splits),
process using the training database.
where some parts of the database are used in training and
another part in the testing of classification algorithms. 3) Algorithm Tests.
StratifiedKFold provides training/test index in a database to After the validation, the first three ranking algorithms were
split data into training/test sets. Splits are made by preserving chosen for the training process based on the general
the percentage of samples for each class in the database. [13]. temperature database (training base) and test database. The
Thus, the training and testing is done without disparity of test database was composed with reduced data, with values
output classes, allowing the training not to be adjusted in just not seen in the training. Quality metrics for the three
a particular class. Each test is characterized by changing the algorithms chosen are presented in Table 4 below.
StratifiedKFold's random_state attribute, increasing from 1 to TABLE IV. ALGORITHM TESTING PROCESS – QUALITY METRICS
10 to separate training and test data. The result of each
random seed generator increment test is the average accuracy Algorithm Accuracy Recall F1 Training time
XGBoost 0.913793 0.91379 0.914215 0.14391
of 10 internal tests, since the number of database divisions
Gradient 0.922414 0.92682 0.931615 0.30181
was set to 10. Since each seed increment test has 10 internal Boosting
tests (number of parts), the whole process contains 100 Classifier
interactions in the chosen database. Random 0.905172 0.91342 0.920251 0.05696
Forest
The following algorithms were chosen for the validation The algorithms have very similar results. It was decided to
process (numbered for representation in the following tables): use XGBoost with 91.37% accuracy as a classification
(1) AdaBoost; (2) Decision Tree; (3) Gradient Boosting algorithm in the system. The training time with XGBoost was
Classifier; (4) LightGBM; (5) Random Forest; (6) XGBoost. shorter than the Gradient Boosting Classifier, which on larger
The result of the 10 tests is presented in Table 2. data bases may be clearer, and the accuracy result was higher
TABLE II. ALGORITHM VALIDATION PROCESS – 10 TESTS than Random Forest. Added to these metrics is the fact that
XGBoost was the first placed in the validation process.
Tests (1) (2) (3) (4) (5) (6)
(Random 4) Fuzzy controller module.
State)
1 0,9364 0,9318 0,9455 0,8318 0,9273 0,9682
In conjunction with the ML algorithm to predict HVAC
2 0,9136 0,9182 0,9318 0,8500 0,9318 0,9591 control according to user habits, a Fuzzy controller was
3 0,9455 0,9409 0,9455 0,8409 0,9364 0,9545 developed with the following inputs: Presence of people;
4 0,9364 0,9364 0,9500 0,8636 0,9455 0,9636 Action predicted by the Machine Learning algorithm;
5 0,9227 0,9182 0,9273 0,8227 0,9318 0,9591 Photovoltaic system generation level; BESS decision; Current
6 0,9273 0,9182 0,9364 0,8318 0,9318 0,9682
7 0,9364 0,9227 0,9409 0,8409 0,9318 0,9636
tariff price; Enable action without presence of people; Energy
8 0,9182 0,9364 0,9364 0,8545 0,9227 0,9682 consumption. The output chosen was the controlled HVAC
9 0,9136 0,9227 0,9182 0,8364 0,9227 0,9636 state, where: connected (when Machine Learning prediction
10 0,9409 0,9409 0,9318 0,8500 0,9364 0,9682 is different from turning off the device), or off for load
Accuracy shedding. Below (Figure 3), the execution of the Fuzzy
0,9291 0,9286 0,9364 0,8423 0,9318 0,9636
Average
controller in standard mode is presented.
The function called RANK.AVG from Microsoft Office
Excel [14] was used to rank the results of the Table 2. This
function returns the position of a number in a list of numbers,

Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 24,2020 at 22:24:17 UTC from IEEE Xplore. Restrictions apply.
brought benefits considering both home energy management
and residential user behavior.
ACKNOWLEDGMENT
The authors would like to thank the support from Federal
University of Santa Maria, Santa Maria – RS, Brazil,
Polytechnic College, ANEEL Strategic Calling P021/2016,
COPEL- DIS (PD 2866-0462 / 2016), funding from CNPq PQ
1-D 310761/2018-2, CNPq process 465640/2014-1, CAPES
process no. 23038.000776/2017-54 and FAPERGS 17/2551-
0000517-1, support from CNPq, Brazilian National Council
for Scientific and Technological Development – Brazil. This
study was also financed in part by the Coordenação de
Aperfeiçoamento de Pessoal de Nível Superior - Brasil
(CAPES/PROEX) - Finance Code 001.
REFERENCES
[1] “Demand side response in the domestic sector—A literature review of
Figure 3. Fuzzy Controller Execution - Standard Mode
major trials,” Dept. Energy Climate Change (DECC), London, U.K.,
2012.
C. Lighting Management. [2] B. Zhou, W. Li, K. W. Chan, Y. Cao, Y. Kuang, X. Liu, et al., "Smart
For residential lighting management a Fuzzy controller home energy management systems: Concept, configurations, and
scheduling strategies," Renewable and Sustainable Energy Reviews,
was developed with the following inputs: Photovoltaic system vol. 61, pp. 30-40, 2016.
generation level; Light level of the room; Current tariff price; [3] K. Patel and A. Khosla, "Home energy management systems in future
Presence of people in the room; BESS decision; Energy Smart Grid networks: A systematic review," in Next Generation
consumption; time of day. As decision output was set “On” Computing Technologies (NGCT), 2015 1st International Conference
on, 2015, pp. 479-483.
and “Off”. Figure 4 shows the inputs and outputs in a Fuzzy [4] C. Perera, S. Member, A. Zaslavsky, and P. Christen, (2013) “Context
controller execution simulation in standard mode. Aware Computing for The Internet of Things : A Survey,” Commun.
Surv. Tutorials, IEEE, vol. PP, no. 99, pp. 1–41.
[5] H-C. Jo, S. Kim, and S-K. Joo, “Smart heating and air conditioning
scheduling method incorporating customer convenience for home
energy management system,” IEEE Trans. Consum. Electron., vol. 59,
no. 2, 2103, pp. 316-322, 2013.
[6] S.H Andrade, E.L. Oliveira, R. Alfaia, A. Souto, C.R.L. Francês, N. L
Vijaykumar. "Adopting fuzzy technique to save energy in smart home
control systems" in 58th International Scientific Conference on Power
and Electrical Engineering of Riga Technical University (RTUCON),
2017.
[7] R.Langari. Integration of fuzzy control within hierarchical structured
control systems. IEEE Trans. Com. Intel., 1994, pp. 293-303.
[8] MICHALSKI, R. S.; CARBONELL, J. G.; MITCHELL, T. M.
Machine learning: An artificial intelligence approach. [S.l.]: Springer
Science and Business Media, 2013.
[9] KAWAMURA, T. Distribution of discomfort index in Japan in
Summer season. Journal of Meteorological Research, 17, 460-466,
1965.
[10] O. Brdiczka, 1. L. Crowley, and P. Reignier, "Learning Situation
Models in a Smart Home, " IEEE Trans. on Systems, Man, and
Cybernetics, Part B: Cybernetics, vol. 39, no. 1, pp. 56-63, Feb. 2009.
Figure 4. Fuzzy Controller Execution - Standard Mode [11] MONARD, M. C.; BARANAUSKAS, J. A. Conceitos sobre
aprendizado de máquina. Sistemas Inteligentes-Fundamentos e
IV. CONCLUSIONS Aplicações, v. 1, n. 1, 2003.
[12] PRATI, R. C. Novas abordagens em aprendizado de máquina para a
The proposed system works with concepts and geração de regras, classes desbalanceadas e ordenação de casos. Tese
technologies that tend to be important in smart home (Doutorado) — ICMC-USP, São Carlos, 2006.
development, which may play an important role in Smart [13] Scikit-Learn. sklearn.model_selection.StratifiedKFold. Web site:
https://scikit-
Grid architecture. The system has been tested on a computer learn.org/stable/modules/generated/sklearn.model_selection.StratifiedK
with the following configurations: Intel® Core ™ i7-7700HQ Fold.html
Quad Core, NVIDIA GeForce GTX 1050 and 8GB RAM. [14] Microsoft. RANK.AVG function. Web site:
After that, the system was installed on a Raspberry pi and the https://support.office.com/en-ie/article/rank-avg-function-bd406a6f-
eb38-4d73-aa8e-6d1c3c72e83a
platform was able to run the system correctly. The choice for
the XGBoost algorithm proved to be effective for predicting
user actions in HVAC systems and the use of fuzzy logic has

Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 24,2020 at 22:24:17 UTC from IEEE Xplore. Restrictions apply.

You might also like