Development of the temperature prediction algorithm for smart thermostat

This article discloses systems for control of microclimate parameters in buildings and rooms with different intellectualization levels. Requirements to a smart thermostat as to a building automation system part and tasks for smart thermostat development have been formulated. Thermal models of a typical room and heating radiator have been developed. The results of development of the air temperature prediction algorithm and heating radiator capable of real time operation and ensuring adaptation to varying conditions in a room have been described. Testing of the algorithm using real data has been carried out. Study of the temperature control model’s behavior in connection with the change of input data and determined parameters has been carried out. Calculation method for the room air heating time up to set temperature has been determined. Maximum absolute temperature determination error when prediction time does not exceed 7 minutes is approximately 1°C and relative temperature determination error is less than 5%.


Introduction
As a rule, a smart home comprises functions of control over heating, ventilation and air conditioning systems, switching and regulation of lighting, as well as over the security assurance function, that is, unauthorized access or water and gas leakage alerts [1]. Energy saving is also a common function of smart homes [2,3,4,5]. By distributing this functionality across the entire building, a 'Smart Building' or a building automation system concept can be mentioned.
Let us review the smart home subsystem serving for maintenance of microclimate parameters in a room. Various heating, ventilation and air-conditioning systems are installed in modern buildings. Typically, each of the systems installed has its own control system. Typical situation is as follows: water heating radiators, electric underfloor heating, ventilation and air-conditioning system can be installed in a room. Radiators are manually controlled by means of a mechanical temperature controller. Underfloor heating is also user controlled and has a specific setpoint value. Ventilation system provides a constant or variable output. Air-conditioning system has its own temperature controller with its own temperature setpoint. All the above-mentioned systems installed in a room are not interconnected, and control thereof is carried out independently.
A situation where the above-mentioned systems may conflict with each other wasting energy is possible and is connected with inefficient control during combined operation of the said systems. Moreover, various systems that heat or cool a room have different performance and cost factor of energy that depend on external factors. An important task is to plan the operating modes, for example, consider the actual necessity in heating or cooling based on the number of people in rooms or on a schedule [6].
To conclude the aforesaid, the task of optimal temperature control in rooms can be formulated as follows: an optimal controller shall ensure the set quality of temperature control under a minimum power consumption or a minimum total cost of power consumed [6].
Let us review the main requirements to self-learning temperature control systems (smart thermostats).
Power and cost savings. Classic thermostats allow for setting temperature to a single value that has to be changed manually which cannot be called an efficient power use. Let us call this a zero level of intellectualization. Classic programmable models allow for planning what temperature in a room should be at certain hours during the day, which makes it possible to decrease it when there are no people in the room, thus providing significant power saving (first level of intellectualization). For example, Siemens REA23 thermostat [7] operates in a self-learning mode automatically tuning the parameters of an adaptive proportional-integral-differential (PID) controller. However, the temperature control is carried out according to a schedule set by a user, and not formed automatically based on the analysis of the user's behavior.
Smart thermostat automatically forms and dynamically changes the schedule based on the activity and presence of users while taking into account the user-defined priorities which allows for achievement of the best cost efficiency possible (second level of intellectualization). Some thermostat models study human preferences within time to build their own schedule and adapt to changes. Other models do not predict schedule based on previous activities, but automatically respond to the user's actions. Models with automatic scheduling apply a user's habits, his or her answers to a number of simple questions, and local weather conditions. Quite many works have been devoted to this topic, for example [8,9,10,11].
For instance, Nest Learning Thermostat adapts to the user activity timeline, his or her schedule and temperature preferences [12, 13], i.e. actually programs itself within a week, thereby creating a personalized schedule. The device continuously adapts to all the changes in the owner's schedule, since Auto-Away function automatically detects whether there is nobody at home, and then the thermostat automatically adjusts temperature to avoid heating an empty house [12,13]. In case the amount of saving needs to be determined, Nest Leaf technology will make it possible to determine how efficient the temperature condition modification settings are [12].
Thermostat integrability into the smart home system. Some models include domestic automaton functions which will make it possible to link the thermostat to other smart home ecosystem devices. For instance, it is possible to link a thermostat to a smart lock that activates the mode of people absence when a door gets locked and many other things.
Forming notifications, reminders, and user support. Most thermostats have the functionality for notification of various types, notifying the owner, for instance, when it is time to carry out basic maintenance of an air-conditioner or to replace air filters in the cooling system. The other will warn about heating or cooling system issues. Some models may provide a connection with a service center representative who services the thermostat.
In connection with the mentioned above, the development of operating and learning algorithms for a smart thermostat is relevant. Solution of the following tasks was required for the development [6]: • Development of the thermostat smart learning algorithms based on the analysis of thermal parameters of a building and user behavior. • Development of control method selection algorithm within the whole building.
• Assurance of 'maximum saving' and 'maximum comfort' modes based on a user's choice; however, energy resource saving mode shall consider available thermal energy sources with different tariffs. • Implementation of algorithms based on a certain control device. This work describes some aspects of solution of the first task.

