Smart Home Power Management Based on Internet of Things and Smart Sensor Networks

We have developed a system that includes a newly designed smart socket for IoT sensors and a cloud platform for smart home power management. The system can initiate the platform service upon the user’s authentication and give suggestions based on the analysis of usage patterns. By sending data to the analysis system through the IoT, the system can recommend to the user the most suitable power management setting, calculate the power consumption requirement of the user


Introduction and Motivation
Nowadays, owing to overexploitation, Earth's resources are facing the problem of exhaustion. Therefore, we must save resources, particularly electric energy. This is an issue that governments worldwide need to focus on for the sake of all humankind. Therefore, energy-saving methods have been pursued in many studies. Prior to this study, we developed a traditional smart home platform adopting an independent model without integrating it with the cloud. The data collected is in an independent state, which makes the user's real-time status unable to be easily accessed or analyzed; thus, it cannot provide users with smarter customized services.
In this study, a cloud platform for smart home power management is developed. The platform automatically uploads to the cloud the power usage of home appliances equipped with a smart socket. Users can understand and track the power usage of various home appliances on the platform. After accumulating power consumption data on a daily basis, the platform will proactively provide power-saving suggestions to reduce user power consumption.
The purpose of this study is to design a cloud platform that manages the power consumption at home to improve the efficiency of electricity usage and to reduce power consumption through the cloud platform for smart home power management so that users can enjoy the innovative services of precise power control and smart home living. Moreover, the platform can also help the government to more accurately control household power consumption to reduce power loss and waste.

Development trend of smart home industry
Smart homes are a fast-growing market. Smart homes may include smart home entertainment, appliances, energy management, control and connectivity, comfort and lighting, and security. Among these applications, control and connectivity, home entertainment, and security are usually the three most widely adopted applications. With the increasing number of smart appliances on the market, the Internet of Things (IoT) is playing a key role in smart homes. The IoT describes a network of physical objects embedded with sensors. Smart homes require many IoT devices, which are connected through the Internet. When people want to turn on a smart lamp, they just send a voice command through a smart speaker. The smart speaker will transmit the command to the smart lamp to turn on the lamp. (1) As a result, the smart home industry is becoming large and widespread. As recent developments in the smart home industry, we introduce five general applications in the following subsections.

Smart home power control system
A smart home power control system monitors power consumption at home. Each home appliance has different power consumption according to its frequency and way of usage. People can monitor the power consumption of air conditioners, refrigerators, TVs, fans, monitors, water dispensers, water heaters, and electric curtains through such a system. The system usually provides a user-friendly interface on mobile or wearable devices so that people can check the history of power consumption anytime and anywhere. (2)

Smart illumination control system
Illumination is one of the important environmental factors in a home, changing the atmosphere of the home. To create a comfortable ambience indoors, suitable illumination can be actively chosen. For example, a leisurely atmosphere is needed for dinner to allow people to relax over dinner; bright illumination allows people to maintain long-term focus while reading, while dim lighting is suitable for watching films so that the contrast allows the TV screen to be displayed more clearly. (3)

Smart security system
A smart home security system is composed of multiple sensors. These sensors collect activity data in the home and send the information back to the smart home security system. After integrating and analyzing the information, the smart home security system can provide users with suitable activity recommendations. For example, smoke detectors and temperature sensors can collect data on gas concentration and temperature to provide users with fire warning information, and a video intercom system and surveillance system can collect image data to provide users with theft warning information. (4)

Home medical monitoring based on IoT
Smart home medical monitoring systems are especially useful for people living in rural and remote areas who cannot frequently visit a healthcare center for medical care because their home is far from the nearest healthcare center. If a medical monitoring device that measures blood pressure, temperature, pulse, or blood sugar level is combined with the IoT, people can obtain these statistics at home and transmit the data to experts at a healthcare center, reducing the time spent traveling to and from the healthcare center. People can also consult with doctors online, eliminating the waiting time at the center. (5)

Remote monitoring based on IoT
People can now monitor or control various home devices remotely through mobile devices. These home devices usually have IoT chips to ensure the capability of remote monitoring and control. This is helpful for people who have to complete a lot of activities when they are not at home. Examples include turning on the water heater in advance to prepare for a bath, turning on the air conditioning to adjust the room temperature, and turning on the light before arriving home. (6,7)

2.2
Technology required for smart home platform

