In Part 1 I created a system that replicated my existing heating system but run via my Domoticz. This delivered the following functionality
- Timed hot water with manual override
- Timed Central Heating with manual override
- Single room thermostat
In worked well under in Autumn. When the temperate dropped in winter we started getting issues. The heating appeared to turn itself off during the day and the system became unstable with resets needed a couple of times a week.
After a little bit of analysis from the logs it seemed that the heating manual override was to blame. In part 1 this was simply a timed 1 hour switch – you press it and the heating turns on for an hour.
- If the heating was already on via the timer the manual override turned off the timer after its 1 hour was up. The timer would only switch it back on at the next programmed cycle. My wife would try to boost the system in the morning only to have the effect of turning of the heating for the rest of the day. Not good for me when I got home from work…
- Turning on the Boost function did not always trigger the heating to fire if the temperature was above the thermostat set point. You needed to trigger the manual override and adjust the thermostat.
- Something about how the switch triggered seems to cause the stability issues. I have not been able understand why but since removing the old manual override option we haven’t had any crashes.
Time for an upgrade
The hot water has been fine so will not look to change that. The heating I want to smarten up a little.
The basic control logic stays the same however I introduced
- Using Timers on the Hallway Thermostat to allow me to adjust the temperature of the house based upon the time of day.
- Added logic so that the Boost function will always result in the house getting warmer regardless of what the thermostat is currently set at.
- At the end of the boost function the system should revert back to the normal timed mode.
Summary of devices in Domoticz and their function:
| Boiler – Heating Switch | Controls the Heating Channel on the receiver. No Change. |
| Heating Boost | Virtual switch upgrade from previous version. This not puts in heating into boost mode rather than a simple override for the timer. |
| Heating | Removed |
| Heating Timer | Virtual switch that is used to programme the heating timer. |
| Hallway Thermostat | Virtual Thermostat Setpoint used to set the desired temperature at different times of the day. |
| Boost Thermostat | Virtual Thermostat Setpoint used to record the boosted thermostat value when the boost mode is active. When the Boost mode is turned on this is either the current thermostat value or the current temperature +0.7. |
| Hallway TempHum | Temperature and Humidity sensor in the hallway |
I’ve decoupled the timed part of the system from the boost part so that they act independently of each other. The main control program then detects if the system is in boost mode and override the timed part of the system.
This requires a change the main control script as well as a new script that sets the Boost thermostat when the Boost mode is activated.
Screenshots from Domoticz:



Main Control script:
I have created two new variables to represent if the heating is on and what we want the target temperature of the house to be (depending on if boost mode is on). The boiler is then fired based on those two variables instead of the switches in Domoticz directly. The script is still on an automatic loop of 60 seconds.

commandArray = {}
if otherdevices['Heating Boost'] =="On" then
targetTemp = otherdevices['Boost Thermostat']
Heating = 'On'
elseif otherdevices['Heating Timer'] == 'On' then
targetTemp = otherdevices['Hallway Thermostat']
Heating = 'On'
else
Heating ='Off'
end
if Heating == 'On' then
if targetTemp - otherdevices_temperature['Hallway TempHum'] > 0.5 then
if otherdevices['Boiler - Heating Switch'] == 'Off' then
commandArray['Boiler - Heating Switch']='On'
end
else
if targetTemp - otherdevices_temperature['Hallway TempHum'] < 0 then
if otherdevices['Boiler - Heating Switch'] == 'On' then
commandArray['Boiler - Heating Switch']='Off'
end
end
end
else
--Heating is Off
if otherdevices['Boiler - Heating Switch'] == 'On' then
commandArray['Boiler - Heating Switch']='Off'
end
end
return commandArray
Activate Boost mode
This scripts activates when the state is changed and sets a temporary Boost mode thermostat that can be used in place of the actual thermostat. When the boost mode is switched on if checks if the temperature difference between the thermostat and actual temperate is great enough to fire the heating. If it is not then it looks at the current temperature and adds 0.7. This ensures that the system will always fire when the boost mode is activated and warm up the house.

commandArray = {}
if devicechanged['Heating Boost'] then
if otherdevices['Heating Boost'] == 'On' then
if otherdevices['Hallway Thermostat'] - otherdevices_temperature['Hallway TempHum'] > 0.5 then
commandArray['OpenURL'] = 'http://192.168.1.50:8080/json.htm?type=command¶m=udevice&idx=535&nvalue=0&svalue='..tostring(otherdevices['Hallway Thermostat'])..''
else
commandArray['OpenURL'] = 'http://192.168.1.50:8080/json.htm?type=command¶m=udevice&idx=535&nvalue=0&svalue='..tostring(otherdevices_temperature['Hallway TempHum']+0.7)..''
end
else
commandArray['OpenURL'] = 'http://192.168.1.50:8080/json.htm?type=command¶m=udevice&idx=535&nvalue=0&svalue='..'0'..''
end
end
return commandArray
Conclusion
We have been running this new system for a few weeks now and seems to be performing well. Certainly the number of complaints has come down and it feels like this is a ‘smarter’ system that the old 7 day programmer we had.
We have noticed where the temperature difference between rooms is quite noticeable. Our living room feels cold but the system isn’t firing as the hallway is warm. I am going to investigate the coloration in temperature between rooms – I don’t really want to have a warm living room and every other room feel tropical!