Interpretable Fuzzy Control for Energy Management in Smart Buildings Using JFML-IoT and IEEE Std 1855-2016
Abstract
1. Introduction
2. State of the Art
2.1. IoT-Based Energy Management in Smart Buildings
2.2. AI and Fuzzy Logic Applications in Smart Buildings
2.3. Research Gaps and Motivation for This Work
3. Preliminaries
3.1. IEEE Std 1855-2016 and Fuzzy Markup Language
- Linguistic variables and terms: Representations of imprecise concepts such as “low temperature” or “high humidity”.
 - Fuzzy rules: Causal relations between linguistic variables and terms inspired by human reasoning.
 - Inference mechanisms: Methods for aggregating fuzzy rules to derive conclusions.
 - Defuzzification methods: Techniques to transform fuzzy outputs into crisp values for real-world applications.
 
3.2. JFML: Java Fuzzy Markup Language Library
- FML Core Module: Implements the fundamental functionalities of FML, enabling the parsing and generation of XML-based fuzzy systems.
 - Inference Engine: Provides mechanisms for executing fuzzy inference, supporting different inference methods such as Mamdani, Tsukamoto, Takagi-Sugeno-Kang (TSK), and AnYa.
 - Interoperability Layer: Facilitates integration with other fuzzy logic tools and formats such as PMML and Matlab Fuzzy Logic Toolbox v2.9.
 - Optimization Tools: Supports machine learning techniques and evolutionary algorithms for optimizing fuzzy models.
 
3.3. JFML-IoT: Design and Features
- Optimized execution for edge computing: The library is adapted for microcontrollers and embedded platforms, offering reduced memory usage and execution time without sacrificing inference accuracy.
 - Modular and extensible architecture: It provides abstract classes for modeling sensors, actuators, communication modules, and embedded devices, facilitating the rapid development of custom hardware/software configurations.
 - Native support for IEEE 1855-compliant FML: FRBSs can be loaded, parsed, and executed from XML files using the FML, ensuring both interoperability and human interpretability.
 - Integration with standard communication protocols: JFML-IoT supports lightweight messaging protocols such as MQTT, allowing sensors and actuators to communicate through publish–subscribe patterns commonly used in building automation. It also supports data integrity through MQTT’s built-in QoS levels and timestamped message delivery, ensuring reliable and ordered transmission in constrained environments.
 - Separation of concerns: The architecture cleanly decouples the fuzzy logic engine from the data acquisition and actuation layers, improving system modularity and maintainability.
 
4. JFML-IoT-Based Energy Management System
4.1. Layered System Architecture
- Perception Layer: This layer comprises environmental sensing and actuation components. It includes Arduino-compatible sensors for temperature, humidity, luminance, CO2, and occupancy detection (e.g., DHT22, BH1750, MH-Z19, PIR modules), as well as actuators for HVAC and lighting control. These components capture real-time physical data and implement local actions as dictated by the FIS.
 - Communication Layer: Responsible for transmitting sensed data and control commands using the MQTT protocol, which ensures lightweight and reliable communication between devices. Each sensor node acts as an MQTT publisher, while actuator nodes and the processing unit act as subscribers, enabling real-time data flow. To ensure accurate and robust communication, this layer employs MQTT with Quality of Service (QoS) levels 1 or 2 depending on the criticality of the data. Additionally, data packets are protected using cyclic redundancy checks (CRCs) or checksums at the device level, and each message is timestamped and logged for traceability and fault detection.
 - Processing Layer: This layer hosts the JFML-IoT inference engine, capable of executing fuzzy logic rules in compliance with the IEEE Std 1855-2016. It processes incoming sensor data, evaluates the fuzzy rule base, and determines the appropriate control actions. The processing unit can be deployed on embedded microcontrollers with WiFi support (e.g., ESP32) or on a Raspberry Pi running a lightweight Java Virtual Machine.
 - Application Layer: Provides interfaces for system configuration, data visualization, and interaction with building management systems (BMSs). This layer may include dashboards, alert systems, or integration with external analytics tools to monitor energy consumption and comfort metrics in real-time.
 
4.2. System Operation
- Data Acquisition: Arduino-compatible sensors (e.g., DHT22 for temperature and humidity, BH1750 for luminance, MH-Z19 for CO2, and PIR sensors for occupancy) periodically collect environmental data. These devices are configured to sample data at intervals optimized for energy management, typically ranging from 30 s to 5 min, depending on the variable being measured. For instance, occupancy and lighting conditions are sampled every 30 s, while temperature, humidity, and CO2 levels are sampled every 2 min, balancing responsiveness and resource efficiency.
 - Data Transmission: Each sensor node publishes its readings to dedicated MQTT topics, using lightweight JSON messages. These topics follow a structured naming convention (e.g., building/room1/temperature, building/room2/occupancy) to ensure scalability and integration with external platforms.
 - Fuzzy Inference Execution: The MQTT broker forwards incoming sensor data to the processing unit, which parses the values and updates the input variables of the fuzzy rule-based system (FRBS). The inference engine, implemented using the JFML-IoT library, evaluates the current rule base—defined in FML format according to IEEE Std 1855-2016—and calculates output control values for lighting, ventilation, and HVAC systems.
 - Actuation: The resulting output values are published to MQTT control topics (e.g., building/room1/lighting/command). Actuator devices subscribed to these topics (e.g., relay switches, dimmable drivers, or IR-based controllers) interpret the fuzzy output and execute the required actions. For example, the lighting system may dim to a medium level if luminance is moderate and occupancy is detected.
 - Monitoring and Feedback: Control decisions and sensor updates are logged and can be visualized via an application-layer dashboard. This enables facility managers to monitor system behavior in real time and review historical patterns for further optimization.
 
