Next Article in Journal
Characterizing Spatiotemporal Patterns of Mangrove Forests in Can Gio Biosphere Reserve Using Sentinel-2 Imagery
Next Article in Special Issue
An Intelligent Approach to Allocating Resources within an Agent-Based Cloud Computing Platform
Previous Article in Journal
Moment-Curvature Behavior of PP-ECC Bridge Piers under Reversed Cyclic Lateral Loading: An Experimental Study
Previous Article in Special Issue
Realistic Multi-Agent Formation Using Discretionary Group Behavior (DGB)
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:

Central Heating Cost Optimization for Smart-Homes with Fuzzy Logic and a Multi-Agent Architecture

Diego M. Jiménez-Bravo
Álvaro Lozano Murciego
Daniel H. de la Iglesia
Juan F. De Paz
1 and
Gabriel Villarrubia González
Expert Systems and Applications Lab, Faculty of Science, University of Salamanca, 37002 Salamanca, Spain
Faculty of Informatics, Pontifical University of Salamanca, 37002 Salamanca, Spain
Author to whom correspondence should be addressed.
Appl. Sci. 2020, 10(12), 4057;
Submission received: 15 May 2020 / Revised: 6 June 2020 / Accepted: 10 June 2020 / Published: 12 June 2020
(This article belongs to the Special Issue Multi-Agent Systems 2020)


Recent years have defined the need to reduce gas emissions to fight climate change, and society’s move to green energies is important to make responsible use of non-renewable energies. Therefore, it is now important to use technologies to optimize the use of actual energy sources. In this aspect, the Internet of Things (IoT) technology has had a great impact on society. Hence, this research work aims to use IoT technology and multi-agent systems to optimize the use of central heating installation in buildings. It is intended to improve the user’s comfort, reduce the consumption of energy and reduce the financial costs. Therefore, a multi-agent system is proposed to collect data from sensors located in a smart-home and obtain the best action to perform in a central heating system. The decisions will be taken by an intelligent agent based on fuzzy logic. This technology will allow for generating the control action with a fuzzy controller. The results obtained show that the proposal improves the actual system in terms of users’ comfort and financial and energy savings.

1. Introduction

In 2019, the debate was climate change, and during that year, several conferences took place in different parts of the world, like COP25 (Conference Of Parties 25), Climate Action Summit 2019, and Youth Climate Summit 2019 [1]. These conferences were able to grab the attention of the greatest media communication platforms and, therefore, the attention of the population. The last statement may make a difference in this debate that has been postponed for decades. People are aware of the risk that future generations will have. Therefore, not only political conferences but also social conferences took place last year [1,2] in which environmental organizations and activists explained the risk and consequences of continuing this type of lifestyle. These people had a great impact on the communications media, which was supported the selection of the Swedish environmental activist Greta Thunberg as “Time Person of the Year” [3], only the second woman to receive this recognition on her own after Angela Merkel in 2015 [4]. The concession of this award to an environmental activist supposes the recognition of the importance of climate change or climate emergency, principally because this award is usually related to important international politicians.
Unfortunately, governments do not have a common agreement to preserve the global environment. Some governments are aware of the critical situation and try to do whatever they can to fight global change. However, these actions are not enough if the most important and polluting countries are against green policies. Therefore, future years and future agreements will determine the future of the Earth. Meanwhile, as mentioned before, some countries have determined that the climate emergency can no longer wait. This is the case with the Spanish government, which recently established a state of climate emergency in order to reduce their gas emissions and obtain a state of zero emissions by 2050 [5]. The location of Spain makes it the ideal country to produce green energy [6]. However, the transition must be progressive, which means that the first steps are to reduce non-green energy and introduce more green energy little by little.
However, during the last decade, not only has climate change had an impact on citizens but also the Internet of Things (IoT). This technology has a great impact on cities, homes, and industries by making it possible to monitor the state of these kinds of infrastructures. IoT allows monitoring the state of living beings, like animals, plants and even human beings. IoT technology consists of placing sensors on a real environment in a distributed way. The sensorization of the environment allows the system to obtain data, and, therefore, information from those entities that the developers of the system want [7]. The information can be processed in the sensor itself (edge computing) [8], or it can be processed in a central system (cloud computing) [9]. In both computing models, data travels from the edge to the cloud; the difference falls on the amount of information/data transferred. Edge computing transfers less data, usually the most relevant, while the cloud computing model usually transfers all the information captured by the sensors. This information is the key to the IoT system. Information is not only useful to monitor the state of the system, but it is also important to act in the system, detect anomalies, and predict the future state of the system between other actions. Hence, the possibilities in this kind of system allow developers to create the perfect system to resolve a real-world problem. It is especially interesting for this article that the information acquired by the sensors or sensor network can provide information on the real context and/or environment in which the sensors are installed. This information can be of great interest for the systems because they can interpret the measured values and associate them with more understandable values for the users of the systems.
Therefore, IoT, smart-cities, and smart-home technologies can be extremely useful to improve the effectiveness of industrial systems. This effectiveness can also lead to sustainability effectiveness. Hence, the use of this technology can reduce pollution and greenhouse emissions. The monitorization of several features in this kind of system or architecture can help the developers and the Artificial Intelligence (AI) models to improve the effectiveness of the systems and consume less energy. IoT and AI work together; IoT can extract the raw data from a real environment, and AI is responsible for extracting all the knowledge and information from the raw data. So, both AI and IoT are, in fact, responsible for effectiveness and pollution reduction [10]. This study makes use of the fuzzy logic that is capable of interpreting the values read by the IoT devices to infer an output that will be a control action that will be triggered on a heating system with the aim of reducing cost and harmful emissions. These technologies can help to implant a progressive plan in order to achieve zero non-green energy emissions. The first step of this plan usually consists of reducing non-green energy emissions while green energy infrastructures are being implemented and introduced in the energy production system. In this way, control systems that are usually responsible for turning the system on/off and/or regulating other aspects of the system like, for example, flow regulation could help to achieve this first step.
As mentioned before, IoT systems are hardware distributed systems in which the different sensors used by the system and even the gateways are distributed in a real environment. This environment can be small or big; this characteristic depends on the problem or real system that the developers want to resolve. However, the crucial thing here is that the system has several components distributed over the area of the system. These hardware components will be controlled by software. Therefore, it is considered that the best software solution for this kind of hardware system is a distributed software system. In particular, a Multi-Agent System (MAS); MAS is a kind of distributed system that is composed of different entities or agents [11,12]. Usually, these agents represent real entities of the world, entities like the sensors of an IoT system. This characteristic is one of the keys that make MASs an ideal solution for IoT infrastructures. However, more advantages of MASs will be explained in future sections.
Hence, with all this information and taking into account that a lot of big and medium cities in Spain still have homes and buildings with central heating installations, it is crucial to develop and research a system that can optimize the use of these old installations while they are replaced with modern ones. This is important given the new policies established in society that aim to reduce energy consumption and gradually introduce green energy; while this transition is developing, proposals like the one presented in this article are important. Therefore, a control system based on MAS architecture and fuzzy logic is presented to optimize the use and reduce the energy consumption of old central heating systems. Data will be collected from sensors that will be integrated into the multi-agent architecture, promoting the correct behavior of the different agents in the system to promote energy savings in the heating system. With the solution presented in this article, it is expected to reduce consumption and, therefore, the emissions of these kinds of systems during the winter months.
The rest of the article will be divided as follows: Section 2 will introduce the most relevant works developed during the last years in this research area, Section 3 will define the proposed system presented in this article, Section 4 will explain the case of study defined in order to prove the effectiveness of the proposed system, Section 5 will show the result obtained from the study and their discussions and finally, Section 6 is where the conclusion of the work and future lines of research will be explained.

2. Background

In this section, the different works developed in the different areas involved in this scientific research during the last years will be analyzed. This section will be divided into different subsections to analyze the different areas of research properly.

2.1. IoT and Smart Environments

