## 3 Problem Formulation
### The Proposed Model  
There are many parameters that can be considered as an input to the rule base of the fuzzy logic system. However, proposed research considers parameters that directly influence the user comfort and energy consumption minimization. This research investigates the inclusion of humidity as an input parameter to proposed FIS and adding feedback loop to the system in order to maintain the user comfort and reduce the energy consumption. The parameters used in the FIS are indoor temperature, outdoor temperature, pricing mechanism, occupant's presence, initialized set-point and relative humidity of the current house or region. In order to measure the real-time environmental variables, the use of wireless sensors is required. The proposed controller in this paper has the potential to be embedded in the IoT operating system RIOT as IoT increases the number of parameters to be monitored along with increase in the efficiency of control over the internet. FIS is used to decide how much energy consumption should be made by the controller. Figure 2 shows that environmental variables of the surroundings are monitored by the sensors. Crisp values of the input parameters i.e., indoor temperature, outdoor temperature, humidity, user occupancy and the initialized set-points are continuously sent to controllers and the measurements are periodically sent to the Internet over the gateway. It is assumed that the proposed technique communicates with a smart meter in order to read the price signal imposed by the utility. Initialized set-points on the thermostat are decided by the user on the basis of environmental conditions i.e., humidity and temperature. Energy management controller utilizes the fuzzy rule base inference system to make the decision regarding energy consumption based on the combinations of sensor values and smart grid price values by firing the corresponding rules. Decision on energy consumption is sent to HVAC by an actuator for the desired working of appliances. In addition, indoor temperature change is also monitored at 5 min intervals and sent to the controller through a feedback loop for the heater room model. After every 5 min, it is decided whether the heater should be ON or OFF on the basis of indoor temperature and thermostat set-point. A number of simulations have been performed to decide the optimal time interval for measuring the room temperature variation. If the interval is less than 5 min, a heater continuously switches between ON and OFF state, which is not suitable for energy conservation. However, if the interval is set for more than 5 min, simulation results have shown that the indoor temperature rises above the thermostat set-point that can affect the user thermal comfort. Because of this, a 5 min interval is considered as the optimal interval that maintains the balance between energy conservation and user comfort. In order to switch the heater ON or OFF, a relay is used. When the temperature of the room changes in accordance with the thermostat set-point proposed controller will send the command to an actuator that controls the working of the heater. Our fuzzy inference rule base takes 972 bytes of memory and our entire proposed system will have memory requirements of 2 kB. Less memory requirements and low processing power to traverse lookup tables make it ideal to be used with any IoT operating system. Operating system used for IoT software is RIOT. RIOT is a microkernel-based operating system that matches with various software requirements of devices and deals with challenges related to the constraint of memory and power consumption. RIOT has the ability to work for small networked devices that provide real-time controlling capabilities with less memory constraints. All of these features of RIOT make it a perfect choice to implement the proposed controller on system. In order to generate the fuzzy rule base system using the input parameters, a combinatorics method is devised that defines a total of 486 rules automatically, which is otherwise difficult to program manually.