Home automation system
The first prototype smart home was in the United States. A smart home usually enables the monitoring and control of attributes such as lighting, climate, entertainment systems, and appliances. The home automation system is the most important system in a smart home. There are four major functions of a home automation system: security, home care, convenience and comfort, and energy conservation and environment protection. (8) To provide these functions, embedded technology, network communication technology, and wiring technology are required to connect and transmit messages between multiple home appliances. A home automation system is developed similarly to a factory automation system. A factory automation system is used to raise productivity, reduce labor costs, and lower the defect rate.
Thus, a factory automation system is required to modify different manufacturing environments to achieve the best efficiency or obtain the most products at the least cost, but the manufacturing environment is stable for most of the time. On the contrary, the environment in which a home automation system operates is more complex. A home automation system has to provide services at different temperatures and humidity and dust levels. The services that a home automation system provides are diverse; it may be the control center of washing machines, air conditioners, water heaters, refrigerators, lighting switches, dimming controls, electric curtains, and dishwashers. In the future, it may also provide reminders to maintain home appliances, security warnings, and other services. (9) However, it is still difficult to implement a home automation system within a reasonable cost.

Smart sensors
Smart sensors provide the functions of low power consumption and the smart adjustment of power consumption; therefore, smart sensors can provide long-term sensing services and can actively report and transmit data to a cloud platform. The cloud platform stores the data provided by the sensors, and after analyzing the data, it provides users with analysis results and customized services. (10) For example, a smart calendar can activate linked settings and new applications. At a set time, it can open the day's itinerary, read it through a voice set up via the Internet, and possibly even arrange for taxis, etc., allowing the user to quickly and conveniently learn the itinerary of the day.

Cloud computing technology
In the past, smart home appliances with built-in information system functions could not store large amounts of data on a cloud platform and thus could not accumulate enough data to perform analysis useful for users. In addition, data collected by different smart home appliances could only be stored in the appliances themselves, making it difficult to integrate data from different smart home appliances. New smart home appliances must have the ability to instantly transfer data to a cloud platform and perform cloud computing. (11)

Home energy management system
In addition to collecting data in real time, through a smart home service platform, a smart home can query past records. At the same time, by considering the time of year and different electricity tariffs at different times, it can actively question users on whether to change their power consumption habits. This feature can ask users to turn on electric appliances if they would benefit from changing the way they consume electricity. Such repeated queries will increase user control of their household power consumption. Meanwhile, the system analyzes the power consumption behavior of a user and sends a message to their smartphone informing them of their household power consumption, broken down into the consumption by different electrical appliances. Examples of how to reduce household power consumption such as adjusting the air conditioning to the home temperature, introducing a time setting on the TV to prevent children from watching too much TV, and changing the setting of ambient illumination in the home are all suggestions for reducing home power consumption, allowing users to achieve a more convenient life more cost-effectively. (12)

Differences between stand-alone and cloud platforms
Smart home cloud platforms are a future trend. This section compares and analyzes the differences between stand-alone and cloud platforms.

Data storage characteristics
For a stand-alone platform, it is usually necessary to outsource the planning service and build separate systems and functions, and the data storage capacity is limited. Owing to its convenience, reliability, and the ability to integrate instantly, a cloud platform is more conducive to future development in terms of expansion flexibility, providing a good channel for user services. A cloud platform can also instantly and transparently meet consumer needs in either downloading user data or browsing current data. (13)

Interaction
In the past, households could not learn about their power consumption beforehand; households could only wait until they received their electricity bill to learn about their power consumption. Moreover, they did not know the power consumption of individual appliances, making it very difficult to manage home power consumption. Residents would have to measure the appliances individually with tools, causing them bother. Using a cloud platform is like using a remote control, making it convenient for consumers. As consumers use the cloud platform more frequently, the cloud platform learns more about their habits and predicts their behaviors more accurately.

Data security
When firms want to use consumer data, they must not only collect and use the personal data legally but also safeguard the information. To maintain the security of system information and consumer-related data, firms must hire professional IT personnel to manage the system. The database used in stand-alone platforms is usually installed at the user's home. The risk of a local database being stolen is high; thus, the risk of personal data being stolen is also high. After adopting a cloud platform, cloud maintenance is provided by a professional team of the cloud service provider to ensure that the IT service is sufficiently secure, (14) meaning that users need not worry about personal and household data leakage.

Cost and maintenance
Traditional smart homes could obtain data only through real-time detection. If the users needed subsequent computational analysis, the maintenance cost would be quite large. In contrast, the maintenance of the cloud platform is a fee-based service provided by the supplier, which would substantially reduce environment infrastructure and machine maintenance costs. The differences between the two platforms are shown in Table 1. We also compare this study with other studies in terms of the wireless transmission, bridge, impact on other sockets, power consumption statistics, outdoor mode, and prediction of power consumption. The results show that the smart socket of this study has a better function related to statistics and prediction of power consumption. The comparison between the smart socket designed in this study and other smart sockets in past studies is shown in Table 2 below.

