## 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
\begin{table}
\begin{tabular}{l c c c} \hline \hline
**Output Var.** & **HVACControl** & **VentilationControl** & **LightingControl1** & **LightingControl2** \\ \hline
**Inferred Value** & 0.581 & 0.467 & 0.467 & 0.467 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Inferred output values for Scenario S1. #### 5.5.3 Scenario S3: Medium CO\({}_{2}\) and Occupancy

This scenario evaluates the fuzzy controller's behavior in a situation with moderate indoor temperature, high occupancy, and elevated CO\({}_{2}\) concentration. The selected sensor values simulate a typical working environment with two occupied zones and moderate illuminance. Table 12 details the input values used. The fuzzy inference results are summarized in Table 13, while Table 14 shows the inferred control values. As observed in Scenario 1, the occupancy of the space triggers rule R24, which serves to initialize the environmental control systems at a baseline level of thermal and visual comfort. Subsequently, the detection of medium temperature levels in both monitored zones leads to the activation of rules R02 and R05, resulting in a reduction in the HVAC system's output to conserve energy while maintaining comfort. Additionally, the illuminance levels are assessed to be slightly below the medium threshold, which prompts the system to activate lighting control at the Dim setting, as per the conditions defined in rules R08, R11, and reinforced by R24. Lastly, medium levels of CO\({}_{2}\) are identified, which triggers rule R16. This rule adjusts both the ventilation and HVAC systems to ensure proper air quality by reducing CO\({}_{2}\) concentration within the space. In summary, Scenario S3 confirms the ability of the fuzzy controller to

* Integrate multiple rule contributions under medium environmental loads;
* Prioritize ventilation in response to air quality degradation;
* Maintain moderate control actions that reflect realistic operating expectations. #### 5.5.4 Scenario S4: Low Light and Occupancy

This scenario analyzes the system's response to a situation with low ambient light, full occupancy in both zones, and moderate environmental conditions. This configuration is \begin{table}
\begin{tabular}{l l c c} \hline \hline
**Rule** & **Description** & & **Membership Degree** \\ \hline R02 & IF RoomTemperature1 IS Medium AND Occupancy1 IS True THEN HVACControl IS Low & 1.0 \\ R05 & IF RoomTemperature2 IS Medium AND Occupancy2 IS True THEN HVACControl IS Low & 0.93 \\ R08 & IF Illuminanc1 IS Medium AND Occupancy1 IS True THEN LightingControl1 IS Dim & 0.5 \\ R11 & IF Illuminanc2 IS Medium AND Occupancy2 IS True THEN LightingControl2 IS Dim & 0.83 \\ R16 & IF CO\({}_{2}\)Level IS Medium THEN VentilationControl IS Moderate, HVACControl IS Low & 0.67 \\ R24 & IF Occupancy1 IS True OR Occupancy2 IS True THEN HVACControl IS Medium, VentilationControl IS Moderate, LightingControl IS Dim, LightingControl2 IS Dim & 1.0 \\ \hline \hline \end{tabular}
\end{table} 
Table 13: Inference results and active rules for Scenario S3. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Input Variable** & **Value** & **Input Variable** & **Value** \\ \hline RoomTemperature1 & 22.5 \({}^{\circ}\)C & RoomTemperature2 & 22.0 \({}^{\circ}\)C \\ RoomHumidity1 & 50.0\% & RoomHumidity2 & 45.0\% \\ Occupancy1 & 1.0 & Occupancy2 & 1.0 \\ Illuminanc1 & 350.0 lx & Illuminance2 & 450.0 lx \\ CO\({}_{2}\) Level & 1300.0 ppm & – & – \\ \hline \hline \end{tabular}
\end{table} 
Table 12: Input values for Scenario S3. representative of a late afternoon or cloudy indoor environment with adequate air quality but insufficient daylight. Table 15 details the input values. The fuzzy system inference activated key rules, including R2, R5, R12, R17, and R24. These rules are consistent with the low-light and full-occupancy context. Table 16 lists the contributing rules and their degrees of activation, while Table 17 summarizes the inferred output values. Given the presence of occupants, rule R24 is activated to initialize the environmental control systems at a baseline comfort level.