The Internet of Things has been defined in different ways since it first appeared. However, almost all the definitions share the same idea. IoT can be defined as an interaction between the physical and digital world, where both of them work together to achieve a common goal. The communication between these two worlds is provided by sensors and actuators. These physical elements have computing and networking capabilities that allow knowing and even changing the state of the element [13,14,15]. These elements that established the link between the real and digital world are connected between themselves and also with a central system. These communications are enabled thanks to several communication protocols like Wi-Fi, Low Power Wide-Area-Networks (LPWAN), Bluetooth Low Energy (BLE), Near Field Communication (NFC), ZigBee and Z-Wave, among others [14,15,16]. Therefore, IoT technology can be implanted in every physical environment, creating a smart environment.
Hence, the application of IoT in industry results in the creation of Industry 4.0. This supposes a new revolution in the industry field. The Internet allows for creating smart products, smart production and smart services [17] thanks to the collection and analysis of real-time data to optimize the decision-making process. Industry 4.0 was related to the use of cloud computing [18]; however, in the last years, fog [19] and edge [8] computing has had its impact in the field. This evolution is possible thanks to the increase in computing capacities of small technological devices, like the sensors and actuators themselves.
Several works implement Industry 4.0 principles to obtain sensorized industries that facilitate the employees’ tasks or obtain the best products or results. For example, the study developed by Scheuermann et al. [20] shows how a software agile methodology is transferred to an assembly line. This new application of the agile methodology allows for applying a change of the customers during assembly time. On the other hand, Schlechtendahl et al. [21] show how a non-Industry 4.0 factory can be transformed into an Industry 4.0 factory. They describe how to include the sensors and actuators in the existing environment and establish communications with the gateways and the central software system. Ang et al. [22] demonstrate how a computer design of a smart ship allows integrating Industry 4.0 in the ship design process and the ship’s through-life. Another important concept in Industry 4.0 is the digital twin that represents a digital image of a real industry [23]. This concept helps, for example, to detect possible failures in industries.
Another important application of IoT is in cities. Smart cities used IoT technology in order to communicate the infrastructures of a city with software. Smart-cities appeared to respond to more economically, environmentally and socially sustainable cities [24]. There are several infrastructures of this time developed in different cities. Latré et al. [25] have developed the “City of Things,” a testbed for IoT and smart-cities with distributed nodes in the city of Antwerp. In the Spanish city of Santander, Sánchez et al. [26] have developed another testbed for smart-city experimentation.
Smart-buildings and smart-homes make use of IoT to control or monitor the inside situations of the buildings. The idea is that the building’s users can easily monitor and control home devices/appliances or situations. Therefore, several devices, sensors or actuators are going to be connected to the network using the mentioned protocols [27]. Several smart-home implementations have been performed in the last years. In 2015, Ghayvat et al. [28] deployed several sensors over a home to obtain a smart-home environment that could forecast the wellness of an individual and monitor her/his physical activity around their home environment. Mano et al. [29] have developed a Health Smart Home (HSH) that can identify the emotions of patients that are being treated in their homes with the purpose of monitoring patients. This research can support the development of IoT technologies. Datta et al. [30] developed another HSH where researchers can monitor the physical parameters of the patients to provide more personalized healthcare. Apart from HSM, another relevant aspect that is increasing in smart-home design is sustainability. Several works have been published during the last years. Chang et al. [31] have developed a unified energy management framework that can use renewable energy to reduce the impact of non-renewable impacts on the environment and also reduce electricity bills. Other researchers [32] have developed another smart-home that can also reduce the amount of energy used in the home thanks to the AI module that allows appliances to be used more sustainably. Furthermore, Karmakar et al. [33] developed dynamically controlling exterior and interior window coverings to determine their state and apply a control action to heaters, air conditioners, etc.
However, this research usually has a common problem. The lack of interoperability is considered as one of the most important barriers to achieving the integrations of IoT environments in real infrastructures. The different disciplines, vendors and standards make it even an even more complicated task [34]. Therefore, the proposal addressed in this article may help to resolve this problem.

2.2. Control and Automation Systems

Control and Automation Systems (CAS) have been present for more than a century [35]. They are present in our more common automated tasks. CASs can provide a response based on the inputs of the system. Therefore, they are commonly used in big industry systems and automated systems in several kinds of installations, like a heater or freezing system in buildings and homes. There are several types of CASs: proportional controllers, Proportional-Integral controllers (PI), Proportional-Integral-Derivative (PID) controllers and fuzzy controllers. PIDs are very common in industries solutions; however, fuzzy controllers also offer good performance and allow them to control several variables at the time that they produce a unified response.
Fuzzy systems are based on fuzzy logic. This was first proposed by Zadeh [36] in 1965. In this research, Zadeh proposed the basic principles of fuzzy logic, representation and inference, basic rules of inference and the linguistic variables and its applications to fuzzy control. Several works have used fuzzy control systems. Next, some of them are described briefly.
Mier et al. [37] designed a fuzzy adapted method to improve the response of a scalar fuzzy control system for the speed of an induction motor. They demonstrated that the use of an adaptive fuzzy controller shows improvement against the non-adaptive fuzzy controller. However, the fuzzy control systems are not only applied to classic control problems. They are also applied to the smart-environments that surged after IoT technology appeared. Garg and Kaushal [38] designed a traffic light control system using a Wireless Sensor Network (WSN) and fuzzy control. For this specific case, the authors designed four fuzzy controls that work in parallel to obtain a better performance, fault-tolerance and support. Their results support the system that allows the vehicle’s waiting times to be reduced. Another example of fuzzy logic applied to a smart-environment, in this case to Industry 4.0, is the study developed by the Chinese and Norwegians researchers Huo et al. [39]. The study shows a fuzzy control system analyzing the real-time data information of an assembly line. The fuzzy system has two different fuzzy systems: the first one controls the re-balancing of the assembly line, and the second one adjusts the production rate of each workstation. Azaza et al. [40] also developed a smart-home fuzzy control system, in this case, for a greenhouse. They tried to promote a comfortable micro-climate for plants while saving energy and water. For this reason, they developed a smart fuzzy logic control system that uses wireless data monitoring to obtain the output of the system.
Several works have used fuzzy logic to control heating systems [41,42,43]. The studies [41,42] show a fuzzy controller implemented in an 8-bit microcontroller. The fuzzy logic control is based on the definition of an engineering heuristic to determine the boiler temperature. So, the output of the system is based on a heuristic, not real data. The study [43] defines a fuzzy controller in which only the difference between the current temperature and desired temperature is taken into account. This study collects the data from the current temperature inside a building or house; however, this value is usually integrated into the heating systems. However, these works do not make use of all the potential and options offered by the sensor networks, which could obtain data in real-time and apply it to the fuzzy control system. One of the major advantages of sensor networks is to obtain data intelligently from heterogeneous data sources that can extend the capabilities of the system and improve its performance. In this sense, the work presented must obtain information of the context where the system is located using different types of sensors and make it available to the fuzzy control system. Moreover, with these technologies, it is possible to establish a balance between user comfort and energy saving.

2.3. Multi-Agent Systems

The sensorization of cities, homes and factories, among other infrastructures, allows the deployment of distributed systems. A computer system is needed to manage these complex systems. Due to the nature of these systems, the natural choice is to develop a distributed computer system capable of administering the system. Therefore, MAS offers a valid solution for this new trend.
A distributed system is the main characteristic of a MAS. Every agent is independent of the others, making their own decisions and performing their goals. However, this is not the only characteristic of a MAS; other features are listed below [44]:
  • Flexibility allows the system to change against agents’ and the environment’s modifications.
  • Adaptability enables it to change the behavior or actions of the agents easily.
  • Scalability is the ability of MASs to add new devices to their structure.
  • Leanness is the feature that establishes a difference between agents but without incrementing the categories of agents.
  • Resilience allows obtaining the community goal, even if an agent fails or is corrupted.
Thanks to these characteristics, the MAS has become an excellent solution to control and manage IoT infrastructures.
Other researchers have taken this into account; hence, they have developed multi-agent architectures in the IoT field. Recently, Spanish researchers Francisco et al. [45] have created a distributed model predictive control based on a multi-agent system. They see MAS properties as the perfect solution for the distributed model predictive control that uses fuzzy logic to resolve their case of study. However, this multi-agent architecture is not useful in other IoT infrastructures since its implementation is mainly focused on the case study addressed in the paper. Therefore, this MAS cannot be applied without changes in their structure to another case study or IoT environment. The same problem occurs in a framework designed by Maleš et al. [46]. This solution proposes a multi-agent system with deep learning techniques to allow face tracking. The solution is focused on resolving the IoT problem, but the proposed MAS does not record the video sequence by itself, another subsystem is responsible for that task.
Hedjazi et al. [47] propose a solution for maintenance scheduling in industry 4.0 using a MAS. The MAS enables decision-making and promotes competition between the different agents to obtain the global good. The MAS implements a different kind of agent; however, none of them are connected to a smart device or sensor in the industry. On the other hand, Wang et al. [48] have also developed a MAS for Industry 4.0. This solution provides a full solution for this kind of IoT area. The proposed framework is divided into four layers, every one of them with different kinds of agents. Nonetheless, the framework does not include a layer or module to obtain data from the Internet. Researchers from the United Kingdom and the United States of America, Salvador Palau et al. [44], have developed another MAS for Industry 4.0. Same as above, the MAS is well-designed for the Industry infrastructure, but it does not provide a global alternative.
Similarly, Modoni et al. [49] have carried out a study in the context of a MAS carried out in JADE (Java Agent Development framework) to obtain information from a network of sensors inside a smart home and to monitor the home and its users.
Another area in which the agent’s theory has a lot of influence is in smart-grids and micro-grids. Proof of this is the study elaborated by Karavas et al. [50], who developed a MAS for the design and control of autonomous poly-generation microgrids. According to the authors, a decentralized system is a right solution for this kind of system. Hence, the agents help to perform a perfect distributed system, although the presented MAS has a simple architecture with only five agents and it does not have modules to distinguish between different kinds of agents. Modules help to make a difference between agents of the same type, so it is easier to scale the system.
Recent work from the University of Málaga’s (Spain) researchers, Ayala et al. [51], has established a global solution for a multi-agent architecture in the field of IoT. To test their proposal, they created the “GreenManager system,” a MAS oriented for smart-homes and power consumption management. They have created several agents that oversee the electronic devices of the house and a “Green Manager Agent” that acts as a supervisor agent. This agent is the one that controls the whole system. It knows when to send a request to a device agent according to the information that it receives. Therefore, the authors apply the MAS to reduce the electric consumption of houses during the peak hours where the electricity is more expensive.
Therefore, in this article, a fuzzy control system based on a multi-agent platform is proposed to control the effectiveness of home and building central heating systems. The main contributions of the paper are listed below: (I) the proposal of a self-designed MAS for IoT and smart-environments, (II) the communication behavior between the MAS’s agents, (III) the collection of sensor data recollected by intelligent agents and (IV) the design of an intelligent control system based on fuzzy logic principles. In the next section, the proposal will be explained in more depth. Table 1 shows a comparison between the proposal and other similar studies. Some of these research studies have been explained before. The study [52] defines a non-linear mathematical model that takes into account information from several sensors inside and outside the home that can produce control of the heating system in small buildings and homes.

