@tom_l , @123 ,
Not certain why (probably because all the documentation says so) but I always thought that conditions in automations were different (nested) to scripts (single lined)
Is this just a stupid convention (mine) that I’ve been following ?
Interesting so this is a template…
I was wondering about this one, but for me the name was kind of misleading.
Anyway, thanks! I have replaced Condition with your code and now it seems that it doesn’t want to start at all. Does anyone know the reason?
The setup is looking like that:
The biggest room has a temperature sensor (WSDCGQ11LM) it connects via CC2531 and zigbee2mqtt to socket plug ZNCZ04LM. This one is starting and stopping a 25kW gas boiler.
So right now to turn this on, the condition will be that every 30 minutes it will check if the measured temperature is lower then setpoint minus 0,5 degrees (negative part of hysteresis).
To turn off every 5 minutes we will check if the measured temperature is higher then setpoint plus 0,5 degrees (positive part of hysteresis)
Hopefully thanks to that I will avoid too often switching on and off this gas boiler.
Is this right or wrong we will see. If you have better ideas please share. I still can’t test it because I’m waiting for a new gas boiler.
I don’t see the need to “check temperature every 30 minutes”. Even real thermostats don’t work that way (i.e. polling). They’re event-based, namely when thresholds are crossed (i.e. temperature rises above or falls below setpoint values).
I suggest you consider using the Generic Thermostat integration. You can specify hysteresis using the hot_tolerance and cold_tolerance options. You can also specify minimum operating time with min_cycle_duration.
About this Generic thermostat - I would love to use it but I have only does two elements that I have mentioned and neither of them is from Entity id of **climate** domain. Which seems to be a must to run this.
You will need to adjust the values to suit your preferences.
I have set min_cycle_duration to 120 seconds. You need to read the instructions for you gas boiler to determine the correct value. Basically, it means when the Generic Thermostat enables the gas boiler, it will allow it to run for no less than 120 seconds (it may need to be higher). This is to prevent what is known as ‘short-cycling’. It typically takes time for a gas appliance to startup and begin producing heat. You don’t want the Generic Thermostat to enable heating and then (potentially) disable it just 30 seconds later. In contrast, an electric heating device can easily support a short cycle time (i.e. 15 seconds or even less).
Many thanks, I didn’t know that you can define this entity.
It looks like there are big possibilities in Home Assistant but sometimes documentation from the main source could be better. It looks like it is written for people that already know Home assistant and this programming language but it is not easy for people that are starting.
Taras’s post above is pretty much exactly what I use.
I leave the heating on 24/365 but the target temperature gets updated by time, occupancy and doors/windows open etc.
Yes, I will have to write some scripts / automation or whatever that is called here, to adjust this Generic thermostat setpoint to time schedule (like night and day) and other but aslo leave some room for the user to do some temporary adjustments.