24.11.2025, 13:58
I suppose it can be simplified a bit. The logic is as follows:
1st priority = turn on heating if room temperature is 6 degrees or lower
2nd priority = turn off heating if floor temperature is 29 degrees or higher
3rd priority = turn on heating if humidity is equal or larger than the setpoint
You can use the same scheduled script that runs once a minute.
For ventilation you said there are several speeds hence the 3 different setpoints for each speed. Alternatively you can use a single setpoint and calculate the next setpoint by adding some fixed amount or percentage.
1st priority = turn on heating if room temperature is 6 degrees or lower
2nd priority = turn off heating if floor temperature is 29 degrees or higher
3rd priority = turn on heating if humidity is equal or larger than the setpoint
You can use the same scheduled script that runs once a minute.
Code:
room_temp = grp.getvalue('3/1/1')
floor_temp = grp.getvalue('3/2/1')
humidity = grp.getvalue('4/1/1')
hum_setpoint = grp.getvalue('4/2/1')
if room_temp <= 6 then
heating = true
elseif floor_temp >= 29 then
heating = false
else
heating = humidity >= hum_setpoint
end
grp.write('3/4/1', heating)For ventilation you said there are several speeds hence the 3 different setpoints for each speed. Alternatively you can use a single setpoint and calculate the next setpoint by adding some fixed amount or percentage.