Methods
Room temperature condition prediction implies development of a reliable thermal model with unambiguously determined parameters. On the one hand, the model shall reliably describe heat exchange physical processes, and on the other, it shall quickly adapt to real functioning conditions and changes of the room thermal parameters.

Air temperature in a room
Heat exchange formula (1) has been obtained for a typical room.

Heating radiator temperature
According to its form, thermal model for a radiator is similar to the model of air temperature (1), but has a smaller number of summands: In formula (2) In formula (3), the sum is calculated according to the last 5 temperature values. To determine 0  , single-dimension minimization method, the method of golden ratio, was used [16]. Similar approach was used to determine the unknown parameters of formula (2).

Results and discussions
Input data are the values of air temperature in a room and a heating radiator, as well as the heating radiator operation mode (on/off). Figure 1 shows the charts of temperature change of the radiator and air in the room according to which the model parameters were determined. Experimental and model values along line 2 in figure 1 are indistinctive.
Simulation task is to determine the time for heating of air in the room from some initial temperature to the set temperature by a predefined moment of time. Time required to heat air in a room from the initial temperature to the required one was calculated. Maximum temperature determination error is approximately 1°C (about 5%) when prediction time does not exceed 7 minutes. These differences can be observed in transient modes of switching the heating radiator on or off, and the differences in other modes are less than 1°С. As a result of adaptation of models (1) and (2), values of 0  and two sets of the radiator parameter values were determined: for 'on' and 'off' conditions. Let us review simulation of temperature condition control for the following case: consumer regulated condition: from 8 a.m. to 6 p.m. room air temperature shall be about 10°C, and from 6 p.m. to 8 a.m. it shall be maintained at the level of 22°C. Herewith, air heating in the room shall be started before 6 p.m. For the algorithm approbation, a two-step (on/off) temperature controller that supports different temperature values at different time intervals with deviation of not more than 1°C was implemented. The result is shown in figure 2, and it implies that starting from 8 a.m. temperatures decreases for approximately 1.8 hours (1 hour 48 min) from 22 to 10°C. The controller switches the heating radiator on approximately at 4:50 p.m. for heating up to 22°C by 6 p.m. Thus, the heating time was approximately 1 hour 10 minutes from 11 to 22°C. Abrupt ascent/descent of line 2 in figure 2 corresponds with switching the heating radiator on/off.

Conclusions
• Heat exchange equation suitable for practical implementation of the room temperature prediction has been composed. Mathematical model of room air temperature has been composed. Mathematical model of heating radiator temperature has been composed. • Algorithm of model parameter determination and room air temperature prediction has been developed. • Testing of the algorithm using real data has been carried out.
• Study of the temperature control model's behavior in connection with the change of input data and determined parameters has been carried out. • Calculation method for the room air heating time up to the set temperature has been determined.