4.3. Implemented Sensors and Actuators
5. Case Study: Experimental Validation in a Representative Smart Building Scenario
5.1. Scenario Description and Operational Flow
- Sensor Data Acquisition and Publication: Each ESP32 node continuously collects environmental data and publishes it to a local MQTT broker (step 1).
 - Message Handling: The MQTT broker, hosted on a Raspberry Pi (step 2), receives and distributes messages in real time to relevant subscribers.
 - Fuzzy Inference: A second Raspberry Pi (step 3) runs the JFML-IoT engine, which subscribes to the sensor data, executes the fuzzy rule-based inference using the FML configuration, and determines the appropriate control actions.
 - Actuation: Control commands are transmitted via MQTT to the actuator node (step 4), which governs dimmable LED lights, the ventilation fan, and HVAC outputs.
 
5.2. Design of the Fuzzy Rule-Based System
- Domain Expert Panel: A panel of five domain experts was convened, including two senior HVAC engineers, one building automation specialist, and two academic researchers in fuzzy systems. All experts had over 10 years of experience in their respective domains.
 - Variable Selection and Definition: Experts reviewed the list of sensor and actuator variables (Section 5.1) and jointly selected the subset most relevant for energy optimization and comfort regulation. Each variable was associated with predefined linguistic labels (e.g., Low, Medium, High) standardized using triangular/trapezoidal membership functions.
 - Initial Rule Drafting: An initial set of 40 fuzzy rules was proposed by the system developers based on commonly accepted HVAC and lighting strategies. These rules followed an IF–THEN structure with 2–3 antecedents and 1 consequent.
 - Expert Evaluation and Feedback Quantification: Each expert independently reviewed the proposed rules using a standardized feedback form. For each rule, the expert rated the following:
- Clarity (Scale: 1–5).
 - Relevance (Scale: 1–5).
 - Redundancy (Yes/No).
 - Suggested Edits (Free-Text Comments).
 
These responses were consolidated into a matrix representing expert–rule evaluations. Rules scoring below a threshold average (e.g., relevance < 3.5 or clarity < 3) were flagged for revision. - Consensus Building: Discrepancies were resolved through moderated online sessions following a Delphi-inspired process. Experts discussed flagged rules and iteratively refined their structure. In cases of persistent disagreement (three instances), a weighted voting system was used to reach a final decision.
 - AI-Assisted Rule Review: To complement expert feedback, a generative AI tool (OpenAI GPT-4) was used to
- Detect syntactic redundancy and inconsistent phrasing;
 - Suggest rule clustering or merging based on similarity;
 - Provide alternative formulations for ambiguous rules.
 
These suggestions were reviewed by experts but not directly adopted without their approval. AI served primarily as a support mechanism to accelerate early iterations. - Inter-Expert Agreement Analysis: To quantify consensus, a rule agreement matrix was computed based on binary matches (agree/disagree) for each rule. The average inter-rater agreement (Fleiss’ ) was 0.78, indicating substantial agreement. A summary of agreement levels for a representative subset of rules is shown in Table 3.
 - FML Encoding and Validation: The final set of 36 approved rules was encoded using the IEEE Std 1855-2016 Fuzzy Markup Language (FML) and validated syntactically and semantically with the JFML-IoT parser. Domain experts conducted a final walk-through validation session to ensure semantic alignment with their expectations.
 
5.3. FML-Based Representation of the Fuzzy Rule-Based System
- Knowledge Base: It defines all model input and output variables, specifying for each the linguistic terms and the corresponding membership functions as determined by the expert panel (see Figure 3). Each variable corresponds to a physical parameter described in Section 5.1.
 - Rule Base: It contains the set of fuzzy IF-THEN rules validated by the expert panel and summarized in Table 4. Each rule references linguistic terms from the knowledge base.
 - FIS Configuration: It specifies the type of inference engine (e.g., Mamdani), aggregation, and defuzzification methods used.
 