Service model of platform
1. The adoption of smart homes has been slow. One of the reasons is the high cost of adopting smart systems. We solve the problem by developing a smart socket. The smart socket has IoTcapable chips with which household power data can be uploaded to a cloud server for storage and remote backup. The cost of a smart socket is significantly lower than that of most smart High opportunity for firms to provide valueadded services Security Information security is not rigorous, and firewall used provides low protection Cloud service provider provides rigorous information security, and firewall used provides high protection

Hardware equipment
Firms need to go to individual homes for hardware maintenance, resulting in higher cost Cloud service providers maintain their hardware equipment in their facilities room, resulting in lower cost Table 2 Comparison of smart sockets.
Smart socket Wemo Mini (15) TP-Link Kasa Mini HS105 (16) Gosund Mini (17) This study appliances. In addition, the risk of losing data is decreased by remote backup. These advantages will enhance the motivation to adopt a smart system. 2. After the smart home service collects data through the cloud server, it analyzes the user's habits through big data and develops a smart unmanned housekeeping system to provide smart management on the service settings of daily life, providing a simple interface that is easy to understand, easy to use, and easy to handle for convenience in everyday life. The platform will analyze the power consumption habits of each user through statistical analysis, so that the user can easily choose better power-saving behaviors and better manage household power consumption, e.g., immediately turn off an appliance when it detects that it has not been in use for 3 min. 3. The home security management system provides a safe and reliable management model. It irreversibly stores time record information, expands the cloud data storage model to establish traceable habit behavior records, and provides direct control or query information. For more accurate analysis and data consistency, it only provides retrospective functions to prevent records from being tampered with.

Service innovation of platform
1. The platform proposed in this study can analyze users' usage habits through statistics or regression analysis and provide users with suggestions for better power usage such as different habits. 2. The platform has round-the-clock monitoring capacities and can constantly and accurately control the power consumption status while managing appliances at home.

System planning of cloud platform of smart home power management
The platform consists of three major components: an IoT data detection and collection system, a mobile device system, and a cloud data analysis center.
IoT data detection and collection system: This detects the current in the chip of the newly designed smart socket, converts the detected part into data, and transmits it to the cloud in real time using the wireless network mode. After the statistics and calculations are completed, the results are displayed on a smartphone or related equipment so that users can immediately control and learn about the power consumption of their home appliances through the Internet. Through the designed interface, users can very conveniently and easily check the power consumption of devices and manage the related equipment.
Mobile device system: This is the bridge between the IoT data detection and collection system and the cloud data analysis center. Users can receive power consumption data on their smartphones instantly.
Cloud data analysis center: The main task of the center is to carry out relevant statistical analysis on the power consumption data transmitted to the center, including the hourly, daily, and monthly power consumption, and apply regression analysis to suggest to users how to reduce power usage. The system architecture diagram of the cloud platform for smart home power management is shown in Fig. 1 and a simulated scene is shown in Fig. 2.

Smart socket design
The newly designed smart socket is presented in Fig. 3. It contains WeMos D1 WiFi Arduino UNO and an ACS712 20A range current sensor, which are both IoT chips, to sense and collect power consumption data. The socket can be installed at home to obtain the parameters, which are transmitted by the external sensors. It can be used in combination with traditional home appliances and bridges the electricity between the home appliance and socket. It can control the state of an electrical switch and record the actual power consumption. The power consumption  statistics collected by the smart socket are transmitted to a cloud database through a wireless network. The cloud platform uses different statistical analysis methods to predict future power consumption. Users can easily obtain the analysis results on their smartphones.

Function designs of the platform
We designed a smart socket with a sensor and IoT to be integrated with the information platform. This socket is installed at home to obtain various parameters. Table 3 shows the platform construction and smart socket software requirements to control the status of electrical appliances and monitor the actual current and power consumption. The data collected through wireless transmission is presented to the user after being calculated by the server. We built a cloud platform for smart home power management. Users can check their power consumption status through smartphones and send their commands to appliances to manage and adjust power consumption to reduce unnecessary waste. The platform consists of a cloud server, a single-chip  micro-control board, and a wireless network. Users can monitor the power consumption status of household appliances at any time to improve their ability to control household power consumption. The service flow of the cloud platform for smart home power consumption management is shown in Fig. 4. There are three users in the cloud platform for smart home power management: the homeowner, household members, and system administrators ( Table 4). Each user has an operation interface that can change the smart socket's parameters to obtain real-time information. The platform (Fig. 5) provides power alert messages and power consumption data.
The developed smart socket for the IoT sensor is used to collect power consumption data and control power consumption. The smart socket contains power measurement and control chip sensors, which allow it to control the switch action of electrical appliances and return the electricity data to the smart housekeeper platform. Using the equations below, the platform Table 4 Functions for different users in the cloud platform for smart home power management.

