New Software Solutions for Low-power Management of Green Smart
Homes
Aymen Jaouadi
1,2
, Olfa Mosbahi
3
, Mohamed Khalgui
3
and Asma Sakri
2
1
Cynapsys Company, France-Germany
2
FST, University of Tunis, El Manar, Tunisia
3
LISI Laboratory, INSAT Institute, University of Carthage, Tunis, Tunisia
Keywords:
Microcontroller, STM32F4, Reconfiguration, Smart Home, Smart Grid, Software Agent, Modeling and
Verification, Simulation.
Abstract:
The research paper deals with new Green Smart Homes which offer original services such as the optimal power
consumption, peak management, and home power selling while assuming an available home green energy.
We propose a Master-Slave based architecture following the well-known industrial technology STM32F4. A
microcontroller Slave Agent is proposed for each selected Home Device to control its local consumption, and
a unique microcontroller Master Agent is proposed to control the whole architecture. The goal is to optimize
the use of green energy, to minimize the consumption costs by exploiting the offers from providers and also
the peak times. We model these services by using the model checker UPPAAL, and propose UML design
diagrams for this architecture. A visual simulator of this STM32-based architecture is developed and applied
to a case study proposed by Cynapsys.
1 INTRODUCTION
Home automation consists in the management of our
equipments based on new technologies and also in
the proper use of information. If it is properly used,
the home automation can make real energy savings
and be part of a sustainable development of the future
electricity networks. Home automation presents itself
as an alternative to reduce energy costs, increases in-
telligence at homes by the mean of sensors and actu-
ators, as well as maintaining the power grid by the
balance of supply and demand. To make life eas-
ier, Home Automation is an obvious choice, it allows
to design a green grid, which is based on renewable
energy and to encourage innovation through the lat-
est discoveries in the field of high tech. In recent
years, several studies about the automation were con-
ducted; the most important proposes an approach that
is based on the diversification and the decentralization
of energy production sources and the development of
This research work is a collaboration between LISI
Laboratory (INSAT Institute) at University of Carthage and
the Company Cynapsys in Tunisia. We thank Ing. Haythem
Tebourbi Technical Director and Ing. Souhail Kchaou Di-
rector of Research and Development for long fruitful dis-
cussions and stable supports.
a platform that enables the exchange and communi-
cation between different types of interconnected net-
works (Torbensen, 2008). Inspired by (Abras et al.,
2008) home automation systems can be combined
with Multi-Agent Systems for the home energy man-
agement and the adaptation of the consumption to the
available green energy resources as well as the de-
velopment of new algorithms for emergency and an-
ticipation mechanisms. Among the used communi-
cation solutions at home automation systems, Inter-
net, ZigBee or Bluetooth have been proposed to con-
trol households from an remote location by using vi-
sual interfaces and web applications. (A.Vichare and
Verma, 2012)(Gill et al., 2009)(R.Piyare and M.Tazil,
2011). we are interested in this research in optimal
home electricity management through the creation of
new modern Home Automation Services. We propose
an original reconfigurable home automation system
Model which allows the dynamic change of the daily
behavior at run time according to user requirements
and energy constraints. The reconfigurable model of
our approach consists of the execution and the con-
trol of three runtime services: a Power Consump-
tion Management Service which is used to manage
and control the power consumption of equipments at
home. It adapts the energy demands to production
375
Jaouadi A., Mosbahi O., Khalgui M. and Sakri A..
New Software Solutions for Low-power Management of Green Smart Homes.
DOI: 10.5220/0004976003750385
In Proceedings of the 3rd International Conference on Smart Grids and Green IT Systems (IEEHSC-2014), pages 375-385
ISBN: 978-989-758-025-3
Copyright
c
2014 SCITEPRESS (Science and Technology Publications, Lda.)
systems through an action plan predefined by the user.
The second service consists of the Management of
the green low power distribution which is based on
the decentralization of production through the use of
renewable sources in low-voltage networks. This en-
ergy is stored in batteries and used according to a spe-
cific management and consumption policy. This ser-
vice also allows the user to manage sales promotional
offers, it may as well buy energy during discount pe-
riods, store it and use it when prices are inflated. Fi-
nally we propose the third peak management service
which allows to manage high consumption periods
by deactivating directly the equipments or delaying
there execution. This service also allows to compen-
sate the difference between the production and the
consumption thanks to use of green energy that we
assume stored in batteries. These original services
meet exactly the different requirements of the modern
and smart electricity grid. We propose a Multi-Agent
based architecture to offer these services. It is com-
posed of: (a) City Information Agents to gather the
useful information for the distribution and the use of
electrical energy, (b) City Master Agents that control
Home Master Agents which supervise Home Slave
Agents to be responsible for the operation of the elec-
trical equipments at homes, and finally (c) Home Stor-
age Agents to be deployed for the monitoring and the
exploitation of renewable energy produced and stored
in batteries at home. An original Master/Slave archi-
tecture is hierarchically proposed in the current pa-
per to manage Information, Storage and the proper
use of green electricity. This architecture is guided
by a communication protocol that manages the ex-
changed messages between the different agents in or-
der to perform the services discussed above. This
optimal protocol allows the management of renew-
able energy, management of consumption peaks and
management of electricity consumption. We also pro-
pose the formalization of these services and the de-
sign of the software with UML diagrams. We verify
the whole architecture by proposing timed automata
models, and apply UPPAAL for model checking(Alur
and Dill, 1994),(Bengtsson et al., 1996). We aim to
verify functional and temporal constraints since our
system is strict and does not tolerate faults and mis-
management of used data and information. The study
of our approach leads us to develop a simulation tool
to be named X-SH which is an original product for
the power management in smart homes. The paper’s
contribution is applied to a real case study provided
by Cynapsys in order to discuss its advantages. The
rest of this paper is organized as follows, the next
section presents the state of the art of Smart Homes.
Section 3 presents the Case Study of Cynapsys that
will be assumed as a running example in this paper.
Section 4 proposes the Multi-Agent Master/Slave ar-
chitecture followed by a formalization of the problem
and the proposed services, the UML design and the
verification of timed automata models, The Simula-
tion tool X-SH. Finally section 5 concludes this re-
search works.
2 BACKGROUND
We present in this section an overview on Home Au-
tomation Systems, System Reconfiguration and Mas-
ter/Slave Agent based architecture.
2.1 Home Automation Systems
Nowadays, the research works in the field of home au-
tomation systems have a unique direction to look for
luxury, comfort and the mixture between daily tasks
and new technologies. The authors in (AlShu’eili
et al., 2011) propose a new approach for voice recog-
nition based wireless home automation system to con-
trol all lights and electrical appliances at home or of-
fices by using voice commands, they propose a ver-
ification test based on the voice recognition. How-
ever, this approach is weak against identity theft and
imitating the voice of the house’s owner, so anyone
can take control of the home. According to (Nunes,
2010), an architecture for a home automation system
is given, which has a distributed nature, very mod-
ular and can easily be expanded in size and func-
tionality. The authors present two types of constitu-
tive modules interconnected through a network. The
proposed approach consists of Supervision Module
(SM) and a Control Module (CM) to be intercon-
nected by a Communication Network, a simple sys-
tem with an Action/Reaction mechanism. In (Debono
and Abela, 2012), the authors present an implemen-
tation of a home automation system through a cen-
tral FPGA controller as a simple solution whereby the
user control devices by employing a central field pro-
grammable gate array (FPGA) controller to which the
device and sensor are interfaced. The control is es-
tablished by using a communication with the FPGA
from a mobile phone through its interface. A design
of a networked monitoring System for home automa-
tion is presented in (Song et al., 2007). The system
consists of a base station, a home server, wireless sen-
sor nodes and smart user terminals such as PC and
PDA. A ZigBee-Based Home Automation System is
developed in (Gill et al., 2009). the authors present
a flexible and low cost home automation infrastruc-
ture. The home’s low data rate, control and monitor-
SMARTGREENS2014-3rdInternationalConferenceonSmartGridsandGreenITSystems
376
ing needs are catered by using ZigBee. the authors
in (Ha, 2009), try to present a dynamic integration
of ZigBee home networks into home gateway by us-
ing OSGi service registry. The proposed architecture
is divided into two layers of ZigBee home networks;
physical and logical interface. A realization of home
remote control network based on ZigBee is described
in(Shunyang et al., 2007); the authors present the Zig-
Bee as an emerging wireless communication technol-
ogy with low cost and low power characteristics.
2.2 Reconfigurable Embedded Systems
We assume that an embedded system is reconfig-
urable if it changes its software or hardware behav-
ior at run-time according to user requirements. The
software reconfiguration is any operation allowing the
addition, removal or update of software tasks that im-
plement the system to encode corresponding func-
tions. The software reconfiguration is assumed to be
any operation allowing the addition, removal or up-
date of hardware components according to user re-
quirements. An addition or removal can be of mem-
ory, of data-event inputs-outputs, or of a new net-
work for communication. The update of hardware
components can be the modification of the proces-
sor speed. We are interested in this paper in soft-
ware reconfigurations. We distinguish two reconfig-
uration policies: static and dynamic reconfigurations
(Wang et al., 2010). Static reconfigurations are ap-
plied off-line to implement changes before the cold
start of the system (Angelov et al., 2005), whereas
dynamic reconfigurations are dynamically applied at
run-time.(Seokcheon, 2010)(Hu et al., 2011) Two
cases exist in the latter: manual reconfigurations ap-
plied by users(Rooker et al., 2007) and automatic
reconfigurations to be applied by intelligent agents
(Seokcheon, 2010)(Khalgui et al., 2011).
2.3 Master/Slave Multi-agent
Architecture
According to the authors in (Megherbi and Madera,
2010), the Master-Slave architecture is described as
the most popular and widely used architecture in the
distributed systems. Master software nodes assign
each slave node for a specific amount of work, and
once the slave has completed its task, it reports the
results back to the master. In (Nwana et al., 1996),
the authors propose a coordination model in software
agent systems, based on Master-Slave architecture,
the master agent plans and distributes fragments of
the plan to the slaves. The slaves may or may not
communicate among themselves, but must ultimately
report their results to the master agent.
2.4 Contribution: New Services for
Smart Homes
According to the study of these research works pro-
posed in Smart Grids, Home Automation Systems,
Multi Agent Systems, and Reconfigurable Embedded
Systems, we find that the researches carried out: do
not respond exactly to the requirements of the mod-
ern world, do not consider the exponential growth of
the energy consumption, and do not follow the new
technical and technological progress. These works
are simple, wobbly, and too generalizing. Indeed they
lacked precision and intelligence. We propose in the
current paper a new Master/Slave Multi-Agent archi-
tecture in order to: (a) decentralize the control, (b)
guarantee the determinism, (c)and reduce the number
of messages circulating in the network. This original
architecture allows: (a) the management of the energy
consumption, (b) the management of peak period, (c)
the use of renewable green energy to be stored in bat-
teries, (d) and the management of the promotional of-
fers from providers when the prices are down.
3 CASE STUDY: CYNAPSYS
HOME AUTOMATION SYSTEM
We present in this section the Cynapsys Smart Home
(to be denoted by CSH) which was maintained as
the reference case study of our company in the cur-
rent project. We assume a house to be composed
of six rooms and a garden. Each home area is sup-
posed to be controlled by a STM32 F4-based elec-
tronic equipment for the optimal daily energy con-
sumption (STMicroelectronics, 2013). CSH ensures
serenity and control of ambient lights, appliances and
access. The Proposed CSH provides automated blind
controls to open or close, and to be based on times
or light and heat levels. An integrated cooling and
heating system to optimize the energy use through
pre-determinedscheduling or temperaturecontrols, as
well as the management of the smart meter to con-
trol electricity consumption in real-time and the pro-
motional offer of the energy providers. We propose
a control irrigation system and pool pump operation
management and finally the integration of new green
renewable energy production sources to be composed
mainly by wind and solar panels that we store in home
batteries. The CSH shows many interests: (a) the
billing service, (b) the conservation of energy, (c) the
NewSoftwareSolutionsforLow-powerManagementofGreenSmartHomes
377
peak management, (d) and the use of renewable en-
ergy. Figure 1, provides a description of CSH that we
assume as a running example in this paper.
Figure 1: CSH case study.
We propose the characteristic of the CSH equip-
ments in the table below with real values about the
energy consumption, the frequency of use and the pri-
ority of each device.
Table 1: Electrical Equipment Characteristics.
Equipment P UF CA Pr
Combined Fridge 100 W Continuously 875 2
Air Conditioning 150 W 5 H/day 450 2
Washing machine 940 W/C 3 cycles/week 135 1
Microwave 500 W 1.5 H/Week 36 1
Boiler 2000 W 80L/day 400 1
Heating 60 W Continuously 345 2
Pool Pump 1500 W 5H/day 750 1
Where:
P: is the equipment power (watt)
UF: is the equipment usage frequency
CA: is the equipment Calculated amount (KWH)
Pr: is the equipment Priority.
The data presented above will be used in the imple-
mentation of our proposed new services such as the
management of peak demand or help the user to ra-
tionalize its energy consumption and pay less. In this
section, we propose a novel idea which is based on
the classification of household tasks into two broad
categories, the first category contains the permanent
tasks, i.e the daily tasks that have the highest prior-
ity such as: radiators and heater. The second cat-
egory contains temporary tasks that can be delayed,
such as television, washing machine, dishwasher and
iron. We will assume that we have three tariff zones
in a day as described in Table II: (a) from midnight to
8am, (b) from 8am to 16pm is a middle zone and (c)
from 16 pm until midnight. The first zone is used for
the normal consumption and we attribute coefficient
2 to this period. The second one is characterised by a
consumption peak and has the high coefficient equal
to 4. The last one is a medium zone with consumption
coefficient equal to 3.
Table 2: Pricing zones.
Normal Peak Medium
Zone Zone Zone
Time Slot 00.01 to 8.01am to 16.01pm to
Time Slot 8am 16pm 00.00
Coefficient 2 4 3
Price Mill/KWH 130 260 195
In the following, we will present the advantages of
using three tariff zones for both continuousand partial
time tasks.
- For a continuous task, for example refrigerator:
With a unique tariff (peak zone): The annual
consumption in Tunisian Dinar is equal to:
875 0.260 = 227.5 TND/Year. (1)
With three tariff zones: The annual consump-
tion in Tunisian Dinar is equal to:
(875 (0.130+ 0.260+0.195) ÷ 3) = 170.6 TND/Year.
(2)
- For a partial time task, for example the pool pump:
With a unique tariff (peak zone): The annual
consumption in Tunisian Dinar is equal to:
(750 0.260) = 195 TND/Year. (3)
With Normal tariff zone: The annual consump-
tion in Tunisian Dinar is equal to:
(750 0.130) = 97.5 TND/Year. (4)
In the first case, we notice a gain in the bill equal
to (227.5 170.6) TND. In the second one, the user
choices the cheapest pricing zone and can earn the
half of the price (195 97.5) TND.
To test the peak management service, the elec-
tricity daily consumption estimation during a summer
day is as follows (using Table I):
(2.4+ 0.75+0.45+ 0.11+ 1.09+7.5) = 12.3 KWH/Day.
(5)
The available energy during peak consumption period
is equal to 2 KWH/Day. So in this case, the requested
value is equal to 10.3 KWH(12.3 2). We propose
to deactivate the less priority equipments during peak
periods. So we will only keep the refrigerator and air
conditioning and the daily consumption will be equal
to:
(2.4+ 0.75) = 3.15KWH/Day. (6)
Compared to the provided value, we still need
1.2 KWH to meet the daily electricity lack. We as-
sume that we have domestic batteries to store energy
SMARTGREENS2014-3rdInternationalConferenceonSmartGridsandGreenITSystems
378
produced by renewable sources. The used batteries
are divided into two parts. The first part uses 70% of
the available capacity for optimizing the production.
The second part uses 30% to solve the peak consump-
tion problems. For example, if the battery available
amount of energy is equal to 4KWH, we have to use
only 30% of this amount, which is equal to 1.2KWH
After using our idea, we we
re able to avoid a peak consumption by delaying
the execution of some lower priority equipment and
compensate the remaining value through the use of
renewable energy available in the battery.
4 MULTI-AGENT BASED
SOLUTION
In this section, we propose a Multi-Agent based Ar-
chitecture, for our CSH to control and manage the do-
mestic energy consumption. Our architecture consists
of a one Home Master Agent controlling a number of
Slave Agents corresponding to their equipments. We
have also Storage Agents functioning together with
the Green Agents for the production and the storage
of the green renewable energy.
Figure 2: Multi-agent based architecture.
4.1 Agents Description
In this section we will introduce the various agents
used in our approach. We have four kinds of agents:
1. Home Master Agent. It controls and optimizes
energy consumption and encourages the use of the
green renewable sources. It coordinates between
all the Slave Agents controlling their correspond-
ing equipments.
2. Home Slave Agent. They control the elec-
trical equipments by stopping and resuming
their functioning through a mechanism of Sen-
sors/Effectors,
3. Green Agent. They control the production of the
renewable energy sources,
4. Storage Agent. They control storing in batteries
the energy produced by green renewable sources,
to be used in the case of peak consumption.
4.2 Agents and Services Formalization
In this section we propose a formalization of the
agents and the original services used in the contribu-
tion.
4.2.1 Formalization of Agents
Let
Sys
CSH
= { MA,ξ
SA
,ξ
GA
,ξ
STA
} be the Cynapsys
Smart Home Multi-Agent based System com-
posed of a Master Agent MA, N Slave Agents
SA, M Green Agents GA and finally K Storage
Agents. Let:
ξ
SA
= {SA
1
,...,SA
N
} be the set of Slave Agents
for the control of rooms,
ξ
GA
= {GA
1
,...,GA
M
} be the set of Green Agents,
ξ
STA
= {STA
1
,...,STA
K
} be the set of Storage
Agents,
Sys
e
= {e
1
,e
2
,...,e
n
} be the set of electrical
equipments.
4.2.2 Agent’s Parameters
Let MA = {ID, EC,ASL,NLV} be the Master Agent
list of parameters, where:
ID: the Identifier of the agent composed of a
String,
EC: the daily estimated energy consumption,
ASL: the Available Stored Load energy,
NLV: the Needed Load Value used in the case of
peak consumption and daily production manage-
ment.
Let e
i
Sys
e
where e
i
has:
ID: be the Identifier of the electrical equipment,
EC(e
i
): be the daily estimated consumption of the
electrical equipment,
Let sa
i
ξ
SA
where sa
i
has an ID, an NLV, and and a
set of equipment Sys
e
to control.
ID: be the Identifier of the Slave Agent,
NewSoftwareSolutionsforLow-powerManagementofGreenSmartHomes
379
NLV(e
i
): be the Slave Agent Needed Load Value
corresponding to the equipment e
i
.
Let ga
i
ξ
GA
where ga
i
has an ID and a DPV
ID: the Identifier of the Green Agent,
DPV: the Daily Production Value.
Let sta
i
ξ
STA
where sta
i
has an ID and a STV
ID: the Identifier of the Storage Agent,
STV: the Stored Value.
4.2.3 Formalization of Services
The intelligence in power systems spreads starting
houses, through intelligent cities to arrive at a smart
grid.
Let:
P
e
be the equipment power amount,
P
G
be the general available energy.
Our system should always satisfy the following equa-
tion:
n
i=1
ECe
i
< P
G
(7)
let:
Pr
t
be the total price of the energy consumption,
Pr
i
be the price at the instant i,
C
i
be the consumption at the moment i,
Pu
i
be the unit price of the KWH at the moment i,
Pr
i
= C
i
Pu
i
,
Tr
c
be the Consumption Threshold.
Our approach must satisfy the system represented by
the equation below, which consist of using the three
tariff zones, i [0, 1,2] where zero corresponds to the
first tariff zone, one for the second one and two for
the third one:
Pr
t
=
2
i=0
Pr
i
(8)
The problem is to find the right formulas of energy
consumption during the appropriate periods to mini-
mize the total cost.
The equation is therefore to establish an optimization
relationship having the form:
MinPr
t
,
Pr
t
< Tr
c
.
Let:
EC be the estimated daily consumption of a
house,
ECe
i
be the estimated consumption of a single de-
vice e
i
per day.
The estimated daily consumption is given by the fol-
lowing equation:
EC = ECe
1
+ ECe
2
+ ... + ECe
n
=
n
i=1
ECe
i
(9)
Let:
Pv be the Peak Value provided by the energy pro-
ducers,
STV be the available capacity in the battery.
In the case of a peak detected by the energy pro-
ducer, the power source become the battery in case of
presence of sufficient load. In our approach, we have
30 % of the capacity of our battery remains untouch-
able, this part is dedicated to solving the problem of
peak consumption as described in the equation below:
Pv = 0.3 STV
i
,
STV
i
be the stored value of the Storage Agent i.
4.3 Service Protocols
In this section, we propose a Service Protocol to co-
ordinate all used agents in the implementation of the
different proposed services.
Algorithm 1: Green Energy and Storage Device
Management.
foreach ga
i
ξ
GA
do
STV
i
=
n
i=1
DPV
i
end
// The Sum of the Daily produced Value
provided from different green renewable
sources represents the Stored Value used in the
Peak Management Service.
foreach sta
i
ξ
STA
do
STV =
n
i=1
STV
i
end
if Date == Date
Peak then
Pv = STV 30 ÷ 100;
//The Peak Value represents 30% of the
available capacity on the Battery
end
The next algorithm deals with the management of
the interaction and the communication between the
used agents used in order to handles the power con-
sumption optimization.
4.4 Timed Automata Models
In this paper, we propose a global approach for the
design of adaptive reactive systems, i.e. systems that
dynamically adapt their architecture depending on the
SMARTGREENS2014-3rdInternationalConferenceonSmartGridsandGreenITSystems
380
Algorithm 2: Home Master Agent and Home Slave
Agents Energy Management.
Init
Date <> Date
Peak
State = Enabled
while Date = Date
Peak do
foreach sa
i
ξ
SA
do
if Priority == 1 then
State == Disabled
end
if NLV <= Pv then
MA Sends a giveSolution(MA,STA)
else
foreach sa
i
ξ
SA
do
State = Disabled
end
end
if Event == PromotionalOf fer then
MA Sends Store(MA, STA)
else
foreach sa
i
ξ
SA
do
if (Priority == 1) And
(Zone <> NormalZone) then
State = Disabled
end
end
if Pr
t
>= Tr
c
then
foreach sa
i
ξ
SA
do
State = Disabled
end
end
State = Enabled;
end
end
end
context. We use the timed automata formalism for
the design of the agent’s behavior to check and verify
functional and temporal properties of our inter-agent
communication protocol. This allows their evaluation
regarding logical correctness and timeliness, thanks
to model-checking and simulation techniques. Ac-
cording to (Palshikar, 2004), model checking is the
most successful approach that’s emerged for verify-
ing requirements. The idea is that by ensuring that
the model satisfies enough system properties, we in-
crease our confidence in the correctness. As follows
we present a Timed Automata Model for the example
of agents that we propose in our approach. We model
the Home Master Agent with its two main important
services: Distribution and Peak Management which
has been described above. The Home Master Agent is
responsible of the whole house control by supervising
a set of Home Slave Agents which in their turns are
responsible of the home’s electrical equipments. Fig-
ure 3 shows the timed automata model of the Home
Master Agent.
Peak_Management
Normal_Mode
Promotion_Management
Ditribution_Management
clpromo:=0
Control_Mode
clnr:=0 Nr:=1
clnr:=0 Nr:=0
Idle
needed_Value[ID]!
estimated_Value[ID]!
evt==date_promo
produced_Value<estimated_Value
date=date_peak
needed_Value<produced_Value
clctr:=0 ctr==0
clnr:=0 Nr:=1
date=date_peak
consumed[ID]>treshold[ID]
clpeak:=0
needed_Value>produced_Value
date!=date_peak
consumed[ID]<treshold[ID]
date>date_promo
clnr:=0 Nr:=1
clctr:=0 ctr:=1
clpeak:=0
needed_Value>produced_Value
clctr:=0 ctr:=1
Consumed[ID]=Treshold[ID]
clpeak:=0
needed_Value<produced_Value
cldist:=0
clpeak:=0
date>date_peak
clctr:=0 ctr:=1
Figure 3: Home Master Agent Timed Automata.
This automata consists of different states related
to the different operations of the Home Master Agent.
The default mode is the normal mode, however, the
transition to the control mode is activated by: (a)
the arrival of preemptive events, (b) functional con-
straints related to exceeding consumption threshold,
(c)the arrival of a peak load, (d)time constraints re-
lated to power management across shutdown, (e) and
activation of equipments to consume intelligently and
during specific periods. Figure 4, shows the transac-
tion of distribution management, which is an impor-
tant service in our theoretical approach. The decen-
tralization of the distribution in this work is a major
asset for ensuring optimization, maintaining the net-
work and the integration of renewable sources for the
energy generation. The reactive system upon detec-
tion of failure or the arrival of a new promotional offer
from the provider. In this case, we verify the amount
of renewableenergy to be available in the battery. Fol-
lowing the application of the formulas given above,
our system decides if the new source of energy an be
used or not. Our reactive system will be efficient in
this case while respecting imposed time and ecologi-
cal constraints.
init()
Provider_Source
Battery_Source
isFault()
isFault() init()
isPromo()
battery_Amount<estimated_Value
battery_Amount>=estimated_Value
Battery_Check
battery_Amount>=estimated_Value
Idle
clbattery:=0
isFault
init()
Figure 4: Distribution Management Service Timed Au-
tomata.
NewSoftwareSolutionsforLow-powerManagementofGreenSmartHomes
381
The proposed approach allows the management of
peaks by using useful information to be sent from the
provider. Figure 5 describes the mechanism of energy
management during peak periods. Our goals: (a) the
minimisation of the energy consumption during these
periods, (b) take into account environmental impacts
and cost of energy productions, (c) optimisation of the
overall energy generation plan by anticipating con-
sumer demands while ensuring comfort, (d) taking
into account resources and environmental constraints,
(e) and better control of consumption and local distri-
bution. The management of high consumption peri-
ods is based on the use of compensation for energy re-
quests through house storage devices to be connected
essentially to green production sources. The system
is converted to a control mode after the arrival of a
peak load event. The source of production becomes a
local battery after the checking of its capacity. This is
done with a specific management policy with efficient
calculation methods to guarantee green and low cost
energy for users.
Battery_CheckAlertIdle
isPeak()
Battery_Source
Control_Mode
isPeak()
Battery_Amount>=Estimated_Valueavailable_Value<Estimated_Value
date>date_peak
date>date_peak
Peak_Battery_Amount<Estimated_Value
Peak_Battery_Amount<Estimated_Value
clpeak:=0
isPeak()
isPeak()
Figure 5: Peak Management Service Timed Automata.
4.5 Implementation
4.5.1 UML Modeling
We propose a UML model to implement the software
version of our home system. Figure 6, shows the
class diagram Home Automation System (abbrevi-
ated by HAS) that represents the whole Multi-Agent
architecture. This class manages all interactions in
the system. It is related to the provider interface class
which allows interaction with energy producers, and
the user interface class which allows manual accesses
of users into the system. An Agent class is proposed
to represent both Home Slave Agents and Home Mas-
ter Agent through an inheritance relationship. Figure
6 shows the whole class diagram.
Figure 6: Home Automation System class Diagram.
4.5.2 X-SH Simulation Tool
The simulation is mandatory for the development and
deployment of our system model. This model repre-
sents the main characteristics of the selected physi-
cal, abstract system or process. Simulation is used in
many contexts, such as simulation of technology for
performance optimization, safety engineering, test-
ing, training and education. In this section, we present
a tool to be called X-SH that we developed at Cynap-
sys for the electrical energy management. This tool
simulates the services that we describe aboveby using
real-time data collection.It reacts to various changes
of the electrical network. This tool can be used by
both users and producers for the estimation of the
daily energy consumption in order to optimize the use
of green sources, manage peak periods, manage offers
from producers. After the authentication interface to
be used for a required security, the main interface ap-
pears to include the various offered services that we
describe above: (a) Equipments Management service,
(b) Consumption Management service, (c) Consump-
tion Threshold service, (d) and Sale Management ser-
vice (Figure 7).
SMARTGREENS2014-3rdInternationalConferenceonSmartGridsandGreenITSystems
382
Figure 7: Main Interface Energy Management Tool.
In Figure 8, we show the equipments management
interface. The households are controlled by the Home
Slave Agents. The X-SH Simulation tool allows the
addition of new equipments, removing or changing
priorities according to periods of use and operation
modes.
Figure 8: Equipment Management Interface.
Figure 9, shows the consumption management
service which is provided by our simulation tool X-
SH. The interface informs the users about the values
of the estimated consumption for a period and the ac-
tual daily consumption.
Figure 9: Consumption Management Interface.
In Figure 10, we show the consumption Thresh-
old management Interface. This service allows to
avoid the energy waste or loss as fixed by users. In
the case of exceeding Threshold, we are directly in-
formed about the passage of the home to the control
consumption mode.
Figure 10: Set Threshold Consumption Interface.
The last service proposed by our consumption
management tool X-SH consists of the management
of the provider promotional offers (Figure 11). In the
case of lower prices, the user can change its produc-
tion source from the battery to the provider. We con-
sume less in this case and can help to preserve energy
that we store in the batteries for future uses, manage-
ment electric failures, and management of peak peri-
ods.
Figure 11: Sale Management Service Interface.
4.5.3 Contribution Analysis
The testing of our simulation tool at Cynapsys helped
us to better assess the gain of the proposed approach.
Thanks to this contribution, the management of the
power consumption shows a remarkable gain that
costs 50 TND = 227 TND - 170 TND before the ap-
plication of our approach and after (1 Euro = 2.2 TND
in January 2014). This gain is very important for any
Tunisian family in the medium society class. (Figure
12).
NewSoftwareSolutionsforLow-powerManagementofGreenSmartHomes
383
0 2 4 6 8 10 12
0
50
100
150
200
250
month
Dinars
Before contribution
After contribution
Figure 12: Comparison between the energy consumption
before (Red) and after (Green) the contribution.
We propose also in Figure 13, the test of the
thresholds consumption service that we did at Cynap-
sys. We note that during the same period, the user can
consume energy intelligently by considering the pri-
ority of each equipment and the production of renew-
able energy from batteries. The consumption should
not exceed the fixed amount.
0 5 10 15 20 25 30
0
50
100
150
200
250
300
day
Dinars
Before contribution
After contribution
Figure 13: Comparison between the energy consumption
without threshold (Red) and with threshold (Green).
Finally we propose in Figure 14 a histogram show-
ing the use of renewable energy in our approach. We
choose a summer day, which is characterized by a
high consumption of electricity and an alert of peak
from the provider. We applied an optimal manage-
ment of the energy with the participation of the re-
newable sources that costs 38.09%.
Figure 14: Green renewable energy participation.
5 CONCLUSIONS
This paper deals with a new Multi-Agent architec-
ture for Smart Homes, which propose, new services
for users such as: (a) Peak Management, (b) Promo-
tion Offers Management, (c) Consumption Manage-
ment. We offer a Home Master Agent that controls the
whole architecture, interacts with the energyprovider,
coordinates with home users in order to optimise the
green energy that we assume available at home. A
Home Slave Agent is proposed for the local control of
each equipment. We propose a communication proto-
col between these agents to support all the services
that we propose above. Since the architecture that we
propose is real-time and based on concurrent opera-
tions, we propose timed-automata models for these
agents and verify their correctness by using UPPAAL.
We developed a simulator X-SH which can be used
by both home users and providers in order to estimate
and manage the daily consumptions. This tool was
tested at Cynapsys and some experimental results are
exposed in this paper. In our future work, Cynapsys
plans the real commercialisation of this product. We
are planning in this case to finish the complete de-
ployment of this simulator as well as Agents on mi-
crocontrollers following STM32F4 technology. The
real commercialisation and distribution is planned for
the end of 2014.
REFERENCES
Abras, S., Ploix, S., Pesty, S., and Jacomino, M. (2008). A
multi-agent home automation system for power man-
agement. In Springer Berlin Heidelberg, pages 59–68.
AlShu’eili, H., Gupta, G. S., and Mukhopadhyay, S. (2011).
Voice recognition based wireless home automation
system. In 4th International Conference on Mecha-
tronics (ICOM), pages 1–6.
Alur, R. and Dill, D. L. (1994). A theory of timed automata.
In Theoretical computer science, pages 183–235.
Angelov, C., Sierszecki, K., and Marian, N. (2005). De-
sign models for reusable and reconfigurable state ma-
chines. In L.T. Yang et al. Eds. Proc. Of Embedded
Ubiquitous Comput, pages 152–163.
A.Vichare and Verma, S. (2012). Embedded web server for
home appliances. In National Conference on Emerg-
ing Trends in Engineering and Technology, VNCET.
Bengtsson, J., Larsen, K., Larsson, F., Pettersson, P., and
Yi, W. (1996). Uppaal: a tool suite for automatic ver-
ification of real-time systems. In Hybrid Systems III,
pages 232–243.
Debono, C. J. and Abela, K. (2012). Implementation of a
home automation system through a central fpga con-
troller. In Electrotechnical Conference (MELECON),
16th IEEE Mediterranean, pages 641–644.
SMARTGREENS2014-3rdInternationalConferenceonSmartGridsandGreenITSystems
384
Gill, K., Yang, S., Yao, F., and Lu, X. (2009). A zigbee-
based home automation system. In IEEE Transactions
on Consumer Electronics, pages 422–430.
Ha, Y. G. (2009). Dynamic integration of zigbee home net-
works into home gateways using osgi service registry.
In IEEE Transactions on Consumer Electronics, pages
470–476.
Hu, L., Lee, K.-M., Zou, J., Fu, X., and Yang, H.-Y.
(2011). Adaptive measurement for automated field re-
construction and calibration of magnetic systems. In
IEEE Transaction, pages 327–337.
Khalgui, M., Mosbahi, O., Li, Z. W., , and Hanisch, H. M.
(2011). Reconfigurable multi-agent embedded control
systems: From modelling to implementation. In IEEE
Transaction, pages 538–551.
Megherbi, D. B. and Madera, M. (2010). A hybrid p2p and
master-slave architecture for intelligent multi-agent
reinforcement learning in a distributed computing en-
vironment: A case study. In IEEE Transaction.
Nunes, R. J. C. (2010). Domobus-a new approach to
home automation. In 4th International Conference on
Mechatronics (ICOM).
Nwana, H. S., Lee, L., and Jennings, N. R. (1996). Co-
ordination in software agent systems. In BT Technol
J.
Palshikar, G. K. (2004). An introduction to model checking.
In Tata Research Development and Design Centre.
Rooker, M. N., Sunder, C., Strasser, T., Zoitl, A., Hum-
mer, O., and Ebenhofer, G. (2007). Zero downtime re-
configuration of distributed automation systems: The
cedac. In Third International Conference on Indus-
trial Applications of Holonic and Multi-Agent Sys-
tems.
R.Piyare and M.Tazil (2011). Bluetooth based home au-
tomation system using cell phone. In IEEE 15th In-
ternational Symposium on Consumer Electronics.
Seokcheon, L. (2010). Fairness, stability and optimality of
adaptive multiagen systems. In Interaction through
resource sharing, IEEE Trans, pages 427–439.
Shunyang, Z., Du, X., Yongping, J., and Riming, W. (2007).
Realization of home remote control network based on
zigbee, electronic measurement and instruments. In
ICEMI 07, 8th International Conference, pages 344–
348.
Song, G., Wei, Z., Zhang, W., and Song, A. (2007). Design
of a networked monitoring system for home automa-
tion. In Consumer Electronics, IEEE Transactions,
pages 933–937.
STMicroelectronics (2013). Datasheet. In STM32F4
Datasheet.
Torbensen, R. (2008). Ohas open home automation system,
consumer electronics. In ISCE IEEE International
Symposium on Consumer Electronics, pages 1–4.
Wang, X., Khalgui, M., Li, Z., and Mosbahi, O. (2010). Au-
tomatic low-power reconfigurations of real-time em-
bedded control systems. In Technical Reprot Systems
Control and Automation Group School of Electro-
Mechancial Engineering Xidian University.
NewSoftwareSolutionsforLow-powerManagementofGreenSmartHomes
385