## 2 Home Automation System Architecture  
As shown in Figure 3, the architecture of the home automation system consists of two main parts: the internal part on the left and the outer portion, which includes sensors, users, and services, on the right. Also, the communication manager is in contact with all sensors and actuators in its protocol, and all communication is done this way. In general, the information that enters the system is divided into three categories:  
1. The device sends its service information (such as coffee);
2. Context sensors, such as light sensors, show current location information;
3. Users provide the necessary information through a user interface (for example, an interactive home screen) to make changes to specific settings.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Protocol** & **Frequency** & **Topology** & **Network** & **Data Rate** & \begin{tabular}{c} **Power** \\ **Consumption** \\ \end{tabular} & \begin{tabular}{c} **Smart Grid** \\ **Application Areas** \\ \end{tabular} & **Cost Adder** & **Range** \\ \hline Zig-Bee & 2.4 GHz & \begin{tabular}{c} Star, Mesh, \\ Cluster tree \\ \end{tabular} & LAN & 250 kbps & Low & \begin{tabular}{c} Energy monitoring; \\ smart lighting; \\ home automation; \\ \end{tabular} & Medium & 10–300 m \\ Z-wave & 900 MHz & Mesh & LAN & 100 kbps & High & Home automation & Low & 30 m \\ Wi-Fi & 2.4, 5 GHz & \begin{tabular}{c} Star, P2P \\ \end{tabular} & LAN & 0.1–54 mbps & Medium & Home automation & Medium & 50 m \\ Bluetooth & 2.4 GHz & P2p, star & PAN & 721 kbps & Very low & Home automation & Very low & 3–30 m \\ 5G & 600 MHz & Star & PAN & Up to 25 GbPS & Low & \begin{tabular}{c} Distributed \\ monitoring \& control \\ \end{tabular} & Low & Various km \\ LoraWAN & 780915 & Star on star & NAN; WAN & 290 bpps- & Low & \
\begin{tabular}{c} Equipment \\ management; \\ Online monitoring \\ \end{tabular} & Low &
\begin{tabular}{c} 2.5 km urban/ \\ \(15\) km \\ \end{tabular} \\
6 LoWPAN & 2.4 GHz & Star & LAN & 250 kbps & Medium &
\begin{tabular}{c} Smart metering; \\ home automation \\ \end{tabular} & Medium & 800 m \\ \hline \hline \end{tabular}
\end{table}
Table 1: Comparison of different protocols in smart home automation.  
Figure 3: Home automation system architecture.  
The information from the sensors (the low-level context) is sent to the Context Manager, which reasons and infers high-level context, which is then forwarded to the Composition Manager. For example, a sensor related to the Bluetooth protocol will detect a smartphone's presence. Then, the Context Manager identifies the owner of the smartphone and the location where the sensor is located (for example, the sensor is in the bedroom, and [PERSON] owns the smartphone). Hence, high-level context information is easily obtained ([PERSON] is in the bedroom). In addition to the data obtained in the high-level context, the composition manager will be able to obtain information about different system applications. Also, as seen in the Figure 3, the services that belong to the same family are grouped in a box. (e.g., light, sound, video, etc.). Therefore, smart home users can categorize new compounds in different packages based on this method. Finally, the composition needs to be enforced for the various services. The Orchestration Executor is responsible for converting the information of the different blocks into service-specific implementations. This conversion is only possible if the ontologies of the services contain enough information about their control and data flow.