| Listing 1. FML definition for input variable “Room Temperature 1”. | 
| <KnowledgeBase name="EnergyKB"> <FuzzyVariable name="RoomTemperature1" domainLeft="0" domainRight="40" type="input"> <FuzzyTerm name="Low"> <TriangularShape param1="0" param2="0" param3="20"/> </FuzzyTerm> <FuzzyTerm name="Medium"> <TriangularShape param1="15" param2="22.5" param3="30"/> </FuzzyTerm> <FuzzyTerm name="High"> <TriangularShape param1="25" param2="40" param3="40"/> </FuzzyTerm> </FuzzyVariable> </KnowledgeBase>  | 
| Listing 2. FML encoding of a fuzzy rule. | 
| <RuleBase name="EnergyRuleBase" activationMethod="MIN" andMethod="MIN" orMethod="MAX" ruleConnectionMethod="AND"> <Rule name="R1" connector="and" weight="1.0" operator="MIN"> <Antecedent> <Clause> <Variable>RoomTemperature1</Variable> <Term>High</Term> </Clause> <Clause> <Variable>Occupancy1</Variable> <Term>True</Term> </Clause> </Antecedent> <Consequent> <Clause> <Variable>HVACControl</Variable> <Term>CoolingHigh</Term> </Clause> </Consequent> </Rule> </RuleBase>  | 
5.4. Implementation of the JFML-IoT-Based Energy Management System
5.4.1. Sensor and Actuator Object Instantiation
| Listing 3. Instantiation of sensors and actuators. | 
| TemperatureSensor temperature1 = new TemperatureSensor( "Temperature1", "mqtt/zone1/temp"); TemperatureSensor temperature2 = new TemperatureSensor( "Temperature2", "mqtt/zone2/temp"); HumiditySensor humidity1 = new HumiditySensor( "Humidity1", "mqtt/zone1/humidity"); HumiditySensor humidity2 = new HumiditySensor( "Humidity2", "mqtt/zone2/humidity"); IlluminanceSensor illuminance1 = new IlluminanceSensor( "Illuminance1", "mqtt/zone1/lux"); IlluminanceSensor illuminance2 = new IlluminanceSensor( "Illuminance2", "mqtt/zone2/lux"); OccupancySensor occupancy1 = new OccupancySensor( "Occupancy1", "mqtt/zone1/occupancy"); OccupancySensor occupancy2 = new OccupancySensor( "Occupancy2", "mqtt/zone2/occupancy"); CO2Sensor co2 = new CO2Sensor("CO2Level", "mqtt/co2"); HVACControlActuator hvac = new HVACControlActuator( "HVACControl", "mqtt/hvac/control"); VentilationControlActuator ventilation = new VentilationControlActuator( "VentilationControl", "mqtt/ventilation/control"); LightingControlActuator light1 = new LightingControlActuator( "LightingControl1", "mqtt/zone1/light/set"); LightingControlActuator light2 = new LightingControlActuator( "LightingControl2", "mqtt/zone2/light/set");  | 
5.4.2. Association of Devices to Embedded Systems
| Listing 4. Assignment of devices to embedded systems. | 
| EmbeddedSystem zone1 = new EmbeddedSystemESP32("Zone_1"); zone1.addSensor(temperature1); zone1.addSensor(humidity1); zone1.addSensor(illuminance1); zone1.addSensor(occupancy1); zone1.addActuator(light1); EmbeddedSystem zone2 = new EmbeddedSystemESP32("Zone_2"); zone2.addSensor(temperature2); zone2.addSensor(humidity2); zone2.addSensor(illuminance2); zone2.addSensor(occupancy2); zone2.addActuator(light2); EmbeddedSystem zoneCentral = new EmbeddedSystemESP32("Zone_Central"); zoneCentral.addSensor(co2); EmbeddedSystem zoneAir = new EmbeddedSystemESP32("Zone_Air"); zoneAir.addActuator(ventilation); zoneAir.addActuator(hvac);  | 
5.4.3. Definition of Communication Node with MQTT
| Listing 5. Definition of the central communication node. | 
| EmbeddedSystem nodeMQTT = new EmbeddedSystemRPi("node⊔MQTT"); nodeMQTT.addEmbeddedSystem(zone1); nodeMQTT.addEmbeddedSystem(zone2); nodeMQTT.addEmbeddedSystem(zoneCentral); nodeMQTT.addEmbeddedSystem(zoneAir); MQTT mqtt = new MQTT("MQTTNode","tcp://ip_address:1883"); nodeMQTT.addMQTT(mqtt);  | 
5.4.4. Loading the FML File and Executing Inference
| Listing 6. Loading and binding FML controller to the system. | 
| FMLReader reader = new FMLReader(); FuzzyInferenceSystem fis = reader.parseFML( "./energy_fuzzy_controller.fml"); JFMLIoTNode centralNode = new JFMLIoTNode("CentralNode"); centralNode.setFuzzyInferenceSystem(fis); centralNode.setMQTT(mqtt); centralNode.startInferenceLoop(10000); EmbeddedSystem nodeJFML = new EmbeddedSystemRPi("node⊔JFML"); nodeJFML.addJFMLIoTNode(centralNode);  | 
5.5. Scenario-Based Evaluation and System Behavior Analysis
5.5.1. Scenario S1: High Temperature and Occupancy
5.5.2. Scenario S2: Low Temperature and No Occupancy
5.5.3. Scenario S3: Medium CO2 and Occupancy
- 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
- Prioritize visual comfort under low-lighting conditions while maintaining energy efficiency;
 - React to nuanced combinations of environmental factors and occupancy;
 - Produce interpretable, graded outputs even under overlapping rule activation.
 
5.5.5. Scenario S5: Low/High Light, Un/Occupancy, and High Humidity
- Adjust lighting outputs in a spatially differentiated manner, reducing illumination in well-lit, occupied areas while compensating for low-light conditions in unoccupied zones to maintain a visually balanced environment;
 - Manage conflicting HVAC demands by integrating humidity, temperature, and air quality indicators, leading to a moderated system response;
 - Provide interpretable and adaptive control actions through the coordination of multiple overlapping rules in a heterogeneous indoor context.
 