Users Functions System administrators
Maintaining platform operation, exception handling, data security, remote backup Household members Obtaining shared information, instant queries, mobile devices Homeowner Authentication, instant queries, mobile devices, information sharing calculates the hourly, daily, and monthly power consumption of the various appliances, then divides the average monthly power consumption according to the statistics of household power consumption provided by power companies by the number of days in the month and compares the daily power consumption of the user with the statistical average. The peak/off-peak consumption is time-dependent; for example, Eq. (1) shows the two-stage electricity billing method of the power company, i.e., the daily peak time is 7:00-22:00, while the off-peak times are 00:00-07:00 and 22:00-24:00, where the off-peak period is p 1 and the peak period is p 2 . The total price of the electricity P is thus calculated. The general public has little understanding about wattage; thus, the platform presents the results in the form of money to increase user awareness of their power consumption. The power consumption per minute is multiplied by the time distribution of the power consumption percentage rate (in Eq. (3)) to compare whether the average value per minute exceeds the monthly average value given by Eq. (2). If it exceeds the monthly average value, the electricity warning distribution chart will be activated. As shown in Figs. 6 and 7, users can clearly see the hourly power consumption of various types of electrical appliances and suggestions on to whether to set or turn off the appliances. They can also see the consumption of electrical appliances in constant use, such as refrigerators and water heaters. Table 5 shows the parameters used in Eqs.    Example: Four appliances are in current use: an air conditioner, refrigerator, blow dryer, and computer. The wattages per minute of the appliances are 5.3, 0.7, 4.7, and 2.2 W, respectively. Table 6 shows whether each appliance is used in the next 10 min. Based on the estimation of Taiwan Power Company in 2018, the average power consumption per household is 292 kWh per month and 6.8 W per minute. By comparing the power consumption of various electrical appliances, as shown in Fig. 6, it can be seen that the power consumption exceeds the average consumption in the 4th and 6th minutes, during which some appliances can be turned off to save energy. When the data of Table 6 is multiplied by the wattage of each appliance, we obtain the values of power consumption for 10 min (Fig. 7). The regression line in Fig. 8 shows the relationship between the actual power consumption and time. When the actual power consumption exceeds the power consumption predicted by the regression function, a selection of electrical appliance power usage settings is provided, allowing the user to choose whether to turn off the appliances or retain the preset status.

Conclusion
The market for traditional home appliances is close to saturation. Companies must introduce innovative services to consumers by improving user experiences. The smart home is the next step beyond traditional home appliances. The smart socket designed in this study contains WeMos D1 and WiFi Arduino UNO chips and an ACS712 20 A range current sensor with the functions of collecting current data and wireless transmission. It can be connected to actual electrical appliances to test the collected data transmitted to the platform to be recorded, and use linear regression to predict the power consumption. To manage the power consumption, when the set power consumption is exceeded, a message will be sent to ask the user whether to turn off electrical appliances. We compared related smart socket products on the market and found that our proposed design does not need a bridge connection when using the smart socket and it will not increase the power consumption of other sockets. In addition, it has a power consumption statistics function and can be remotely set. Finally, it also provides a function for estimating power consumption. Thus, the smart socket of this study is a convenient means of enabling traditional home appliances to become components of a cloud platform for smart home power management.
This platform applies the technology of IoT and cloud computing and transmits the power consumption data of smart homes to the cloud. Through statistical analysis, it can better understand the power consumption status and behavior of users using various electrical appliances. After further analysis, it will send appropriate power-saving suggestions to users for their consideration. At the same time, it instantaneously controls the usage of home appliances, tracks the power consumption status of the entire house in real time, reduces unnecessary power consumption, and cooperates with the promotion of smart meters by the government. The government will learn the condition of electricity loss during the transmission of data provided by smart meters to help it develop better energy-saving policies.
Tsung-Chih Hsiao received his Ph.D. degree from the Department of Computer Science and Engineering, National Chung Hsing University, Taiwan. He is currently an associate professor at the College of Computer Science and Technology, Huaqiao University, China. His research fields include information security, cryptography, and network security.