## 5 Case Study: Experimental Validation in a Representative Smart Building Scenario
### Implementation of the JFML-IoT-Based Energy Management System
#### 5.4.1 Sensor and Actuator Object Instantiation
The final output represents a combined and coherent control response aligned with the environmental conditions present in the room. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Input Variable** & **Value** & **Input Variable** & **Value** \\ \hline RoomTemperature1 & 35.0 \({}^{\circ}\)C & RoomTemperature2 & 33.0 \({}^{\circ}\)C \\ RoomHumidity1 & 55.0\(\%\) & RoomHumidity2 & 60.0\(\%\) \\ Occupancy1 & 1.0 & Occupancy2 & 1.0 \\ Illuminance1 & 600.0 lk & Illuminance2 & 700.0 k \\ CO\({}_{2}\) Level & 800.0 ppm & – & – \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Input values for Scenario S1. \begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline
**Scenario** & **Te.1** & **Hum.1** & **Illu.1** & **Oc.1** & **Te.2** & **Hum.2** & **Illu.2** & **Oc.2** & **CO\({}_{2}\)** \\ \hline S1: High Temp + Occupied & 35 & 55 & 600 & 1 & 33 & 60 & 700 & 1 & 800 \\ \hline S2: Low Temp + Unoccupied & 12 & 45 & 400 & 0 & 14 & 50 & 500 & 0 & 500 \\ \hline S3: Medium CO\({}_{2}\) + Occupancy & 22.5 & 50 & 350 & 1 & 22 & 45 & 450 & 1 & 1300 \\ \hline S4: Low Light + Occupancy & 20 & 50 & 100 & 1 & 21 & 55 & 150 & 1 & 400 \\ \hline S5: Low/High Light + Un/Occupancy + High Humidity & 20 & 85 & 50 & 0 & 21 & 80 & 850 & 1 & 400 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Test scenarios and corresponding input values. Overall, the fuzzy inference mechanism demonstrates robustness, consistency with expert-defined logic, and adaptability in complex, multi-input scenarios. The system successfully combines concurrent environmental cues and yields interpretable control signals, reinforcing its suitability for real-world deployment in smart building environments. #### 5.5.2 Scenario S2: Low Temperature and No Occupancy

This scenario explores a low-energy demand situation where indoor temperature is low, no occupants are present in the room, and both CO\({}_{2}\) and illuminance levels remain within moderate thresholds. These conditions are typical of a non-occupied office during early morning hours or breaks. Table 9 lists the specific sensor readings used in this simulation. Several fuzzy rules were triggered in this scenario, reflecting the system's conservative behavior in low-demand contexts. Table 10 summarizes the active rules, while Table 11 presents the corresponding inferred control values. Since the room is unoccupied, rule R25 is triggered to deactivate all systems, thereby minimizing energy consumption. However, slightly elevated CO\({}_{2}\) levels are detected, which leads to the activation of rules R17 and R26. These rules introduce a minimal level of ventilation to prevent a further increase in CO\({}_{2}\) concentration. As a result, the output values for all control systems remain close to zero, except for the ventilation system, which is moderately activated in accordance with the environmental conditions. The fuzzy reasoning system demonstrates appropriate conservative behavior under minimal energy demand, minimizing unnecessary activations and aligning well with human expert expectations in unoccupied and thermally neutral scenarios. \begin{table}
\begin{tabular}{l c c c} \hline \hline
**Output Var.** & **HVACControl** & **VentilationControl** & **LightingControl1** & **LightingControl2** \\ \hline
**Inferred Value** & 0 & 0.324 & 0 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Inferred output values for Scenario S2. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Input Variable** & **Value** & **Input Variable** & **Value** \\ \hline RoomTemperature1 & 12.0 °C & RoomTemperature2 & 14.0 °C \\ RoomHumidity1 & 45.0\% & RoomHumidity2 & 50.0\% \\ Occupancy1 & 0.0 & Occupancy2 & 0.0 \\ Illuminance1 & 400.0 k & Illuminance2 & 500.0 k \\ CO\({}_{2}\) Level & 500.0 ppm & – & – \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Input values for Scenario S2.