5.6. General Performance Remarks
6. Conclusions
Limitations and Critical Points
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Lu, V.L.; Chen, X.; Chen, J.; Jiao, K. Toward Energy-Efficient Buildings: Perspectives and Approaches; Elsevier: Amsterdam, The Netherlands, 2025. [Google Scholar]
 - Scrucca, F.; Ingrao, C.; Barberio, G.; Matarazzo, A.; Lagioia, G. On the role of sustainable buildings in achieving the 2030 UN sustainable development goals. Environ. Impact Assess. Rev. 2023, 100, 107069. [Google Scholar] [CrossRef]
 - Jettanasen, C.; Thongsuk, S.; Sottiyaphai, C.; Songsukthawan, P.; Chiradeja, P.; Lertwanitrot, P.; Ananwattanaporn, S.; Ngaopitakkul, A. An approach to energy conservation in lighting systems using luminaire-based sensor for automatic dimming. Sci. Rep. 2025, 15, 3302. [Google Scholar] [CrossRef] [PubMed]
 - Pistochini, T.; Ellis, M.; Meyers, F.; Frasier, A.; Cappa, C.; Bennett, D. Method of test for CO2-based demand control ventilation systems: Benchmarking the state-of-the-art and the undervalued potential of proportional-integral control. Energy Build. 2023, 301, 113717. [Google Scholar] [CrossRef]
 - Reddy, V.J.; Ghazali, M.F.; Kumarasamy, S. Advancements in phase change materials for energy-efficient building construction: A comprehensive review. J. Energy Storage 2024, 81, 110494. [Google Scholar] [CrossRef]
 - Chung, M.H.; Yoo, S.; Jung, W.N.; Jeong, H.; Yoo, K.H. Self-powered airflow sensor based on energy harvesting of ventilation air in buildings. Adv. Fiber Mater. 2023, 5, 1788–1798. [Google Scholar] [CrossRef]
 - Marques, G.; González-Briones, A. Internet of Things for Smart Environments; Springer: Berlin/Heidelberg, Germany, 2023. [Google Scholar]
 - Houssein, E.H.; Othman, M.A.; Mohamed, W.M.; Younan, M. Internet of Things in Smart Cities: Comprehensive Review, Open Issues, and Challenges. IEEE Internet Things J. 2024, 11, 34941–34952. [Google Scholar] [CrossRef]
 - Ahmed, M.R.; Myo, T.; Aseeri, M.A.; Al Baroomi, B.; Kaiser, M.; Srimal, W. Internet of Things-Based Smart Building for Energy Efficiency. In Future Energy: Challenge, Opportunity, and, Sustainability; Springer: Berlin/Heidelberg, Germany, 2023; pp. 87–97. [Google Scholar]
 - García-Monge, M.; Zalba, B.; Casas, R.; Cano, E.; Guillén-Lambea, S.; López-Mesa, B.; Martínez, I. Is IoT monitoring key to improve building energy efficiency? Case study of a smart campus in Spain. Energy Build. 2023, 285, 112882. [Google Scholar] [CrossRef]
 - Perera, A.; Godaliyadda, R.; Hakkinen, J.; Katz, M. Lighting the Way for a Sustainable Future: Overcoming Challenges in Light-Based IoT and Data-Energy Networking. IEEE Commun. Mag. 2025, 1–7. [Google Scholar] [CrossRef]
 - Cheng, Y.L.; Lim, M.H.; Hui, K.H. Impact of internet of things paradigm towards energy consumption prediction: A systematic literature review. Sustain. Cities Soc. 2022, 78, 103624. [Google Scholar] [CrossRef]
 - Nikpour, M.; Yousefi, P.B.; Jafarzadeh, H.; Danesh, K.; Shomali, R.; Asadi, S.; Lonbar, A.G.; Ahmadi, M. Intelligent energy management with IoT framework in smart cities using intelligent analysis: An application of machine learning methods for complex networks and systems. J. Netw. Comput. Appl. 2025, 235, 104089. [Google Scholar] [CrossRef]
 - Lee, E.; Seo, Y.D.; Oh, S.R.; Kim, Y.G. A Survey on Standards for Interoperability and Security in the Internet of Things. IEEE Commun. Surv. Tutor. 2021, 23, 1020–1047. [Google Scholar] [CrossRef]
 - Moudgil, V.; Hewage, K.; Hussain, S.A.; Sadiq, R. Integration of IoT in building energy infrastructure: A critical review on challenges and solutions. Renew. Sustain. Energy Rev. 2023, 174, 113121. [Google Scholar] [CrossRef]
 - Xue, S.; Huang, H.; Liu, J.; Yang, Q.; Zhao, L.; Wu, H. An Effective Scheme to Solve Critical Data Missing Problems for IoT-Based Smart Energy Management. IEEE Internet Things J. 2025, 12, 4466–4474. [Google Scholar] [CrossRef]
 - Gu, X.; Han, J.; Shen, Q.; Angelov, P.P. Autonomous learning for fuzzy systems: A review. Artif. Intell. Rev. 2023, 56, 7549–7595. [Google Scholar] [CrossRef]
 - Mendel, J.M. Explainable Uncertain Rule-Based Fuzzy Systems; Springer: Berlin/Heidelberg, Germany, 2024. [Google Scholar]
 - Kruse, R.; Mostaghim, S.; Borgelt, C.; Braune, C.; Steinbrecher, M. Fuzzy Control. In Computational Intelligence: A Methodological Introduction; Springer International Publishing: Berlin/Heidelberg, Germany, 2022; pp. 451–470. [Google Scholar]
 - Arun, M.; Efremov, C.; Nguyen, V.N.; Barik, D.; Sharma, P.; Bora, B.J.; Kowalski, J.; Le, H.C.; Truong, T.H.; Cao, D.N. Fuzzy logic-supported building design for low-energy consumption in urban environments. Case Stud. Therm. Eng. 2024, 64, 105384. [Google Scholar] [CrossRef]
 - IEEE 1855-2016; IEEE Standard for Fuzzy Markup Language, Standard 1855-2016. IEEE: Piscataway, NJ, USA, 2016; pp. 1–89. Available online: https://standards.ieee.org/findstds/standard/1855-2016.html (accessed on 16 July 2025).
 - Soto-Hidalgo, J.M.; Alonso, J.M.; Acampora, G.; Alcalá-Fdez, J. JFML: A java library to design fuzzy logic systems according to the IEEE std 1855-2016. IEEE Access 2018, 6, 54952–54964. [Google Scholar] [CrossRef]
 - Rodriguez-Lozano, F.J.; Gámez-Granados, J.C.; Banos, O.; Alcalá-Fdez, J.; Soto-Hidalgo, J.M. An approach to bridge the gap between ubiquitous embedded devices and JFML: A new module for Internet of Things. In Proceedings of the IEEE International Conference on Fuzzy Systems (FUZZ-IEEE 2021), Luxembourg, 11–14 July 2021; pp. 1–6. [Google Scholar] [CrossRef]
 - Amadeo, M.; Cicirelli, F.; Guerrieri, A.; Ruggeri, G.; Spezzano, G.; Vinci, A. When edge intelligence meets cognitive buildings: The COGITO platform. Internet Things 2023, 24, 100908. [Google Scholar] [CrossRef]
 - Hosamo, H.; Mazzetto, S. Data-Driven Ventilation and Energy Optimization in Smart Office Buildings: Insights from a High-Resolution Occupancy and Indoor Climate Dataset. Sustainability 2024, 17, 58. [Google Scholar] [CrossRef]
 - Sayed, A.N.; Himeur, Y.; Bensaali, F. Deep and transfer learning for building occupancy detection: A review and comparative analysis. Eng. Appl. Artif. Intell. 2022, 115, 105254. [Google Scholar] [CrossRef]
 - Gugueoth, V.; Safavat, S.; Shetty, S.; Rawat, D. A review of IoT security and privacy using decentralized blockchain techniques. Comput. Sci. Rev. 2023, 50, 100585. [Google Scholar] [CrossRef]
 - Llaria, A.; Dos Santos, J.; Terrasson, G.; Boussaada, Z.; Merlo, C.; Curea, O. Intelligent buildings in smart grids: A survey on security and privacy issues related to energy management. Energies 2021, 14, 2733. [Google Scholar] [CrossRef]
 - Hazra, A.; Rana, P.; Adhikari, M.; Amgoth, T. Fog computing for next-generation internet of things: Fundamental, state-of-the-art and research challenges. Comput. Sci. Rev. 2023, 48, 100549. [Google Scholar] [CrossRef]
 - Demil, S.; Abdmeziem, M.R. Incentivizing task offloading in IoT: A distributed auctions-based DRL approach. Internet Things 2025, 30, 101493. [Google Scholar] [CrossRef]
 - Al Sayed, K.; Boodi, A.; Sadeghian Broujeny, R.; Beddiar, K. Reinforcement learning for HVAC control in intelligent buildings: A technical and conceptual review. J. Build. Eng. 2024, 95, 110085. [Google Scholar] [CrossRef]
 - King, E.; Yu, H.; Lee, S.; Julien, C. Sasha: Creative goal-oriented reasoning in smart homes with large language models. Proc. ACM Interactive Mob. Wearable Ubiquitous Technol. 2024, 8, 1–38. [Google Scholar] [CrossRef]
 - Song, Y.; Li, J.; Bian, Y.; Cai, Z. Predicting User Behavior in Smart Spaces with LLM-Enhanced Logs and Personalized Prompts. In Proceedings of the AAAI Conference on Artificial Intelligence, Philadelphia, PA, USA, 25 February–4 March 2025; Volume 39, pp. 764–772. [Google Scholar]
 - Himeur, Y.; Ghanem, K.; Alsalemi, A.; Bensaali, F.; Amira, A. Artificial intelligence based anomaly detection of energy consumption in buildings: A review, current trends and new perspectives. Appl. Energy 2021, 287, 116601. [Google Scholar] [CrossRef]
 - Haghighat, M.; MohammadiSavadkoohi, E.; Shafiabady, N. Applications of Explainable Artificial Intelligence (XAI) and interpretable Artificial Intelligence (AI) in smart buildings and energy savings in buildings: A systematic review. J. Build. Eng. 2025, 107, 112542. [Google Scholar] [CrossRef]
 - Okoro, U.G.; Mubaraq, A.; Olugu, E.U.; Lawal, S.A.; Wong, K.Y. A dynamic maintenance planning methodology for HVAC systems based on Fuzzy-TOPSIS and failure mode and Effect Analysis. J. Build. Eng. 2024, 98, 111326. [Google Scholar] [CrossRef]
 - Wu, D.; Yang, H.; Xu, K.; Meng, X.; Yin, S.; Zhu, C.; Jin, X. Data and knowledge fusion-driven Bayesian networks for interpretable fault diagnosis of HVAC systems. Int. J. Refrig. 2024, 161, 101–112. [Google Scholar] [CrossRef]
 - Abdolhosseini, M.; Abdollahi, R. Designing and Implementing a Lighting Control System Based on Constrained Info-Fuzzy, to Save Energy and Satisfy Users. IEEE Trans. Ind. Inform. 2024, 20, 6718–6725. [Google Scholar] [CrossRef]
 - Prince; Hati, A.S.; Kumar, P. An adaptive neural fuzzy interface structure optimisation for prediction of energy consumption and airflow of a ventilation system. Appl. Energy 2023, 337, 120879. [Google Scholar] [CrossRef]
 - Halhoul Merabet, G.; Essaaidi, M.; Ben Haddou, M.; Qolomany, B.; Qadir, J.; Anan, M.; Al-Fuqaha, A.; Abid, M.R.; Benhaddou, D. Intelligent building control systems for thermal comfort and energy-efficiency: A systematic review of artificial intelligence-assisted techniques. Renew. Sustain. Energy Rev. 2021, 144, 110969. [Google Scholar] [CrossRef]
 - Salari, S.; Karimi, A. Introducing an integrated approach for fire safety assessment in healthcare facilities by interval valued neutrosophic-AHP and Fuzzy Inference System. Heliyon 2025, 11, e41660. [Google Scholar] [CrossRef] [PubMed]
 - Abbasi, M.; Tokhi, M.O.; Eyvazzadeh, N.; Falahati, M.; Zokaei, M. Prioritization of noise abatement methods for controlling hospital noise pollution. J. Low Freq. Noise Vib. Act. Control 2024, 43, 1126–1138. [Google Scholar] [CrossRef]
 - Alghassab, M.A. Fuzzy-based smart energy management system for residential buildings in Saudi Arabia: A comparative study. Energy Rep. 2024, 11, 1212–1224. [Google Scholar] [CrossRef]
 - Maghfiroh, H.; Wahyunggoro, O.; Cahyadi, A.I. Energy management in hybrid electric and hybrid energy storage system vehicles: A fuzzy logic controller review. IEEE Access 2024, 12, 56097–56109. [Google Scholar] [CrossRef]
 - Cavus, M.; Dissanayake, D.; Bell, M. Deep-Fuzzy Logic Control for Optimal Energy Management: A Predictive and Adaptive Framework for Grid-Connected Microgrids. Energies 2025, 18, 995. [Google Scholar] [CrossRef]
 - Konecny, J.; Prauzek, M.; Borova, M. Fuzzy Controlled Wavelet-Based Edge Computing Method for Energy-Harvesting IoT Sensors. IEEE Internet Things J. 2023, 10, 18909–18918. [Google Scholar] [CrossRef]
 - Lu, J.; Ma, G.; Zhang, G. Fuzzy Machine Learning: A Comprehensive Framework and Systematic Review. IEEE Trans. Fuzzy Syst. 2024, 32, 3861–3878. [Google Scholar] [CrossRef]
 - Kim, H.; Kim, S.; Lee, J. Integration of IoT sensor data and BIM for real-time energy performance simulation. Autom. Constr. 2023, 149, 104931. [Google Scholar] [CrossRef]
 - Arsiwala, M.; Mahalle, P.; Gudadhe, M.; Pradhan, S. A hybrid BIM and fuzzy logic model for optimizing building energy performance. Sustainability 2023, 15, 16436. [Google Scholar] [CrossRef]
 