3. Proposed System

As discussed in the previous section, the main contribution of this research article is the multi-agent system for central heating cost optimization in smart-homes. Multi-agent technology provides a distributed architecture. The distributed architecture is composed of different agents. Every agent performs their task. However, the agents work together to accomplish the final goal of the system. Therefore, one of the most important features of MAS is that every agent works in a coordinated way. MASs have other advantages that, together with the features mentioned in the background section, make MASs an ideal solution. These advantages are mobility, the dynamic behavior, and the high level of communications through the transparent management of the message queues. The system is developed in the Python programming language. To construct the MAS, SPADE Python’s library [53] was used. Smart Python Agent Development Environment (SPADE) is a Python library developed by Gregori et al. [54,55] that allows for creating a multi-agent platform based on instant messaging (XMPP). Other alternatives were evaluated, such as JADE [56], PANGEA (Platform for Automatic coNstruction of orGanizations of intElligent Agents) [57,58], AIOMAS [59] and osBrain [60]. However, SPADE was selected because its focus on the Python programming language allowed it to be easily integrated with the simulation model that will be explained later. On the other hand, Python is one of the most relevant languages today and is especially focused on data processing. This means that the system can be improved in the future by other researchers. Hence, when a SPADE’s MAS is deployed, its agents run their tasks in an XMPP server to establish the communications between them. This characteristic is outstanding for the SPADE platform. So, with the use of this software, it can develop a MAS that is going to be deployed in a central system. Consequently, some of the agents of the designed platform may be connected with physical objects through the specific communication protocol.
The architecture designed for this article is shown in Figure 1. Proposed multi-agent system. One of the main characteristics of the proposed architecture is that the agents are divided into different modules which establish a difference between the agents. It is assumed that the agents that belong to the same group could be similar or work together in order to obtain a sub-goal of the system. With these modules, it is easier to include, delete or modify agents. Furthermore, the different modules, agents and communication between agents will be explained in the following subsections.

3.1. Supervisor Agent

The supervisor agent is the agent that controls and supervises the rest of the agents. It is in charge of initiating the rest of the agents. It controls and verifies that all the agents do their tasks. Agents have an associated behavior that defines how they are going to perform their tasks. Different kinds of behaviors exist, like one-shot behavior, cyclic behaviors and periodic behaviors between other more complex behaviors [61]. The supervisor agent has different types of behavior: (I) a one-shot behavior to initialize the agents at the beginning of the MAS initialization, (II) a periodic behavior to check that the rest of the agents are still active, and (III) a cyclical behavior to receive messages from the AI module agents. After performing the simulation, which is its main task, the agent ends its behavior and, therefore, its activity, ending the execution of the program and the MAS.

3.2. Devices Module

The devices module is one of the two modules in which this proposed architecture is formed. This module contains the sensors’ agents. Every module inside this architecture will be connected to a specific sensor through the specific protocol. The number of devices agents will depend on the number of circumstances that the central system wants to control or measure. In the current proposal, the system will have four different device sensors. These four sensors are listed below.
  • Outside temperature agent: the proposed system will include a temperature sensor located outside the home or building to obtain the temperature in the closest possible environment to the building. The use of a crawler agent and a crawler module were considered in obtaining the outside temperature. This module would connect itself to the Internet to obtain the temperature. However, usually the sensors that different webpages use are located outside the cities. Hence, temperature values could not be as reliable as expected.
  • Inside temperature agent: the system will also include a temperature sensor inside the house to know if the control system achieves the comfort temperature. There could be as many temperature sensors as the user wanted (for example, one per room). However, in this case, the mean temperature of all rooms will be considered. It is important to obtain the inside temperature since the control system will determine its action taking into account this value as we will see.
  • Outside humidity agent: another aspect that is important to consider when a control system wants to maximize the user’s comfort is the humidity. Since the user is going to be inside the building, the proposed system will only consider the outside humidity; inside humidity will depend on the aimed temperature.
  • People counter agent: the control system will also be informed if there are people or not inside the building, so no energy is wasted at all. The control system will consider this information and will only turn on the system when there are people inside the building. Different kinds of sensors can be used for this purpose, from simple ones like PIR (Passive InfraRed sensor) sensors or presence sensors to more sophisticated sensors like thermal sensors or optical sensors. Furthermore, we can collect the total number of people inside the house or just if there is someone inside the building. The definition of this sensor could change, depending on the circumstances evaluated in the study case. However, the result will be the same, to know if there are people or not inside a building.
All these agents work in very similar ways. As it is logical, each one of them will be connected to a different sensor, but its operation is practically identical. All of them have a cyclic behavior in which they obtain the current data that the sensor is measuring. Depending on this value, the agent will act in an intelligent way and will determine the most convenient action, even changing its behavior. All the agents share a common characteristic; they have a small temporary memory that stores the last n values measured by the sensor and collected by the agent. The value of the variable n is totally configurable; for this proposal, we have selected a value of n = 50 . This temporary memory will be used with two purposes: (I) to check that the current measured value is not an extreme value (Equation (1) is used for this purpose) and (II) to check that the current measured value is not equal to the last n / 25 values available in the temporary memory. If the purpose (I) is fulfilled, the value is automatically discarded, and it is not saved in the system database, the agent temporary memory, nor sent to the fuzzy agent. Once checked (I), if it is also fulfilled (II) the agent intelligently increases the waiting time to take the next value, understanding that the values are stable, and it is not necessarily a constant consultation to the sensor. In this way its activity and energy reduces consumption. The more times this situation occurs in a row, the longer the waiting time will be. In addition, the value will be stored in the temporary memory but will not be stored in the system memory or sent to the fuzzy agent. When the agent detects again a change in the measured values, it will return to its normal activity, send data to the fuzzy agent and store them in the global system database.
e x t r e m e   v a l u e x > m e a n ( X ) + s t d ( X ) · t h r e s h o l d
where x is the current measured value, X is the set of values stored in the sensor agent’s temporary memory, m e a n ( X ) is the average of the values of the set X , s t d ( X ) is the standard deviation of the values of X and t h r e s h o l d is a defined value; in this case, the value 3 has been used.

3.3. Artificial Intelilligence Module

This module will be the brain of the system. It is going to use the information collected by the previous module and transmitted by the supervisor agent to evaluate all the variables and obtain the appropriate output for the present situation. So, the agents present in this module will be described as follows:
  • Fuzzy agent: this agent will be the key to the control system. It includes a fuzzy control system that can use the information collected by the sensor agents and generate a control action that will be sent to the system. Inside it, the rules and membership functions of the different variables will be defined, so the appropriate control action can be resolved. It receives the data from the agents in the sensor module to carry out the control action. This implies that it is listening to this group of agents. However, if any of them are not sending measurements because the values do not change or because the agent has fallen, the agent will pick up the last record stored by that agent from the database. When this circumstance takes place, a message will be sent to the agent supervisor to check that the agent is still active. This agent has a periodical behavior since it will not be constantly generating an output to be applied in the heating system.
  • Control agent: the last agent is the control agent, which is responsible for setting the control action defined by the fuzzy agent and informing the supervisor agent that an action has been set in the physical system. The behavior of this agent is very simple, but its importance is crucial since it is in charge of changing the state of the system. As the agent has to be listening to the message sent from the fuzzy agent, its behavior will be cyclic and will perform its task every time it is required.

3.4. Communications between Agents

