1. Introduction
With the fast development of infrastructure and information technology, the IoT has become a promising field in the domain of global information and communication technology. Several industries have integrated the concept of the IoT into their traditional products and services to facilitate their use by consumers. In addition, the practice and scientific fields of the ICT domain have also changed. Previous studies have shown that the IoT has significantly influenced the overall structure, business philosophy, and future direction of the industry [
1]. Current research is also looking at the smart home environment, one of the most promising environments for the adoption and employing of the IoT [
2].
A smart home is one of the applications of the IoT, which is the connectivity of physical objects that allows a digital device, sensor, application, and network communication inside a home [
3]. Many definitions have been used to design and define smart homes. Definitions vary depending on the point of view. The author [
4] describes a smart home as a user armed with a technology of computing and information, which inference and reacts to the requirement of the residents, trying to improve their living experiences such as convenience, comfort, and security by the control system within the home environment and connections to the world beyond. The author [
5] introduces a smart home as a combination of every service within a home through adopting a common internet protocol. The system provides an intelligent ability and flexibility to assures the users with a secure, economic, and comfortable life at home. The author [
6] explain smart homes are a building that armed with sensors and actuators. The control devices could be ventilation, lighting, heating, air conditioning. There is a control system called “gateways”, which provides communication ability to connect switches and sensors. The control system develops a user interface that allows consumers to interact with the system through a smartphone, a tablet, or a laptop.
With the advancement of technology, more and more people are working at home and wherever they feel comfortable place [
7]. Since the mood of the residents and productivity of the employees are influenced by the quality of the place where they working and living, thermal comfort management is an important task [
8]. There are studies to implement a smart home control system using the IoT and microcontrollers to manage the attributes of the environment. It detects and controls the home environment through IoT devices, and monitors manage environmental changes through mobile devices or web pages. The study [
9] develops remote and microcontrollers with Android mobile phones to deploy a control system on Arduino Uno and provide connectivity through Wifi to create a smart home control system. The system provides capabilities such as turning lights on and off, opening and closing the door of the home, turning faucets on and off, and monitoring the condition of the house via video surveillance. The test results of home prototypes with Android mobile phones show us that the manage distance of household electronic devices is up to 150 m, and media can directly monitor the condition of the house through CCTV at a distance of monitor up to 100 m. Research [
10] is working to make their homes environmentally friendly. The system enables users to manage energy usage and decrease cost by controlling light, watering, and usage monitoring. Mobility and smartphone technology provides users the ability to manage their home electronic devices through smartphones. The remote devices control enables users to complete manages before going home. The proposed home control system prototype allows users to remotely turn on or off any device of the IoT via an improved solar charger. However, the IoT is typically characterized by widely distributed devices with limited processing capabilities and storage. These IoT devices encounter issues regarding performance, reliability, privacy, and security [
11]. In addition, it lacks an automation function that monitors the indoor environment of a smart home in real-time to maintain an optimized environment for the occupant.
There is a paradigm that encompasses a huge network with unlimited repository capacity and computing power, which is called cloud computing. In addition, it provides flexibility to the data managed by cloud computing through dynamic data combinations from different resources of data [
12]. The IoT has challenges with reliability, security, privacy, and performance that are raised by limited possibilities such as computing power and storage. The combination of IoT with cloud computing is a solution to deal with most of the issues [
13]. In addition, the cloud is user-friendly and reduces costs for end-users who use applications and services. With the cloud, the process of IoT data collection and processing is simplified, and it provides fast and low-cost setup and integration for comprehensive data treating and provisioning [
14]. The research [
15] suggests using several IoT devices with some digital assistants provided by Amazon, Google, Apple, or Microsoft to receive voice commands of people who have physical disabilities to manage the smart home devices. The research [
16] introduces a small house IoT convection device with the implemented system which provides remote control. To provide a comfortable environment to the resident, the control module collects data from sensors and residents to calculate optimized environment parameters, and adopt the results to the IoT convection system. Cloud computing is used to store all the data collected from IoT sensors and produce optimal parameters for thermal comfort inside the home. The system enables users to adjust the temperature of a smart home not only from a smartphone or web page but also from the local home networking system. However, security is a problem in the integration of IoT and cloud computing. Since the IoT devices and cloud-connected by the internet, there are many possibilities of attacks on both the IoT devices and cloud side [
17]. In the context of IoT, encryption can be used to maintain data confidentiality and integrity. However, with the limited capabilities, insider attacks are hard to resolve by the IoT [
18]. With constrained bandwidth for transfer data, cloud computing with centralized architectures has a problem in computing and analyzing the huge data gathered from IoT sensors [
19].
In this paper, we propose a thermal comfort considering optimization scheme based on edge computing using the PSO algorithm for efficient thermal comfort control in a smart home environment. We integrate IoT with edge computing to extend the resources of the IoT devices. Edge computing assists computing and storing resources with reliable connectivity close to the IoT devices. We use EdgeX as an edge computing platform to develop a PMV-based optimization engine with a PSO algorithm to generate the resident’s friendly environment parameter and rules engine to detects the environmental change of the smart home in real-time to maintain the indoor environment thermal comfortable.
The following is our contributions:
We developed an autonomous thermal comfort maintenance system through the integration of the PSO algorithm and the PMV model for a smart home.
We overcome the shortcoming of IoT devices by using edge computing.
The rest of this paper is structured as follows. In
Section 2, we explored research related to edge computing and research related to optimization. In
Section 3, the design of the smart home space and environment optimization scheme for efficient thermal comfort control is presented. In
Section 4, introduces the development environment and experimental results. The evaluation results are presented in
Section 5. Concludes our work in
Section 6.
2. Related Works
Smart homes communicate with a lot of electronic home appliances based on IoT to support residents effectively. All the IoT devices in smart homes would interoperate with one another in the ideal future. The IoT-based smart home paradigm has significantly influenced the quality of human life by enables communications to everybody regardless of space and time [
4]. The connected smart home appliances support an opportunity for the occupant of a smart home to effectively control their energy consumption while improving experience and comfort [
20]. The automated control system has the possibility to enhance the experience of life and facilitate independent living [
21]. Users can benefit from maintaining a convenient living environment or reducing energy consumption through a smart home, but at the same time, there are shortcomings. Various standards of IoT devices and their dependence on the cloud affect the performance of smart homes [
22].
Edge computing is a promising technology that provides sufficient connectivity and stable computing power in terms of smart home applications [
23]. The advent of the edge computing paradigm is the achievement of low latency, a bandwidth-efficient goal that can not only implement processes but also process large amounts of data at the network edge [
24]. Edge computing supports compute and storage resources by providing reliable connections near IoT devices. Edge computing has several advantages over cloud computing. First, edge computing supports lower connection costs, by reducing data transmission and storing data locally [
25]. Second, edge computing provides better security because less sensitive information is sent to cloud servers. In addition, it provides a reliable and uninterrupted network connection, more specifically, the local data processing and storage of IoT applications consume less bandwidth [
26]. The study [
27] introduces an edge computing platform-dependent smart home power demand inferencing system. The system uses an electric meter as a sensor to collect data to forecast the next day’s power demand. The system integrates with edge computing to provide capabilities such as collecting power usage data in real-time, improving data privacy, fast processing, low latency, and sufficient computing resource. Besides, using edge computing instead of cloud to offloading tasks to reduce bandwidth and response time. To satisfy the smart home application and power control, the study [
28] proposes a sustainable edge computing-based power controlling framework. the purpose of this framework is to reduce the electric cost while making full use of renewable energy. The framework was developed with tiny and affordable computers. The study [
29] using multiple microcontrollers to design an edge gateway for providing enhanced computing power to the IoT devices. With the enhanced computing power of the gateway, the industrial IoT system reduces the delay time of transferring the information to the cloud and decreases the response time of communication with IoT nodes. The edge gateway selects low-cost microcontrollers to conduct distributed computing that further shortens the power usage.
There are the following frameworks to implement edge computing. Microsoft Azure introduce Azure IoT Edge to develop edge computing. To simplify the implementation of services of image recognition and machine learning and other services, there are many functionalities provided such as Azure ML, Azure stream analytics, and Azure functions. The edge nodes could be any devices supporting computing capabilities [
30]. AT&T initiate an ONF project CORD [
31] to use the resource of network infrastructures to construct edge data centers. Network equipment providers offer closed proprietary integrated network infrastructure systems. Due to the reliance on network equipment suppliers, networking opportunities with network operators are difficult to manage. Therefore, computer and network resources are wasted. CORD utilizes the wasted resource of network infrastructures to construct data centers through network function virtualization and software-defined networks functionalities. It uses reconstructed data centers to provide clouds capabilities at the edge of the network. EdgeX edge computing platform is a vendor-neutral open source for implementing an edge computing paradigm. Since EdgeX is a vendor-neutral platform, it could be installed on any device that provides computing resources including routers, gateways, and other nodes. EdgeX is implemented by dividing functions into several layers. In particular, in the connection layer, there are microservices implemented with various protocols, and by providing a framework, users can easily implement connection services using the desired connection protocol. In the development language, not only Java but also C and Go lang languages can be used to implement services [
32]. When comparing the investigated platforms, EdgeX was selected as the development platform, which can satisfy the requirements of heterogeneous devices of the IoT devices without depending on the development language as well as on the device.
The optimization problems consist of finding the best solution from all possible solutions that can be solved by optimization functions. There are exact and approximate optimization methods [
33]. The small-scale optimization problems are suitable with exact methods. Instead, the high-dimensional optimization problems are suitable with approximate methods [
34]. Due to their performance in investigating high dimensional search spaces, approximation methods are more effective than precision methods in solving the problem of power scheduling in a smart home. The approximation functions are comprising approximation algorithms and heuristic/metaheuristic algorithms [
35]. Some studies implement a smart home energy management system using a metaheuristic algorithm to optimize the power consumption of home appliances. The author [
36] introduces Binary PSO (BPSO) and Genetic Algorithm (GA) to optimize Peak-to-Average Ratio (PAR) and Electricity Bill (EB). The total EB is calculated with the time of use pricing mechanism in the scheduling tasks for the executions of smart home appliances for a day. The author [
37] presents a home energy management system to deficiently control home appliances. The objective of the system reduces EB while peak periods. To generate an appropriate scheduling scheme for home appliances the PSO and GA metaheuristic optimization algorithms are adopted. The author [
38] uses the BPSO optimization algorithm to balance the working capacity in a smart home. The power is supported by traditional and green energy. The optimization problem is aim at minimizing the EB and maximizing the power consumption of green energy. The researchers are considering user comfort level as one of the objectives of optimization problems. The delay time rate of the executing for actuators is used to evaluate the user comfort level [
39]. However, the authors ignore the user’s thermal comfort by focusing on minimizing energy use and maximizing user satisfaction, i.e., the running time of home appliances.
The PSO is a promising optimization algorithm. Due to its ease of implementation, high convergence speed, parallel operation, it has been employed by a variety of applications [
38]. To satisfy resident thermal comfort in smart homes, we select the PSO algorithm to develop our proposed PMV based optimization scheme for efficient thermal comfort control in a smart home environment.
3. Design of Smart Home Space and Environment Optimization Scheme for Efficient Thermal Comfort Control
Due to the continuous development of the Internet of Things, people’s living environments are greatly affected. In particular, the study of the smart home is transforming the house into a more intelligent and smarter object rather than a simple living environment. Through smart homes, people are benefiting from the customized housing environment in the popular housing environment. In order to provide a residential environment customized for resident thermal comfort, we propose an environment optimization scheme based on edge computing using PSO for efficient thermal comfort control in resident space. The proposed housing environment was designed as follows.
As shown in the following
Figure 1, the proposed system consists of edge computing and a smart home environment component. The smart home environment is a space where the occupant lives. The environment is equipped with temperature, humidity sensors, and heating actuators. Temperature sensors are installed both inside and outside the house to collects temperature information around the house. Similarly, humidity sensors are used to collect information about the humidity around the house. The edge computing components connect with sensors and actuators via the internet. The smart home-related software services are located on the edge computing component. The service consists of three layers. The devices connectivity layer provides a connection to IoT devices, the core services layer conducts supporting services, and the environment optimization services are located on the top of the layers.
To provide the best living environment to users, we propose the following system structure. It consists of three tiers: smart home, IoT device, and edge computing platform.
Since it is not possible to build a smart home physical environment, we design a smart home environment emulator as follows. The smart home environment emulator consists of an indoor environment inference model, a power inference model, an outdoor environment generator, and a smart home environment data. The smart home emulator trained an indoor environment inference model based on the smart home environment data to generate the parameters of the indoor home environment. In response to the data transmitted from the actuator, it outputs the indoor home environment data for the next period. Also, the power inference model is trained with the LSTM deep learning algorithm based on smart home environment data. Based on the external input data, the energy used in the next period is output. The outdoor environment data is extracted based on the smart home environment data. All data is input to the edge computing platform through the sensors of the IoT devices layer.
IoT devices are directly connected to the smart home and serve to transfer data between the edge computing platform and the smart home. The edge computing platform is running services to provide a suitable living environment for residents. It mainly includes the EdgeX framework and optimization engine. Core data stores data input from IoT devices and transmits it to the rule engine at the same time. The rule engine compares it with a predefined rule and, if matched, proceeds with a corresponding reaction. EdgeX framework detects environmental changes through the rules engine. Core commands are responsible for sending commands to IoT devices. To optimize the thermal comfortable indoor environment parameters, the optimization engine initializes a population of candidate solutions based on data that feed on the rules engine and updating these candidates around in the search space according to the best PMV level over the particle’s attributes such as velocity and position. With each iteration, each particle is updated by its local best position, but it is also guided to the best position in the search space and these positions are updated as other particles find better positions. Finally, it prints out the optimal temperature and humidity values to the rules engine. The detailed information please refer to
Figure 2.
The well-known thermal comfort model PMV [
40] is developed in 1970 and employed by Standard 55 of ASHRAE [
41]. To design a ventilation system and evaluate acceptable indoor air quality, the standard is adopted. The thermal comfort level is ranging from −3 to 3 to represent the thermal response of occupants such as cold, cool, slightly cool, neutral, slightly warm, warm, and hot. The PMV level is influenced by environmental factors and vital factors such as air temperature, mean radiant temperature, relative humidity, air velocity, metabolic rate, and clothing insulation. The corresponding comfort level takes the form of the regression function.
In this paper, we use the following features to training the PMV inference linear regression model. There are environmental features such as indoor air temperature (Top), relative humidity (Rh), outdoor temperature (Tout) as well as personal features like clothing insulation (Clo) and metabolic rates of activity (MET). The factors of the PMV inference model are presented in
Table 1.
For the convergence of the PMV inference linear regression model, we use the stochastic gradient descent scheme (SGD). The SGD is an iterative function to optimize an objective function with suitable smoothness properties. Linear regression is machine learning which trying to minimizing a loss function that has the form of a sum:
In the formula, for minimizing
, the parameter
is to be estimated. The
ith observation from the dataset (for training) is associated with every summand
. The following formula is adopted to perform a standard gradient descent method:
The is called the learning rate and affects the convergence rate of machine learning. In general, the evaluation of the summation gradient may require an expensive evaluation of the gradients of all added functions. If the training set is large and there is no simple formula, the sum of the evaluation gradients becomes very expensive because the evaluation gradient has to evaluate the gradients of all added functions. To save the computational cost of each iteration, the stochastic gradient descent samples a subset of the added function at each step. This is very effective for large-scale machine learning problems.
We integrate the PSO mechanism with the PMV model to find out the comfortable temperature and humidity of the indoor environment for the occupant. PSO iteratively improves a candidate solution with a given measure of quality to optimize a problem. To optimize a problem, it initializes a population of candidate solutions, here dubbed particles, and updating these candidates around in the search space according to a given formula over the particle’s attributes such as velocity and position. The movement of each particle is influenced by its local best position, but it is also guided to the best position in the search space and these positions are updated as other particles find better positions.
We instance a PMV model as pmv and initialize target thermal comfort level and target error as target and target-error accordingly. We initialize the
as the number of particles in the swarm, each having a position
in the search space and a velocity
. The
is Initialized with a random vector from current temperature and humidity that is feed from a smart home. The
are the best-known position of particle
and the
be the best-known position of the entire swarm. The particles represent the candidate solution which is the comfortable temperature and humidity. With the iteration, each particle would have a thermal comfort level (TCL) through the PMV model. To find the best environmental variable under a termination criterion,
or
compares the distance from the target value in each iteration and substitutes a closer value. The break criterion would be a number of iteration or a condition that the PSO finds the best environment parameter. The particles and velocity are updated at the end of an iteration through a simple formula.
Figure 3, introduces the PSO algorithm of PMV based optimization scheme.
To evaluate the performance of our proposed system, an experiment is conducted according to the following procedure. First, in the smart home environment emulator, environment parameters request current data from smart home environment data. The smart home environment data includes ts indicating the order, it and ih indicating the indoor temperature and humidity, and ot and oh indicating the external environment temperature and humidity. Finally, power data used to maintain the environment is included. The requested data is delivered as an event to the core data of the edge computing platform. Core data stores the received data and then publishes it as an event for the rules engine to process. The rule engine detects events and maps them to the registered rules. After mapping, processing proceeds according to the rules. Here, the optimal environmental data is requested based on the currently collected data through the optimization engine. The optimized data is transmitted back to the smart home environment emulator. Based on the optimization data, the smart home environment uses the power inference model, the indoor environment inference model, and the outdoor environment generator to generate the indoor temperature and humidity at the next time, the energy used, and the outdoor temperature. Finally, it passes back to the edge computing platform to get back the optimal parameters. This cycle goes 96 times.
Figure 4, illustrates the sequence diagram of the proposed system operation for efficient thermal comfort in the smart home.
4. Implementation and Result
The structure of our proposed system is implemented as shown in
Figure 5. Indoor or outdoor data is generated in a virtual smart home environment, and the generated data is transmitted to the edge computing platform by sensors, which are IoT devices. The data collected from sensors would feed to the optimization engine as input. The optimization engine returns the optimum temperature and humidity for the current environment state based on the temperature and humidity which is input from sensors. Finally, the optimal temperature and humidity are transferred to the actuator, which is an IoT device, and applied to the virtual smart home environment. By repeating the above procedure, it is always executed to keep the virtual smart home environment in an optimal state.
Our proposed system was implemented in the following development environment. To better understand and reflect the patterns of given environmental data, we developed PMV inference models, Power inference models, and Indoor environment inference models using the TensorFlow platform and Python language. The PSO algorithm based on the PMV inference model that optimizes the user’s appropriate environment temperature and humidity was also developed based on the Python language. The rule engine is implemented based on Java to detect changes in the environment of the smart home in real-time and respond according to appropriate rules. The overall development was carried out using a Windows-based desktop. Refer to
Table 2 for specific development environment settings.
Figure 6, presents the source code of implemented PMV based PSO algorithm. The PSO algorithm has been implemented in several classes. The Particle class at line 5 is a set of optimum temperature and humidity for our purposes. At the beginning of the program execution, values are generated randomly based on the current temperature and humidity mentioned in line 7. Depending on the value of the variable called velocity, the value is repeatedly updated until the optimal value is found. The Space class at line 15 is responsible for finding the optimal value for each loop. In the fitness function at line 23, we find the values of temperature and humidity that generate the optimal thermal comfort index by finding the PMV for the parameters of the temperature/humidity set in the particle. Lastly, the PSOAlgorithm class at line 51 is a class where the main function to find the optimal value using space and particles is located. When the PSOAlgorithm class is created, the initialization function is executed. The number of iterations, the error range, the number of particles, the target value, and the current temperature and humidity is entered as parameters. Here, the number of iterations refers to the number of attempts to find the optimal environmental variable, the target value refers to the optimal environmental variable to be found, that is, the thermal comfort level and the error range expresses the allowable error value. When the optimization function in line 59 is called, the Space class and particles are initialized by the number of particles and the temperature and humidity values. And the while function is executed, the break criterion of the while function would be a number of iteration or a condition that the PSO finds the best environment parameter.
5. Performance and Evaluation
For evaluating our proposed resident environment maintenance with thermal comfort index based on PSO optimization scheme in smart homes. We conduct a comparison between the real data with optimized data. We experiment with our proposed system with one day of the ORNL dataset [
42]. The ORNL dataset was sensing from a home where it is located in Campbell, United States. The dataset is composed of 35,040 rows and several sensing data of indoor and outdoor climate such as temperature and humidity. We predict the PMV of thermal comfort, which is inference with the optimized temperature and humidity for maintenance house thermal environment. Once the indoor environment data is provided from the simulated smart home, then the PSO-based optimization engine would invoke to predict the optimized temperature and humidity then applied to the smart home to maintain thermal comfort of resident in a house.
The following
Figure 7 shows the results of the temperature data collected in our experiment. With the graph, you can easily understand the difference in temperature that using the optimization method and the unused data. The bottom graph reflects changes from the original temperature data. The indoor temperature varies between 18.37 and 20.21, with an average temperature of 18.90, with most readings below 20. Conversely, the experimental results using our proposed optimization method lie between 18.65 and 21.92. Compared to the original data, the average temperature using our proposed optimization method is 21.25, maintaining a warmer environment.
Figure 8 shows the current indoor humidity and optimized indoor humidity data. When using our optimization method, changes in humidity are not as sharp as changes in temperature. The current humidity fluctuates at 45.49 degrees left and right, while the optimized temperature is changing at 43.02 degrees left and right. However, we have much better humidity stability since the deviation was less than 1.3, where for original data it was almost 2.
Figure 9 shows the current indoor thermal comfort index and optimized indoor thermal comfort index data. The current PMV fluctuates at −0.280 degrees left and right, while the optimized temperature is changing at 0.228 degrees left and right. The results show us that the optimized PMV is warmer than the current PMV.
Figure 10 is the result of power usage. The following figure shows the data of energy used to maintain the indoor environment as a graph. As can be seen from the figure, the use of energy is more stable while using the optimization method. The current indoor overall power usage is 3667 and the optimized power usage is 3871. Our proposed system maintains a comfortable indoor environment for residents and uses more energy than the original data in terms of power, but there is no noticeable difference, with a difference of 204.
Figure 11 shows the result of measuring the time required of the optimization function. The unit is milliseconds and the maximum time required is 54, which returns optimal results in a very short time. Most of the travel time is on the left and right of 33 and 42. In conclusion, it can be seen that it is executed almost in real-time.
We experiment with the proposed system in a simulated smart home environment. The smart home environment parameters are supported from one day of the ORNL dataset. From the experimental results, our proposed system maintained a better environment than the original data in temperature and humidity. Although the energy consumption was slightly overdone, it did not negatively affect the real-time processing capability of the IoT. The shortcomings of the resource shortage of IoT devices were covered by the introduction of edge computing, and the thermal comfort level was automatically maintained in the smart home through the integration of the PSO algorithm and the PMV model.