| Device Type | Model | JFML-IoT Class | 
|---|---|---|
| Temperature Sensor | DHT22 | DHT22Sensor | 
| Humidity Sensor | DHT22 | DHT22Sensor | 
| CO2 Sensor | MH-Z19 | MHZ19Sensor | 
| Illuminance Sensor | BH1750 | BH1750Sensor | 
| Occupancy Sensor | HC-SR501 (PIR) | PIRSensor | 
| Lighting Actuator | PWM-controlled LED driver | LightingActuator | 
| Ventilation Actuator | Relay-controlled fan switch | VentilationActuator | 
| HVAC Actuator | Relay or IR-based HVAC control | HVACActuator | 
| Input Variables | Description | Domain | Sensors | 
|---|---|---|---|
| Room Temperature 1 | Temperature in °C (zone 1) | [0–40] | DHT22 Sensor | 
| Room Temperature 2 | Temperature in °C (zone 2) | [0–40] | DHT22 Sensor | 
| Room Humidity 1 | Relative humidity in % (zone 1) | [0–100] | DHT22 Sensor | 
| Room Humidity 2 | Relative humidity in % (zone 2) | [0–100] | DHT22 Sensor | 
| Illuminance 1 | Light level in lux (zone 1) | [0–1000] | BH1750 Light Sensor | 
| Illuminance 2 | Light level in lux (zone 2) | [0–1000] | BH1750 Light Sensor | 
| Occupancy 1 | Motion detection (binary, zone 1) | [0–1] | HC-SR501 PIR Sensor | 
| Occupancy 2 | Motion detection (binary, zone 2) | [0–1] | HC-SR501 PIR Sensor | 
| CO2 Level | Air quality in ppm | [400–2000] | MH-Z19 CO2 Sensor | 
| Output Variables | Description | Domain | Actuators | 
| Lighting Control 1 | Light dimming level (zone 1) | [0–1] | PWM-controlled LED Driver | 
| Lighting Control 2 | Light dimming level (zone 2) | [0–1] | PWM-controlled LED Driver | 
| Ventilation Control | Ventilation system state | [0–1] | Relay-based Fan Switch | 
| HVAC Control | HVAC on/off or power level | [0–1] | Relay-based HVAC Interface | 
| Fuzzy Rule | Agreement Score (0–4) | 
|---|---|
| IF Room Temperature 1 is High AND Occupancy 1 is True THEN HVAC Control is Max | 4 | 
| IF Illuminance 1 is Low AND Occupancy 1 is True THEN Lighting Control 1 is Bright | 4 | 
| IF CO2 Level is High AND Occupancy 2 is True THEN Ventilation Control is On | 3 | 
| IF Room Temperature 2 is Low AND Occupancy 2 is False THEN HVAC Control is Medium | 2 | 
| IF Illuminance 2 is Medium AND Occupancy 2 is True THEN Lighting Control 2 is Dim | 4 | 
| Rule | Fuzzy Rules | 
|---|---|
| R01 | IF RoomTemperature1 IS High AND Occupancy1 IS True THEN HVACControl IS Max, VentilationControl IS Moderate | 
| R02 | IF RoomTemperature1 IS Medium AND Occupancy1 IS True THEN HVACControl IS Low | 
| R03 | IF RoomTemperature1 IS Low AND Occupancy1 IS True THEN HVACControl IS Max, VentilationControl IS Moderate | 
| R04 | IF RoomTemperature2 IS High AND Occupancy2 IS True THEN HVACControl IS Max, VentilationControl IS Moderate | 
| R05 | IF RoomTemperature2 IS Medium AND Occupancy2 IS True THEN HVACControl IS Low | 
| R06 | IF RoomTemperature2 IS Low AND Occupancy2 IS True THEN HVACControl IS Max, VentilationControl IS Moderate | 
| R07 | IF Illuminance1 IS High THEN LightingControl1 IS Off | 
| R08 | IF Illuminance1 IS Medium AND Occupancy1 IS True THEN LightingControl1 IS Dim | 
| R09 | IF Illuminance1 IS Low AND Occupancy1 IS True THEN LightingControl1 IS Bright | 
| R10 | IF Illuminance2 IS High THEN LightingControl2 IS Off | 
| R11 | IF Illuminance2 IS Medium AND Occupancy2 IS True THEN LightingControl2 IS Dim | 
| R12 | IF Illuminance2 IS Low AND Occupancy2 IS True THEN LightingControl2 IS Bright | 
| R13 | IF Illuminance1 IS Low AND Occupancy1 IS False AND Occupancy2 IS True THEN LightingControl1 IS Dim | 
| R14 | IF Illuminance2 IS Low AND Occupancy2 IS False AND Occupancy1 IS True THEN LightingControl2 IS Dim | 
| R15 | IF CO2Level IS High THEN VentilationControl IS Max | 
| R16 | IF CO2Level IS Medium THEN VentilationControl IS Moderate, HVACControl IS Low | 
| R17 | IF CO2Level IS Low THEN VentilationControl IS Off | 
| R18 | IF CO2Level IS High AND Occupancy2 IS True THEN VentilationControl IS Max | 
| R19 | IF RoomHumidity1 IS High AND RoomTemperature1 IS High THEN HVACControl IS High | 
| R20 | IF RoomHumidity1 IS High AND Occupancy1 IS True AND RoomTemperature1 IS Medium THEN HVACControl IS High | 
| R21 | IF RoomHumidity2 IS High AND RoomTemperature2 IS High THEN HVACControl IS High | 
| R22 | IF RoomHumidity2 IS High AND Occupancy2 IS True AND RoomTemperature2 IS Medium THEN HVACControl IS High | 
| R23 | IF RoomHumidity1 IS Low OR RoomHumidity2 IS Low THEN HVACControl IS High | 
| R24 | IF Occupancy1 IS True OR Occupancy2 IS True THEN HVACControl IS Medium, VentilationControl IS Moderate, LightingControl1 IS Dim, LightingControl2 IS Dim | 
| R25 | IF Occupancy1 IS False AND Occupancy2 IS False THEN HVACControl IS Off, VentilationControl IS Off, LightingControl1 IS Off, LightingControl2 IS Off | 
| R26 | IF Occupancy1 IS False AND Occupancy2 IS False AND CO2Level IS Low THEN HVACControl IS Off, VentilationControl IS Moderate, LightingControl1 IS Off, LightingControl2 IS Off | 
| Scenario | Te.1 | Hum.1 | Illu.1 | Oc.1 | Te.2 | Hum.2 | Illu.2 | Oc.2 | CO2 | 
|---|---|---|---|---|---|---|---|---|---|
| S1: High Temp + Occupied | 35 | 55 | 600 | 1 | 33 | 60 | 700 | 1 | 800 | 
| S2: Low Temp + Unoccupied | 12 | 45 | 400 | 0 | 14 | 50 | 500 | 0 | 500 | 
| S3: Medium CO2 + Occupancy | 22.5 | 50 | 350 | 1 | 22 | 45 | 450 | 1 | 1300 | 
| S4: Low Light + Occupancy | 20 | 50 | 100 | 1 | 21 | 55 | 150 | 1 | 400 | 
| S5: Low/High Light + Un/Occupancy + High Humidity  | 20 | 85 | 50 | 0 | 21 | 80 | 850 | 1 | 400 | 
| Input Variable | Value | Input Variable | Value | 
|---|---|---|---|
| RoomTemperature1 | 35.0 °C | RoomTemperature2 | 33.0 °C | 
| RoomHumidity1 | 55.0% | RoomHumidity2 | 60.0% | 
| Occupancy1 | 1.0 | Occupancy2 | 1.0 | 
| Illuminance1 | 600.0 lx | Illuminance2 | 700.0 lx | 
| CO2 Level | 800.0 ppm | – | – | 
| Rule | Description | Membership Degree | 
|---|---|---|
| R01 | IF RoomTemperature1 IS High AND Occupancy1 IS True THEN HVACControl IS Max, VentilationControl IS Moderate | 0.67 | 
| R04 | IF RoomTemperature2 IS High AND Occupancy2 IS True THEN HVACControl IS Max, VentilationControl IS Moderate | 0.53 | 
| R08 | IF Illuminance1 IS Medium AND Occupancy1 IS True THEN LightingControl1 IS Dim | 0.67 | 
| R11 | IF Illuminance2 IS Medium AND Occupancy2 IS True THEN LightingControl2 IS Dim | 0.34 | 
| R16 | IF CO2Level IS Medium THEN VentilationControl IS Moderate, HVACControl IS Low | 0.2 | 
| R24 | IF Occupancy1 IS True OR Occupancy2 IS True THEN HVACControl IS Medium, VentilationControl IS Moderate, LightingControl1 IS Dim, LightingControl2 IS Dim | 1.0 | 
| Output Var. | HVACControl | VentilationControl | LightingControl1 | LightingControl2 | 
|---|---|---|---|---|
| Inferred Value | 0.581 | 0.467 | 0.467 | 0.467 | 
| Input Variable | Value | Input Variable | Value | 
|---|---|---|---|
| RoomTemperature1 | 12.0 °C | RoomTemperature2 | 14.0 °C | 
| RoomHumidity1 | 45.0% | RoomHumidity2 | 50.0% | 
| Occupancy1 | 0.0 | Occupancy2 | 0.0 | 
| Illuminance1 | 400.0 lx | Illuminance2 | 500.0 lx | 
| CO2 Level | 500.0 ppm | – | – | 
| Rule | Description | Membership Degree | 
|---|---|---|
| R17 | IF CO2Level IS Low THEN VentilationControl IS Off | 0.75 | 
| R25 | IF Occupancy1 IS False AND Occupancy2 IS False THEN HVACControl IS Off, VentilationControl IS Off, LightingControl1 IS Off, LightingControl2 IS Off | 1.0 | 
| R26 | IF Occupancy1 IS False AND Occupancy2 IS False AND CO2Level IS Low THEN HVACControl IS Off, VentilationControl IS Moderate, LightingControl1 IS Off, LightingControl2 IS Off | 0.75 | 
| Output Var. | HVACControl | VentilationControl | LightingControl1 | LightingControl2 | 
|---|---|---|---|---|
| Inferred Value | 0 | 0.324 | 0 | 0 | 
| Input Variable | Value | Input Variable | Value | 
|---|---|---|---|
| RoomTemperature1 | 22.5 °C | RoomTemperature2 | 22.0 °C | 
| RoomHumidity1 | 50.0% | RoomHumidity2 | 45.0% | 
| Occupancy1 | 1.0 | Occupancy2 | 1.0 | 
| Illuminance1 | 350.0 lx | Illuminance2 | 450.0 lx | 
| CO2 Level | 1300.0 ppm | – | – | 
| Rule | Description | Membership Degree | 
|---|---|---|
| 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 Illuminance1 IS Medium AND Occupancy1 IS True THEN LightingControl1 IS Dim | 0.5 | 
| R11 | IF Illuminance2 IS Medium AND Occupancy2 IS True THEN LightingControl2 IS Dim | 0.83 | 
| R16 | IF CO2Level 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, LightingControl1 IS Dim, LightingControl2 IS Dim | 1.0 | 
| Output Var. | HVACControl | VentilationControl | LightingControl1 | LightingControl2 | 
|---|---|---|---|---|
| Inferred Value | 0.426 | 0.467 | 0.467 | 0.467 | 
| Input Variable | Value | Input Variable | Value | 
|---|---|---|---|
| RoomTemperature1 | 20.0 °C | RoomTemperature2 | 21.0 °C | 
| RoomHumidity1 | 50.0% | RoomHumidity2 | 55.0% | 
| Occupancy1 | 1.0 | Occupancy2 | 1.0 | 
| Illuminance1 | 100.0 lx | Illuminance2 | 150.0 lx | 
| CO2 Level | 400.0 ppm | – | – | 
| Rule | Description | Membership Degree | 
|---|---|---|
| R02 | IF RoomTemperature1 IS Medium AND Occupancy1 IS True THEN HVACControl IS Low | 0.67 | 
| R05 | IF RoomTemperature2 IS Medium AND Occupancy2 IS True THEN HVACControl IS Low | 0.8 | 
| R09 | IF Illuminance1 IS Low AND Occupancy1 IS True THEN LightingControl1 IS Bright | 0.67 | 
| R12 | IF Illuminance2 IS Low AND Occupancy2 IS True THEN LightingControl2 IS Bright | 0.5 | 
| R17 | IF CO2Level IS Low THEN VentilationControl IS Off | 1.0 | 
| R24 | IF Occupancy1 IS True OR Occupancy2 IS True THEN HVACControl IS Medium, VentilationControl IS Moderate, LightingControl1 IS Dim, LightingControl2 IS Dim | 1.0 | 
| Output Var. | HVACControl | VentilationControl | LightingControl1 | LightingControl2 | 
|---|---|---|---|---|
| Inferred Value | 0.4 | 0.331 | 0.63 | 0.61 | 
| Input Variable | Value | Input Variable | Value | 
|---|---|---|---|
| RoomTemperature1 | 20.0 °C | RoomTemperature2 | 21.0 °C | 
| RoomHumidity1 | 85.0% | RoomHumidity2 | 80.0% | 
| Occupancy1 | 0 | Occupancy2 | 1 | 
| Illuminance1 | 50.0 lx | Illuminance2 | 850.0 lx | 
| CO2 Level | 400.0 ppm | – | – | 
| Rule | Description | Membership Degree | 
|---|---|---|
| R05 | IF RoomTemperature2 IS Medium AND Occupancy2 IS True THEN HVACControl IS Low | 0.8 | 
| R10 | IF Illuminance2 IS High THEN LightingControl2 IS Off | 0.5 | 
| R13 | IF Illuminance1 IS Low AND Occupancy1 IS False AND Occupancy2 IS True THEN LightingControl1 IS Dim | 0.83 | 
| R17 | IF CO2Level IS Low THEN VentilationControl IS Off | 1.0 | 
| R22 | IF RoomHumidity2 IS High AND Occupancy2 IS True AND RoomTemperature2 IS Medium THEN HVACControl IS High | 0.5 | 
| R24 | IF Occupancy1 IS True OR Occupancy2 IS True THEN HVACControl IS Medium, VentilationControl IS Moderate, LightingControl1 IS Dim, LightingControl2 IS Dim | 1.0 | 
| Output Var. | HVACControl | VentilationControl | LightingControl1 | LightingControl2 | 
|---|---|---|---|---|
| Inferred Value | 0.48 | 0.33 | 0.46 | 0.11 | 
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.  | 
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Martínez-Rojas, M.; Cano, C.; Alcalá-Fdez, J.; Soto-Hidalgo, J.M. Interpretable Fuzzy Control for Energy Management in Smart Buildings Using JFML-IoT and IEEE Std 1855-2016. Appl. Sci. 2025, 15, 8208. https://doi.org/10.3390/app15158208
Martínez-Rojas M, Cano C, Alcalá-Fdez J, Soto-Hidalgo JM. Interpretable Fuzzy Control for Energy Management in Smart Buildings Using JFML-IoT and IEEE Std 1855-2016. Applied Sciences. 2025; 15(15):8208. https://doi.org/10.3390/app15158208
Chicago/Turabian StyleMartínez-Rojas, María, Carlos Cano, Jesús Alcalá-Fdez, and José Manuel Soto-Hidalgo. 2025. "Interpretable Fuzzy Control for Energy Management in Smart Buildings Using JFML-IoT and IEEE Std 1855-2016" Applied Sciences 15, no. 15: 8208. https://doi.org/10.3390/app15158208
APA StyleMartínez-Rojas, M., Cano, C., Alcalá-Fdez, J., & Soto-Hidalgo, J. M. (2025). Interpretable Fuzzy Control for Energy Management in Smart Buildings Using JFML-IoT and IEEE Std 1855-2016. Applied Sciences, 15(15), 8208. https://doi.org/10.3390/app15158208
        
