## 2 System Architecture  
This study uses the ZigBee communication protocol for data transmission. Low transmission rates and cost, high energy efficiency and security, and dedicated machine-to-machine (M2M) communication are the fundamental characteristics of ZigBee. The system obtains temperature, humidity, carbon dioxide concentration, motion, and alarm status data. Data are stored in a database using the MQTT protocol. Sensor data can be viewed on a mobile device in real time, and the system can be remotely controlled. Figure 1 illustrates the system architecture of the proposed home monitoring system. According to the network architecture of the system, the proposed architecture can be divided into three parts: (1) sensors that use the ZigBee communication protocol to communicate with a gateway; (2) a gateway that performs data integration and preprocessing; (3) a server that controls the sensors and transmits data to an app.  
Figure 2 depicts a flow chart of the operation of the proposed home monitoring system. Briefly, sensors transmit data to the gateway by using the ZigBee communication protocol, which performs packet analysis, comparison, and confirmation for accuracy. The received data are analyzed and sent to the server by using the MQTT communication protocol. Data are transmitted over wired or wireless networks. Node-RED ([[https://nodered.org/#:-text=Node-RED%20](https://nodered.org/#:-text=Node-RED%20) is%20a%20 programming%20 tool%20]([https://nodered.org/#:-text=Node-RED%20](https://nodered.org/#:-text=Node-RED%20) is%20a%20 programming%20 tool%20) for%20 wiring%20 together,be%20 deployed%20 to%20 tts%20 runtime%20 in%20a%20 single-click) is a programming tool that helps wire together different devices and online services in new and interesting configurations. Node-RED receives sensor data and stores data on the server. An app displays sensor data by using the MQTT protocol. Sensors are controlled using the hypertext transfer protocol. Server virtualization technology is used to allocate resources using a kernel-based virtual machine (KVM) module. The Linux kernel system is endowed with the capabilities of a virtual machine hypervisor. The overall relational architecture of the KVM (kernel-based virtual machine), QEMU (quick emulator), and libvirt development interfaces adopted in this study integrates these program interfaces through the Linux virtualization functionality. The QEMU virtualization software ([[https://www.qemu.org/](https://www.qemu.org/)]([https://www.qemu.org/](https://www.qemu.org/))), combined with the KVM module, provides hardware acceleration capabilities. Additionally, the libvirt software ([[https://libvirt.org/](https://libvirt.org/)]([https://libvirt.org/](https://libvirt.org/))) interface is used to manage virtualization functions, achieving integration in the IoT development interface. The server maintains and runs a database and an MQTT broker. Node-RED is used to store and transmit the data. The app displays the status of fans and light-emitting diodes [6] and is used to remotely control sensors. Data are used to train the system. The processing results are returned to the database and displayed in the app.  
Figure 1: Architecture of proposed artificial intelligence home monitoring system.