There are two types of thermostats now, the build-in one, and a event thermostat.
The last one keeps his schedule and profile inside globalvars which can be used in event conditions to control heating devices.


Renaud build Thermostat functionality, you can have several heating devices and temp sensors.

Here is a explanation about the parameters used:
- First of all, we need required temperatures (CONSTANT) : for example 19° when the heating is on, and 17° when nobody's home or during night.
- Then we create the heating device (HEATING): it has a temp sensor, and a device (to turn on or off)
- Then we create a scenario (SCENARII) just to make different behaviour of the thermostat : one for normal week, another one for out of home, ...
- For each scenario, I use SCHEDULE to define the requested temperature of each heating on a weekly base, for every 1/2 of an hour
- Using OVERVIEW screen, I can select the active schedule, I can also see the daily schedule, and if needed, I can change temporarily the requested temp (derogation).

Maybe the Heating screen is a little complicated :
- Name is the name.
- Sensor is the device we use to get the measured temperature
- Device is the device that receive On or Off orders, must have option is switchable.
- Offset is used in thermostat to avoid flapping ( in the example : the requested temp is 20, but it will heat on until 23° and then turn off )
- Inverted is to manage devices that turn on with a Off order (like electric radiator)
- Latency is the time the heating need to power on or off
- Regulator is a 2° domotic device used to manage the same heating (the device is used to power on or power off the heating, whereas the regulator is used to power min or power max the heating). If not used, just leave it empty.
- Offset and inverted is the same as for the device
- The last part Offset control is just to check offset values on a little graph.


Event Thermostat

You create the daily profile hour per hour with the profile editor and give it a name. Daily profile are saved in the database
Then on the week view you right click on each day and a drop menu let you select the profile.
When you save the weekly profile, it creates globalvars per control point. Thats all.

The rest is done through one single event per control point with a multi trigger and a condition:

Replace xxx with the name of the thermostat control point from the Thermostat Editor (or look at the created globalvars in the globalvar editor)
Dev_48 is a Digimax in this case.

Devices.SetDevice("Your Heating Device",
Var_Thermo_Control_xxx = "Profile"
And Cint(Mid(Var_Thermo_Profile_xxx,((WeekDay(Now())+6) MOD 7)*24*3+Hour(Now())*3+1,2)) < 0
And Dev_48_Value3 = "Heating"
Var_Thermo_Control_xxx = "Profile"
And Cint(Mid(Var_Thermo_Profile_xxx,((WeekDay(Now())+6) MOD 7)*24*3+Hour(Now())*3+1,2)) >0
And Cint(Dev_48_Value) < Cint(Mid(Var_Thermo_Profile_xxx,((WeekDay(Now())+6) MOD 7)*24*3+Hour(Now())*3+1,2))
Var_Thermo_Control_xxx = "Manual"
And Cint(Dev_48_Value) < Cint(Var_Thermo_Temp_xxx)
Var_Thermo_Control_xxx = "Local"
And Dev_48_Value3 = "Heating"

This thermostat was written by Francois, thanks!

Related Resources

    Updated by: rdnzl, Updated over 7 years ago
    Access count: 78919 since 2011-08-25

    Also available in: PDF HTML TXT