## 4 IoT Integration with Digital Twin
### IoT Devices and Data Collection  
The Internet of Things Connectivity Node (ICON) is the central entity in an HEMS. The ICON will basically work as a main gateway in a home, coordinating and managing all IoT devices. It may be a personal computer (PC), mini PC, or Raspberry Pi that makes it easy to integrate diverse smart sensors and actuators for smooth connectivity at both local network and cloud-based services. The ICON is an IoT hub that allows devices to communicate with each other and interact effectively, interfacing the immediate environment with larger structures in the network. Such IoT devices are allowed to connect with the ICON through special communication modules and protocols. Additionally, it plays an important role in translating various standards of communication, hence allowing for smooth interaction. The ICON may be connected with many kinds of IoT devices, which in return provide specific data and functions as detailed in Table 2. These include environmental sensors that track temperature, humidity, and CO\({}_{2}\) levels, wall plugs that monitor the energy consumption of small devices, motion sensors that detect luminance and movement, and heavy-duty smart switches that control high-consumption devices, such as air conditioners (ACs) using an IR AC extender. Additionally, a three-phase energy meter is utilized to monitor energy consumption in households equipped with a three-phase system. In homes without a three-phase setup, one of the existing phases will be used for energy monitoring and management purposes. These IoT devices are designed for low-power operation to extend battery life and reduce the frequency of maintenance. In fact, this is important for devices installed in far-flung areas or those which are intended to run for an extended period, independent of manual interference. It is such protocols that enable continuous communication and energy management, required by both smart home installations and industries. The ICON has a mesh network topology, with every device connecting to each other wirelessly in multiple ways. This layout provides the network with better communication reliability as well as increased resilience--data can traverse several paths. Even if one link or device is lost, communication among the rest of the nodes can, by virtue of rerouting them, remain unbroken. Typical of Z-Wave devices in this kind of setup, messages can be passed between devices in a hops manner and thus, the mesh network topology can reach out beyond the communication range of a central controller. In most cases, up to four intermediate nodes are used and this makes communication possible even in distant areas through direct lines. However, a potential drawback of mesh networks is their intricacy; developing a smoothly running system with effective data flow usually requires high-level techniques. Nevertheless, its strength and adaptability are the main factors of the technology that make it most suitable in the fields where communication between the devices is very high. In contrast, a star network topology, employed in solutions like Z-Wave Long Distance (LR), has a central hub that communicates directly to each device without any intermediary nodes. This design has the benefit of clear communication paths and less latency, which is especially beneficial for devices further from the hub. The star topology is simple and it is a good solution in situations where the only requirement is short-distance communication with no delays. In order to ensure an easy process for the users, the ICON interface is designed as a Docker container. This containerized architecture creates an environment where services can run independently, so changes and maintenance can happen without affecting other functions. In addition, users can also easily add, configure, and manage connected sensors on the ICON device. Thanks to the reliability of mesh networks, the operational simplicity provided by Docker makes the ICON communication system remain strong and flexible.