In these subsections, the behavior of the system will be explained. How agents communicate with each other will be explained in detail.
The proposed architecture is based on different modules, and every one of them is specialized to a different task or goal. However, the proposal is also based on the communication between the different modules, so they can share the results of their objectives to solve the common problem together. The communication between agents and modules is also a basic behavior of MAS.
Once the system is deployed, the first agent that starts working is the supervisor agent. Once the supervisor agent is started, its first task is to start the rest of the agents of the system. These agents include sensor agents and AI agents. Once the rest of the agents are initiated, they will begin to work as defined by their behavior. Meanwhile, the agent supervisor will periodically check that the rest of the agents are alive. If some of them have failed and have stopped being active, the agent supervisor will be in charge of activating that agent/s again. On the other hand, the sensor agents will work in the way defined in the previous section, recovering the measured values and evaluating this value to determine their action or if they should change their behavior. When the action is to send the measured values, these will be sent to the fuzzy agent.
Here, the fuzzy agent will be listening to the messages that can come from the sensor agents to obtain the values that will determine the control action to be done. If not all the values are obtained after a considerable time, the last values stored in the database will be used and the supervisor agent will be warned that something may have happened with some sensor agent. When all the values are received, the blurred control system will be initialized. The rules and membership functions will depend on the study case. Therefore, in Section 4, rules and membership functions will be explained and analyzed. Consequently, once the output is defined, the fuzzy agent will send another message to the control agent. This agent will apply the output to the physical system and once it is done, it will inform the supervisor agent through a message.
This process will be repeated as many times as desired. The most interesting approach is to run this process every, for example, five minutes to check if the environmental circumstances have changed since the last control action was performed and therefore, the control action has also changed. With this approach, the computational cost, as well as the impact on a real distributed sensor network, will be minimized since sensors will not be constantly sending data. This strategy will also reduce energy consumption since agents can sleep while this window of time is closed, decreasing the consumption of said agents as well as sensors. A lower interval is possible; however, the energy consumption of the system and sensors will increase. A higher interval is also possible, although the measured values may change during that time as it might affect the users’ comfort. Consequently, it is considered that the appropriate interval should be set to five minutes. The whole process is illustrated in Figure 2 for a better understanding.
This communication between agents also leads us to evaluate the computational cost that the proposed system has. In general terms, the computational cost can be defined as follows in Equation (2):
O = ( i = 0 n s i + m i ) + f + m c + m s
where O is the cost, i is the number of the sensor, s i is the time consumed in obtaining the data from the sensor (this value will change according to the specific sensor and communication protocol), m i is the time consumed in the message form one agent to another, f is the time consumed by the fuzzy system in obtaining the appropriate exit to the system, m c is the consumed time in the request to control agent and m s is the time consumed in the message from control agent to supervisor agent.
The cost associated to the operation of the test is the minimum possible, because, in order to carry out the system function, only those agents that are essential are used and with the lowest number of messages between agents possible. It is crucial that each agent works independently from the other in order to minimize the cost. In this way, the sensors’ agents will be collecting the data and sending it when they consider it necessary so that the fuzzy agent determines the action to be carried out and this is applied to the heater. At the end of the process it is necessary to send a message to the supervisor agent so that it is aware that the function of the system has been carried out correctly and that it is functioning normally.

4. Case Study

A case study is necessary to test and verify that the architecture presented in Section 3 can achieve the goal of the paper. Therefore, this section will explain in detail the case study followed in this research. All the considerations, assumptions, and system specifications and definitions will be mentioned in the current section.

4.1. Baseline

In order to compare the results obtained with the proposed method it is essential to equate it with a common solution of the problem. Consequently, a baseline is required. Additionally, to test and validate the proposal and possible changes in the system, the simulations will be run in a virtual environment rather than in a real one. MATLAB’s Simulink toolbox [62] has been used for this purpose.
There is a Simulink model that simulates the behavior of the house heating system [63]. The model mimics the behavior of a simple house heating system. It has a heater, a basic controller typically used in this kind of installations, and a house with four rooms and one radiator in every one of them. Each path inside the heating system is simulated as a combination of thermal convection, thermal conduction, and the thermal mass.
The controller implemented in the baseline is a proportional control that evaluates the actual temperature of the house regarding the aimed temperature, with an error of ± 2 °C, a 4 °C hysteresis. Hence if the actual temperature is higher than the aim one plus 2 °C, the controller does not open the gas valve; otherwise, if the actual temperature is lower than the aimed one minus 2 °C, it opens the valve. Equation (3) describes the controller behavior. As can be seen, the control seems to be very simple, but it is effective. Many heating controllers use this kind of controllers to satisfy the requirements of a house or building:
V g ( t ) = { 1 ,   T c < T a 2 0 ,   T c > T a + 2
where V g ( x ) is the state of the valve at moment t , T c is the current temperature, and T a is the aimed temperature.
The heater of the system receives the fuel that the valve, regulated by the aforementioned control, supplies, and the water inside the thermal system and returns the same water but hotter thanks to the boiler effect. The boiler acts under constant circumstances of humidity and air. It can transfer the heat generated by the combustion to the water thanks to a heat exchanger [64]. So, the water that leaves the heater is much hotter than the one that enters it.
As mentioned before, the model of the house has four rooms, with one radiator in each one of them. These rooms receive the influence of the outside temperature that changes over time. In this approach, the external temperature is simulated using Equation (4):
T ( t ) = A · sin ( F · t + P ) + b
where T is the temperature obtained at a specific time t , A is the amplitude of the sin function, F is the frequency (rad/s), P the phase (rad), and b the bias applied to the function.
To obtain the temperature values, the amplitude was defined to 6, the frequency to 2 · π 12 · 3600 , the phase to 0, and the bias to 5.
The radiators of the rooms transfer the heat in the water to the air. The model’s rate of heat transfer is proportional to the temperature difference between the air and the fluid, the heat transfer coefficient (100 W/m2 k), and the surface area in contact with the liquid (5 m2). Every radiator in the system shares these properties. The convective heat transfer is defined in Equation (5). Furthermore, each room exchanges heat with its environment through its exterior walls, roof, and windows. In this model, it is assumed that rooms do not exchange heat between each other. The rooms have six different types of heat transfer: roof-atmosphere convection, roof-atmosphere leakage, air-roof convection, wall-atmosphere convection, wall-atmosphere leakage, wall-roof convection, window-atmosphere convection, window-atmosphere leakage, and window-roof convection. The heat transfer is additionally defined by Equation (5) However, in this case, some considerations must be taken into account. These concerns are described in Table 2:
Q = k · A · ( T A T B )
where Q is the heat flow, k is the convection heat transfer coefficient, A the surface area, and T A and T B the temperatures of the two bodies.
Rooms, wall and window areas are defined in Table 3.
Consequently, these tables conclude the summary and explanation of the baseline used to compare the proposal presented in this article. Additionally, these tables include the Building Information Modeling (BIM) used for this study. This BIM is defined in MATLAB’s model and our proposal will use the same one to compare both prototypes under the same circumstances. Given that the proposal presented is practically a software project that collects data from sensors distributed throughout the house and that these have their own power supply system or are connected to the house’s electrical network, the system will not influence the house’s construction standards. It will be implemented in already-built houses that have a central heating system. The only aspect to be considered is how to send the on/off signal to the boiler, but since each brand can use its own standard and this study focuses on the theoretical study of the proposed method, this will not be done.

4.2. Evaluated Proposal

Once the baseline has been explained, it is time to clarify how we evaluate the proposal described in Section 3. In the case study, the evaluated proposal does not differ a lot from the baseline. The model is very similar. The only thing that changes is the control. The control will be replaced by a fuzzy controller. Moreover, the MAS proposed will be included to evaluate the proposed method. However, Simulink does not provide a multi-agent platform. Therefore, it is necessary to implement a MAS outside the Simulink software. Fortunately, MATLAB (R2019a, The MathWorks Inc., Natick, MA, USA, 2019) includes a Python API that allows the use of MATLAB’s features inside a Python program. Among these features is the ability to interact with a Simulink model prom Python code. So, the evaluated proposal, the MAS, and the fuzzy control will be built in Python and will interact with a modified version of the baseline. The following subsections will explain how the system was built for this case study.

4.2.1. MAS’ Design

As mentioned before, the MAS is designed with SPADE. All the agents described before will be included in this case study. However, there are two groups of agents that need a deeper explanation in this research.
The first group is the devices module. In Section 3, it was mentioned that the agents will be connected to a sensor via the specific protocol. Unfortunately, the simulation does not have real sensors. Therefore, the sensor agents will establish a connection with a Simulink component that simulates a real sensor. These components will measure different processes over time and the sensor agents will be able to collect these values whenever they desire. So, for this case study, sensors will be replaced by Simulink components and the sensor agents will be able to obtain the values of this component thanks to the Python MATLAB’s API. The MATLAB’s API provides access to variables stored in the workspace. Therefore, these Simulink components update the value of the workspace variables so that in this way and using the MATLAB’s API, the agents can access the current values of the simulation.
These components will simulate the values. The values will be replicated following the logic behavior of these components in the real world. The gap temperature shows the difference between the actual temperature inside the house and the desired temperature. This desired temperature is defined as a constant value, 23 °C. On the other hand, the outside temperature has to change over time. In this approach, the external temperature is simulated using Equation (4) as well.
To obtain the temperature values, the amplitude was defined to 6, the frequency to 2 · π 12 · 3600 , the phase to 0, and the bias to 5. Another measured value is the humidity, this variable is also simulated with Equation (4). In this case, the amplitude was defined to 6, frequency to 2 · π 12 · 3600 , the phase to 0, and the bias to 75; furthermore, the phase is set to π to simulate the logic behavior between outside temperature and outside humidity. The last measured value is the amount of people, in this case, the simulation is provided by random numbers in the interval [0, 10] that changes every 30 min.
The second group of agents is the ones included in the AI module. However, these agents will be explained better in the next subsection.

4.2.2. Control’s Design

It is important to describe how the control has been designed. The fuzzy control and the communication of the output to the Simulink’s model will be defined in this subsection.
The fuzzy agent will incorporate a fuzzy controller developed with the Scikit Fuzzy Python API [65]. The fuzzy model developed for this case study has four input variables and one output variable. The four inputs are related to the measured values of the sensors and the output value is the control action determined by the fuzzy logic. The fuzzy logic controller is based on Takagi-Sugeno architecture [66]. The main characteristic of this kind of fuzzy controllers is that the output of the control can be defined by the designer of the system. This kind of fuzzy system is considered to be the appropriate one for the current work since the output of the system should be “on” or “off” (one or zero). Therefore, the output of this fuzzy controller will not experience any fuzzification or defuzzification processes. On the contrary, other systems such as Mamdani assume that the output must be defuzzified, so that the relevant fuzzy sets would have to be defined and the output would be defined by one of these fuzzy sets and its value of belonging to the one that is active. This type of output is not the desired one in the proposed system, but we only want to obtain two values 0 to 1, off or on, respectively. This type of output is provided by the Takagi-Sugeno system that has been designed.
Therefore, in the designed Takagi-Sugeno system, the output does not need to be configured. However, the four inputs of the system have to be adjusted or defined to infer the fuzzy logic principles over them. So, the membership functions for each one of these inputs has to be defined. Table 4 collects all the information needed to delimit the inputs’ membership functions. But first, the four inputs have to be described. The first input is “temperature gap,” it is the difference of the aimed temperature and the current temperature value collected by the sensor agent. The second is “outside temperature,” it is the current temperature value from outside of the building. “Humidity” is the humidity outside the building, and “people” indicates the number of individuals inside the house.
Input universe refers to the space where the values of this input are going to be, although, if a value gets out of this universe, the fuzzy system can deal with it without any problems. On the other hand, input intervals refer to the different groups or fuzzy values that the input can have. The types of membership functions are defined as triangular and trapezoidal; trapezoidal functions are used in larger intervals with the aim of achieving greater membership during the whole interval, while triangular functions are selected for shorter intervals. To illustrate this information better, Figure 3 shows the definition of the membership functions:
As shown in the previous figure, these fuzzy groups represent the membership functions of the system and they define when a value is of one type or another. These fuzzy groups, combined with a series of rules, will define the behavior of the fuzzy system. Rules will evaluate the values of the measured variables and their belonging to any of the membership functions so they can obtain the output of the system. The rules defined for the current case study are defined below. They try to summarize a logic behavior based on the user’s experience and knowledge:
  • IF “temperature gap” IS “negative” OR “temperature gap” IS “zero” THEN 0
  • IF “temperature gap” IS “positive” AND “people” IS “zero” THEN 0
  • IF “temperature gap” IS “positive” AND “outside temperature” IS “very cold” THEN 1
  • IF “temperature gap” IS “positive” AND “outside temperature” IS “cold” THEN 1
  • IF “temperature gap” IS “positive” AND “people” IS “few” AND “outside temperature” IS “warm” THEN 1
  • IF “temperature gap” IS “positive” AND “people” IS “medium” AND “outside temperature” IS “warm” THEN 1
  • IF “temperature gap” IS “positive” AND “people” IS “lot” AND “outside temperature” IS “warm” THEN 0
  • IF “temperature gap” IS “positive” AND “outside temperature” IS “warm” AND “humidity” IS “high” THEN 1
  • IF “temperature gap” IS “positive” AND “outside temperature” IS “warm” AND “humidity” IS “medium” THEN 1
  • IF “temperature gap” IS “positive” AND “outside temperature” IS “warm” AND “humidity” IS “low” THEN 1
  • IF “temperature gap” IS “positive” AND “outside temperature” IS “hot” THEN 0
  • IF “temperature gap” IS “positive” AND “outside temperature” IS “very hot” THEN 0
In the previous list, 0 and 1 represent the output of the control system that is going to be applied to the physical system, off and on, respectively. With these rules, the control system infers the normal actions that users could take in their homes and buildings to promote sustainable use of central heating systems. In fuzzy control systems, the rules are usually implemented by experts; in this case study, the experts are the users of the system.
After the fuzzy agent obtains the appropriate control action, the communication will send this action to the Simulink’s component to continue the simulation. Once the actions are sent and processed by the virtual system, the sensor’s agents will measure the variables and the process continues until the simulation ends.

4.3. Simulations

After the baseline and the approach followed in this study are explained, it is time to run the simulations. However, it is also important to define the circumstances of these replications. In these subsections, these circumstances will be explained.
To test the proposed system, a deep simulation has been performed to assess the proposal during a long period. Hence, it will simulate the contaminated running of central heating for 50 h. With this approach, we will simulate the behavior and response of the proposal in almost all the possible conditions. Furthermore, it will be possible to better observe if the proposal allows for a reduction in the consumption of fuel and therefore a reduction of gas emissions to the atmosphere.

5. Results and Discussion

According to the experiments mentioned in the previous section, this segment will show the results of those experiments and the discussion of the results. The results will be divided into different subsections.

5.1. Multi-Agent System

One of the main contributions of this scientific work is the use of a MAS to coordinate different entities to achieve a common goal. The architecture proposed has shown to offer good performance in terms of communication between agents and the performance of every individual agent. The communication behavior between agents allows for the establishment of a good execution of the whole system. Thanks to the messages, the supervisor agent can control the whole system and it knows exactly when to act or send other messages. Furthermore, the MAS has shown that even if an agent fails, it can continue working with the rest of the agents without any problems. This is one of the main characteristics of MASs and the proposed system incorporates it.
Additionally, the communications between agents are done quickly and no delays have been detected during the simulation. Hence, after observing the behavior of the agents, it can be noted that the proposed multi-agent architecture seems to work perfectly in these kinds of systems and that the idea mentioned in the proposal section is confirmed now, MASs are ideal for a distributed system that aims to achieve a common goal.
To test the effectiveness of the proposed MAS, a small sensor network has been deployed, which interacts with the MAS. The sensor network has two Xiaomi NUN4019TY (humidity and temperature sensor, Xiaomi Inc., Beijing, China) and two Garza Power 430041 (presence sensor, Garza, Fuenlabrada, Spain). We established the appropriate connections with them and ran the fuzzy algorithm with the measured values of the sensors. To obtain the number of persons inside the house/building, an algorithm was deployed to interpret the presence’s sensors data. The MAS and the strategy defined to obtain the data from the sensors have demonstrated that it works perfectly in a small sensor network’s environment; this type of environment is the normal setting in homes and flats.

5.2. Fuzzy Control System

The other great contribution of this work is the proposed fuzzy system in charge of controlling the behavior of the system. The aim was to design a new controller that could be able to reduce the use of fuel and therefore to reduce the cost for the citizens. So, the results shown by the fuzzy control system will be explained in this subsection.
Firstly, once the simulation is done, it will be interesting to compare how the fuzzy controller works related to the original controller. Both controllers want to control the temperature inside the building, so it could be interesting to observe that variable. Hence, Figure 4 shows how this variable is controlled by both controllers:
The previous figure shows the temperature variation. The original controller (non-fuzzy) shows a more changeable behavior. This type of behavior may have bad consequences for the system’s users’ health due to the quick changes in temperature. On the other hand, the proposed system does not vary at all when there are people inside the house. This characteristic facilitates the users’ comfort. In Figure 4 we can also observe that the fuzzy controller also has a temperature loss during some specific moments. This behavior can be linked to a bad performance of the controller, however, in Figure 5 and Figure 6 it can be seen that this temperature loss is due to the case in which there are no people inside the building/house.
Figure 5 also shows that the fuzzy controller does not achieve the desired temperature, however, the error is stable, and the difference does not have a significant impact on users’ comfort. Therefore, we can conclude that the fuzzy controller works stably and that it does not compromise the comfort of the users.
Another important characteristic when applying a new proposal is to reduce the cost or decrease the emissions of the system. In the evaluated system, these two concepts are linked since the fuel necessary to heat the system’s water is the one responsible for gas emissions, while at the same time it is also the one responsible for the cost waste. So, it is important to evaluate the impact on the cost that the system has. This cost is obtained with the amount of fuel consumed and the price established in the baseline. To answer this question, Figure 7 is presented. In it, we can see that in just 50 h of continuous performance of the system, the proposal reduces significantly the cost of this type of system. Hence, the ROI (Return on Investment) is guaranteed.
In addition, to better illustrate the total cost of both simulations, Table 5 is included. It shows the total cost of each simulation and the average temperature over the simulation. As can be seen, the proposed system decreases the cost by $10.84. The total cost is obtained by multiplying the fuel consumption by a fixed price (0.3002 $/l) defined again by the MATLAB Simulink model. However, the mean temperature is a bit lower because of the behavior explained before where the temperature decreases when there are no people in the building. That temperature is the average temperature during the entire simulation. In the proposal, the average temperature decreases when there are no people in the house, the heating system is turned off. During those moments, the temperature inside declines. Therefore, it is normal that these moments are reflected in the calculation of the average temperature. However, during the rest of the situations in which the heating is on, the temperature remains stable.
Since the fuzzy simulation did not achieve the aimed temperature, it was decided that a second simulation of both systems should be run. This time the fuzzy proposal will have an aimed temperature of 24 °C instead of 23 °C. The non-fuzzy proposal will have an aimed temperature of 23 °C. The results of the simulation are shown in Figure 8, Figure 9, Figure 10 and Figure 11.
The fuzzy proposal retains a slight error in regards to the target temperature. However, now both systems achieve the same temperature (23 °C). The fuzzy proposal still has temperature losses due to the fuzzy rules defined when there are no individuals in the building. Additionally, Figure 11 shows the effectiveness of the proposed system related to cost and energy used reduction. This output can also be seen in Table 6. Therefore, the proposed system achieves one of its main goals: cost reduction, energy use reduction, and, consequently, the reduction in gas emissions.
The results show that the fuzzy proposed system works much better than the baseline reducing cost for the users and therefore the amount of fuel needed to feed the heating system while increasing the comfort of the users. It is true that on average the temperature is lower in the proposed system. However, this fact is due to the behavior of the proposed fuzzy system. As shown in the rules defined, several circumstances (that there are no people inside the house, the temperature outside is too high, there are too many people inside the house, etc.) force the central heating to turn off, reducing the inside temperature on some occasions. These circumstances are controlled thanks to the fact that the fuzzy logic allows us to reduce the cost and obtain one of the goals of the research.

5.3. ROI Analysis

Once the simulations are evaluated, it is also important to include a deep analysis of the ROI. Considering the costs of non-fuzzy and fuzzy simulations and the number and prices of sensors needed to implement this new solution in a real environment, we have included the ROI analysis. Table 7 shows this analysis. Both simulations achieve quick benefits. In around ten days, the users of the systems will be saving money.

6. Conclusions

In this article, a MAS for a fuzzy logic controller has been presented. Regarding the results mentioned, it was demonstrated that the proposed system can achieve the expected results and that this kind of architecture can be applied to a distributed system in the field of IoT and smart-environments. Another important assumption is that this technology can reduce gas emissions in this kind of system. Additionally, if this solution is deployed at a great scale, the gas emissions to the atmosphere in big cities will be reduced significantly. The simulation presented in the study supports this idea.
However, there are several lines of research that this article does not cover. Therefore, these will be defined as future lines of research. The most important one is to perform a MAS that can deploy several fuzzy agents instead of just one. The idea behind this is that the system will be able to control radiators in community buildings to reduce consumption and make sustainable use of the central heating in those buildings. Furthermore, it is expected that families will be able to reduce their taxes. This future line of research is important since it will automatically control the new installations of central heating in Spain.
Another action that must be considered as a future line of research is to deploy the proposal of this article in a real environment to prove if the same results can be achieved in a real situation. Furthermore, once we have deployed the system, we can collect data from other types of sensors, like windows sensors or door sensors, and add them to the fuzzy controller. By doing this, the system will be more complex.
Finally, to prove the efficiency of the MAS, it is important to test it in another kind of real environment so we can observe the behavior of the system in a different situation and validate it as a solution for a distributed system in the field of IoT. Probably a smart-city environment would fit well with the system, due to the fact that the number of the sensor will increase significantly and therefore the communications between agents will rise accordingly. This situation will determine the robustness of the proposed MAS.

Author Contributions

Conceptualization, D.M.J.-B. and Á.L.M.; methodology, D.M.J.-B.; software, D.M.J.-B.; validation, D.M.J.-B., Á.L.M., D.H.d.l.I. and J.F.D.P.; formal analysis, D.M.J.-B., Á.L.M. and D.H.d.l.I.; investigation, D.M.J.-B.; resources, D.M.J.-B.; data curation, D.M.J.-B. and Á.L.M.; writing—original draft preparation, D.M.J.-B.; writing—review and editing, Á.L.M., D.H.d.l.I., J.F.D.P. and G.V.G.; visualization, D.M.J.-B.; supervision, J.F.D.P. and G.V.G.; project administration, D.M.J.-B. and J.F.D.P.; funding acquisition, D.M.J.-B., Á.L.M. and J.F.D.P. All authors have read and agreed to the published version of the manuscript.


The research of Diego M. Jiménez-Bravo has been co-financed by the European Social Fund and Junta de Castilla y León (Operational Programme 2014–2020 for Castilla y León, EDU/574/2018 BOCYL). Álvaro Lozano research work is supported by a postdoctoral fellowship from the University of Salamanca and Banco Santander. This work has been supported by project “FuzzyHeatControl: Control automatizado de las instalaciones de calefacción central”, PC-TCUE18-20_004. Project managed by Fundación General de la Universidad de Salamanca and co-financed with Junta de Castilla y León and FEDER funds.

Conflicts of Interest

The authors declare no conflict of interest.


  1. UNITED NATIONS Climate Change Summit. Available online: (accessed on 6 March 2020).
  2. Fridays For Future. Available online: (accessed on 6 March 2020).
  3. Greta Thunberg: TIME’s Person of the Year 2019 | Time. Available online: (accessed on 6 March 2020).
  4. TIME Person of the Year 2015: Angela Merkel. Available online: (accessed on 6 March 2020).
  5. Spain Declares Climate Emergency, Gets Climate Plan Ready. Available online: (accessed on 6 March 2020).
  6. Spain: A Renewable Kingdom. Available online: (accessed on 6 March 2020).
  7. Gubbi, J.; Buyya, R.; Marusic, S.; Palaniswami, M. Internet of Things (IoT): A vision, architectural elements, and future directions. Futur. Gener. Comput. Syst. 2013, 29, 1645–1660. [Google Scholar] [CrossRef] [Green Version]
  8. Shi, W.; Cao, J.; Zhang, Q.; Li, Y.; Xu, L. Edge Computing: Vision and Challenges. IEEE Internet Things J. 2016, 3, 637–646. [Google Scholar] [CrossRef]
  9. Dillon, T.; Wu, C.; Chang, E. Cloud computing: Issues and challenges. In Proceedings of the International Conference on Advanced Information Networking and Applications (AINA), Perth, Australia, 20–23 April 2010; pp. 27–33. [Google Scholar]
  10. Liu, X.; Ansari, N. Toward Green IoT: Energy Solutions and Key Challenges. IEEE Commun. Mag. 2019, 57, 104–110. [Google Scholar] [CrossRef]
  11. Conte, G.; Morganti, G.; Perdon, A.M.; Scaradozzi, D. Multi-agent system theory for resource management in home automation systems. J. Phys. Agents 2009, 3, 15–19. [Google Scholar] [CrossRef] [Green Version]
  12. Multi-Agent System for Security Control on Industrial Environments. Available online: (accessed on 6 March 2020).
  13. Jeschke, S.; Brecher, C.; Meisen, T.; Özdemir, D.; Eschert, T. Industrial Internet of Things and Cyber Manufacturing Systems. In Industrial Internet of Things: Cybermanufacturing Systems; Jeschke, S., Brecher, C., Song, H., Rawat, D.B., Eds.; Springer: Berlin, Germany, 2017; pp. 3–19. [Google Scholar]
  14. Sethi, P.; Sarangi, S.R. Internet of Things: Architectures, Protocols, and Applications. J. Electr. Comput. Eng. 2017, 2017, 1–25. [Google Scholar] [CrossRef] [Green Version]
  15. Al-Sarawi, S.; Anbar, M.; Alieyan, K.; Alzubaidi, M. Internet of Things (IoT) communication protocols: Review. In Proceedings of the ICIT—2017 8th International Conference on Information Technology, Singapore, 27–29 December 2017; pp. 685–690. [Google Scholar]
  16. Datta, P.; Sharma, B. A survey on IoT architectures, protocols, security and smart city based applications. In Proceedings of the 8th International Conference on Computing, Communications and Networking Technologies (ICCCNT 2017), New Delhi, India, 3–5 July 2017. [Google Scholar]
  17. Wollschlaeger, M.; Sauter, T.; Jasperneite, J. The future of industrial communication: Automation networks in the era of the internet of things and industry 4.0. IEEE Ind. Electron. Mag. 2017, 11, 17–27. [Google Scholar] [CrossRef]
  18. Xu, L.D.; Xu, E.L.; Li, L. Industry 4.0: State of the art and future trends. Int. J. Prod. Res. 2018, 56, 2941–2962. [Google Scholar] [CrossRef] [Green Version]
  19. Iorga, M.; Feldman, L.; Barton, R.; Martin, M.J.; Goren, N.; Mahmoudi, C. Fog Computing Conceptual Model; NIST: Gaithersburg, MD, USA, 2018.
  20. Scheuermann, C.; Verclas, S.; Bruegge, B. Agile Factory-An Example of an Industry 4.0 Manufacturing Process. In Proceedings of the 3rd IEEE International Conference on Cyber-Physical Systems, Networks, and Applications (CPSNA 2015), Hong Kong, China, 19–21 August 2015; pp. 43–47. [Google Scholar]
  21. Schlechtendahl, J.; Keinert, M.; Kretschmer, F.; Lechler, A.; Verl, A. Making existing production systems Industry 4.0-ready: Holistic approach to the integration of existing production systems in Industry 4.0 environments. Prod. Eng. 2014, 9, 143–148. [Google Scholar] [CrossRef]
  22. Ang, J.H.; Goh, C.; Li, Y. Smart design for ships in a smart product through-life and industry 4.0 environment. In Proceedings of the 2016 IEEE Congress on Evolutionary Computation (CEC 2016), Vancouver, BC, Canada, 24–29 July 2016; pp. 5301–5308. [Google Scholar]
  23. Tao, F.; Zhang, H.; Liu, A.; Nee, A.Y.C. Digital Twin in Industry: State-of-the-Art. IEEE Trans. Ind. Inform. 2019, 15, 2405–2415. [Google Scholar] [CrossRef]
  24. Bresciani, S.; Ferraris, A.; del Giudice, M. The management of organizational ambidexterity through alliances in a new context of analysis: Internet of Things (IoT) smart city projects. Technol. Forecast. Soc. Chang. 2018, 136, 331–338. [Google Scholar] [CrossRef]
  25. Latré, S.; Leroux, P.; Coenen, T.; Braem, B.; Ballon, P.; Demeester, P. City of things: An integrated and multi-technology testbed for IoT smart city experiments. In Proceedings of the IEEE 2nd International Smart Cities Conference: Improving the Citizens Quality of Life (ISC2 2016), Trento, Italy, 12–15 September 2016. [Google Scholar]
  26. Sanchez, L.; Munoz, L.; Galache, J.A.; Stores, P.; Santana, J.R.; Gutierrez, V.; Ramdhany, R.; Gluhak, A.; Krco, S.; Theodoridis, E.; et al. SmartSantander: IoT experimentation over a smart city testbed. Comput. Netw. 2014, 61, 217–238. [Google Scholar] [CrossRef] [Green Version]
  27. Gaikwad, P.P.; Gabhane, J.P.; Golait, S.S. A survey based on Smart Homes system using Internet-of-Things. In Proceedings of the 4th IEEE Sponsored International Conference on Computation of Power, Energy, Information and Communication (ICCPEIC 2015), Melmaruvathur, India, 22–23 April 2015; pp. 330–335. [Google Scholar]
  28. Ghayvat, H.; Mukhopadhyay, S.; Gui, X.; Suryadevara, N. WSN- and IOT-Based Smart Homes and Their Extension to Smart Buildings. Sensors 2015, 15, 10350–10379. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  29. Mano, L.Y.; Faical, B.S.; Nakamura, L.H.V.; Gomes, P.H.; Libralon, G.L.; Meneguete, R.I.; Filho, G.P.R.; Giancristofaro, G.T.; Pessin, G.; Krishnamachari, B.; et al. Exploiting IoT technologies for enhancing Health Smart Homes through patient identification and emotion recognition. Comput. Commun. 2016, 89–90, 178–190. [Google Scholar] [CrossRef]
  30. Datta, S.K.; Bonnet, C.; Gyrard, A.; da Costa, R.P.F.; Boudaoud, K. Applying Internet of Things for personalized healthcare in smart homes. In Proceedings of the 2015 24th Wireless and Optical Communication Conference (WOCC 2015), Taipei, Taiwan, 23–24 October 2015; pp. 164–169. [Google Scholar]
  31. Chang, X.; Li, W.; Xia, C.; Coa, J.; Khan, S.U.; Zomoya, A.Y. From Insight to Impact: Building a Sustainable Edge Computing Platform for Smart Homes. In Proceedings of the International Conference on Parallel and Distributed Systems—ICPADS, 2019, Sentosa, Singapore, 11–13 December 2018; Volume 2018-December, pp. 928–936. [Google Scholar]
  32. Iqbal, J.; Khan, M.; Talha, M.; Farman, H.; Jan, B.; Muhammad, A.; Khattak, H.A. A generic internet of things architecture for controlling electrical energy consumption in smart homes. Sustain. Cities Soc. 2018, 43, 443–450. [Google Scholar] [CrossRef]
  33. Karmakar, G.; Roy, S.; Chattopadhyay, G.; Xiao, Z. Dynamically controlling exterior and interior window coverings through IoT for environmental friendly smart homes. In Proceedings of the 2017 IEEE International Conference on Mechatronics (ICM 2017) 2017, Gippsland, Australia, 13–15 February 2017; pp. 487–491. [Google Scholar]
  34. Guan, Y.; Vasquez, J.C.; Guerrero, J.M.; Samovich, N.; Vanya, S.; Oravec, V.; Garcia-Castro, R.; Serena, F.; Poveda-Villalon, M.; Radojicic, C.; et al. An open virtual neighbourhood network to connect IoT infrastructures and smart objects—Vicinity: IoT enables interoperability as a service. In Proceedings of the GIoTS 2017—Global Internet of Things Summit, Geneva, Swizerland, 6–9 June 2017. [Google Scholar]
  35. Ang, K.H.; Chong, G.; Li, Y. PID control system analysis, design, and technology. IEEE Trans. Control. Syst. Technol. 2005, 13, 559–576. [Google Scholar]
  36. Zadeh, L.A. Fuzzy sets. Inf. Control. 1965, 8, 338–353. [Google Scholar] [CrossRef] [Green Version]
  37. Quiroga, L.A.M.; Read, J.S.B.; Callejas, R.L.; de los Rios, J.A.S.; Eguiluz, R.P.; Ramirez, F.J.J. Adaptive fuzzy control system for a squirrel cage induction motor. IEEE Lat. Am. Trans. 2017, 15, 795–805. [Google Scholar]
  38. Garg, H.; Kaushal, E.G. Traffic Lights Control System for Indian Cities Using WSN and Fuzzy Control. Int. Res. J. Eng. Technol. 2017, 4, 2587. [Google Scholar] [CrossRef] [Green Version]
  39. Huo, J.; Chan, F.T.S.; Lee, C.K.M.; Strandhagen, J.O.; Niu, B. Smart control of the assembly process with a fuzzy control system in the context of Industry 4.0. Adv. Eng. Inform. 2020, 43, 101031. [Google Scholar] [CrossRef]
  40. Azaza, M.; Tanougast, C.; Fabrizio, E.; Mami, A. Smart greenhouse fuzzy logic based control system enhanced with wireless data monitoring. ISA Trans. 2016, 61, 297–307. [Google Scholar] [CrossRef]
  41. Altrock, C.v.; Arend, H.O.; Krause, B.; Steffens, C.; Behrens-Römmler, E. Adaptive fuzzy control applied to home heating system. Fuzzy Sets Syst. 1994, 61, 29–35. [Google Scholar] [CrossRef]
  42. Mendi, F.; Boran, K.; Kulekci, M.K. Fuzzy controlled central heating system. Int. J. Energy Res. 2002, 26, 1313–1322. [Google Scholar] [CrossRef]
  43. Kobersi, I.S.; Finaev, V.I.; Almasani, S.A.; Abdo, K.W.A. Control of the heating system with fuzzy logic. World Appl. Sci. J. 2013, 23, 1441–1447. [Google Scholar]
  44. Palau, A.S.; Dhada, M.H.; Bakliwal, K.; Parlikad, A.K. An Industrial Multi Agent System for real-time distributed collaborative prognostics. Eng. Appl. Artif. Intell. 2019, 85, 590–606. [Google Scholar] [CrossRef]
  45. Francisco, M.; Mezquita, Y.; Revollar, S.; Vega, P.; de Paz, J.F. Multi-agent distributed model predictive control with fuzzy negotiation. Expert Syst. Appl. 2019, 129, 68–83. [Google Scholar] [CrossRef]
  46. Maleš, L.; Marčetić, D.; Ribarić, S. A multi-agent dynamic system for robust multi-face tracking. Expert Syst. Appl. 2019, 126, 246–264. [Google Scholar] [CrossRef]
  47. Hedjazi, D.; Layachi, F.; Boubiche, D.E. A multi-agent system for distributed maintenance scheduling. Comput. Electr. Eng. 2019, 77, 1–11. [Google Scholar] [CrossRef]
  48. Wang, S.; Li, D.; Zhang, C. Towards smart factory for industry 4.0: A self-organized multi-agent system with big data based feedback and coordination. Comput. Netw. 2016, 101, 158–168. [Google Scholar] [CrossRef] [Green Version]
  49. Modoni, G.E.; Veniero, M.; Trombetta, A.; Sacco, M.; Clemente, S. Semantic based events signaling for AAL systems. J. Ambient Intell. Humaniz. Comput. 2018, 9, 1311–1325. [Google Scholar] [CrossRef]
  50. Karavas, C.-S.; Kyriakarakos, G.; Arvanitis, K.G.; Papadakis, G. A multi-agent decentralized energy management system based on distributed intelligence for the design and control of autonomous polygeneration microgrids. Energy Convers. Manag. 2015, 103, 166–179. [Google Scholar] [CrossRef]
  51. Ayala, I.; Amor, M.; Horcas, J.-M.; Fuentes, L. A goal-driven software product line approach for evolving multi-agent systems in the Internet of Things. Knowl. Based Syst. 2019, 184, 104883. [Google Scholar] [CrossRef]
  52. Ogonowski, S. Modeling of the heating system in small building for control. Energy Build. 2010, 42, 1510–1516. [Google Scholar] [CrossRef]
  53. Welcome to SPADE’s Documentation!—SPADE 3.1.4 Documentation. Available online: (accessed on 12 February 2020).
  54. Palanca, J. GitHub—javipalanca/spade: Smart Python Agent Development Environment. Available online: (accessed on 12 February 2020).
  55. Gregori, M.E.; Cámara, J.P.; Bada, G.A. A jabber-based multi-agent system platform. In Proceedings of the International Conference on Autonomous Agents, Hakodate, Japan, 8–12 May 2006; Volume 2006, pp. 1282–1284. [Google Scholar]
  56. Bellifemine, F.; Poggi, A.; Rimassa, G. Developing multi-agent systemswith a FIPA-compliant agent framework. Softw. Pract. Exp. 2001, 31, 103–128. [Google Scholar] [CrossRef]
  57. Zato, C.; Villarrubia, G.; Sánchez, A.; Barri, I.; Rubión, E.; Fernández, A.; Rebate, C.; Cabo, J.A.; Álamos, T.; Sanz, J.; et al. PANGEA—Platform for automatic coNstruction of orGanizations of intElligent agents. Adv. Intell. Soft Comput. 2012, 151, 229–239. [Google Scholar]
  58. Villarrubia, G.; de Paz, J.F.; la Iglesia, D.H.D.; Bajo, J. Combining Multi-Agent Systems and Wireless Sensor Networks for Monitoring Crop Irrigation. Sensors 2017, 17, 1775. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  59. Welcome to Aiomas’ Documentation!—Aiomas 2.0.1 Documentation. Available online: (accessed on 12 March 2020).
  60. osBrain—0.6.5—osBrain 0.6.5 documentation. Available online: (accessed on 12 March 2020).
  61. Bellifemine, F.; Bergenti, F.; Caire, G.; Poggi, A. Jade—A Java Agent Development Framework; Springer: Boston, MA, USA, 2005; pp. 125–147. [Google Scholar]
  62. Simulink—Simulation and Model-Based Design—MATLAB & Simulink. Available online: (accessed on 19 February 2020).
  63. House Heating System—MATLAB & Simulink—MathWorks España. Available online: (accessed on 19 February 2020).
  64. Heat Exchanger for Systems With Thermal Liquid and Controlled Flows—MATLAB—MathWorks España. Available online: (accessed on 22 February 2020).
  65. Skfuzzy 0.2 docs—skfuzzy v0.2 docs. Available online: (accessed on 24 February 2020).
  66. Angelov, P.P.; Filev, D.P. An Approach to Online Identification of Takagi-Sugeno Fuzzy Models. IEEE Trans. Syst. Man Cybern. B Cybern. 2004, 34, 484–498. [Google Scholar] [CrossRef] [PubMed] [Green Version]
Figure 1. Proposed multi-agent system.
Figure 1. Proposed multi-agent system.
Applsci 10 04057 g001
Figure 2. Communication behavior.
Figure 2. Communication behavior.
Applsci 10 04057 g002
Figure 3. Membership functions. (a) Temperature gap’s membership functions, (b) outside temperature’s membership functions, (c) humidity’s membership functions, (d) people’s membership functions.
Figure 3. Membership functions. (a) Temperature gap’s membership functions, (b) outside temperature’s membership functions, (c) humidity’s membership functions, (d) people’s membership functions.
Applsci 10 04057 g003
Figure 4. Temperature variation with the different controllers.
Figure 4. Temperature variation with the different controllers.
Applsci 10 04057 g004
Figure 5. Fuzzy inputs variation.
Figure 5. Fuzzy inputs variation.
Applsci 10 04057 g005
Figure 6. Humidity fuzzy input variation.
Figure 6. Humidity fuzzy input variation.
Applsci 10 04057 g006
Figure 7. Cost evolution.
Figure 7. Cost evolution.
Applsci 10 04057 g007
Figure 8. Temperature variation with the different controllers in the second simulation.
Figure 8. Temperature variation with the different controllers in the second simulation.
Applsci 10 04057 g008
Figure 9. Fuzzy inputs variation in the second simulation.
Figure 9. Fuzzy inputs variation in the second simulation.
Applsci 10 04057 g009
Figure 10. Fuzzy inputs variation in the second simulation.
Figure 10. Fuzzy inputs variation in the second simulation.
Applsci 10 04057 g010
Figure 11. Cost evolution in the second simulation.
Figure 11. Cost evolution in the second simulation.
Applsci 10 04057 g011
Table 1. Studies comparison.
Table 1. Studies comparison.
StudyHas MASCollects Sensors DataUses Fuzzy Logic
This study
Table 2. Heat transfer convection coefficients.
Table 2. Heat transfer convection coefficients.
Heat TransferConvection Heat Transfer Coefficient (W/(m2 k))Surface Area (m2)
Roof-atmosphere convection3875.188
Roof-atmosphere leakage3875.188 · 0.1
Air-roof convection3875.188
Wall-atmosphere convection34Room’s wall area
Wall-atmosphere leakage34Room’s wall area · 0.15
Wall-roof convection34Room’s wall area
Window-atmosphere convection32Room’s window area
Window-atmosphere leakage32Room’s window area · 0.2
Window-roof convection32Room’s window area
Table 3. Rooms, wall and window areas.
Table 3. Rooms, wall and window areas.
Room NumberWall Area (m2)Window Area (m2)
Table 4. Input membership functions definition.
Table 4. Input membership functions definition.
InputInput UniverseInput IntervalsMembership Functions’ Type
Temperature gap[−10, 10]Negative[−10, −8, −2, −0.5]Trapezoidal
Zero[−1, 0, 1]Triangular
Positive[0.5, 2, 8, 10]Trapezoidal
Outside temperature[−46.25, 74]Very cold[−46.25, −15, 5]Triangular
Cold[3, 9, 14]Triangular
Warm[14, 17, 20]Triangular
Hot[19, 23, 27]Triangular
Very hot[26, 50, 74]Triangular
Humidity[−41.67, 140]Low[−41.67, 0, 30]Triangular
Medium[20, 40, 60, 80]Trapezoidal
High[70, 100, 140]Triangular
People[0, 15]Zero[0, 0, 1]Triangular
Few[0, 3, 6]Triangular
Medium[4, 5, 7, 8]Trapezoidal
Lot[7, 10, 13]Triangular
Table 5. Simulations comparation.
Table 5. Simulations comparation.
Non-fuzzyMean temperature23.20 °C
Cost65.35 $
FuzzyMean temperature20.76 °C
Cost54.51 $
Table 6. Two simulations comparation.
Table 6. Two simulations comparation.
Non-fuzzyMean temperature23.20 °C
Cost65.35 $
FuzzyMean temperature20.89 °C
Cost55.00 $
Table 7. Return on investment (ROI) analysis.
Table 7. Return on investment (ROI) analysis.
SimulationSensorsPriceNumber of SensorsTotal CostROI (Days)
Fuzzy #1Xiaomi NUN4019TY14.05 $228.01 $9.93
Garza Power 43004111.84 $223.68 $
Fuzzy #2Xiaomi NUN4019TY14.05 $228.01 $10.40
Garza Power 43004111.84 $223.68 $

Share and Cite

MDPI and ACS Style

Jiménez-Bravo, D.M.; Lozano Murciego, Á.; de la Iglesia, D.H.; De Paz, J.F.; Villarrubia González, G. Central Heating Cost Optimization for Smart-Homes with Fuzzy Logic and a Multi-Agent Architecture. Appl. Sci. 2020, 10, 4057.

AMA Style

Jiménez-Bravo DM, Lozano Murciego Á, de la Iglesia DH, De Paz JF, Villarrubia González G. Central Heating Cost Optimization for Smart-Homes with Fuzzy Logic and a Multi-Agent Architecture. Applied Sciences. 2020; 10(12):4057.

Chicago/Turabian Style

Jiménez-Bravo, Diego M., Álvaro Lozano Murciego, Daniel H. de la Iglesia, Juan F. De Paz, and Gabriel Villarrubia González. 2020. "Central Heating Cost Optimization for Smart-Homes with Fuzzy Logic and a Multi-Agent Architecture" Applied Sciences 10, no. 12: 4057.

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop