I’m relatively new to HA.
I’m trying to replicate home heating controls to replace a thermostats and a wall timer with boost function.
I have a number of Zigbee temprature sensors along with a Zigbee relay (SWZn1).
The plan is to use the relay to control the Mason valve which will call heat from the boiler.
I have set up a schedule based helper (SchdZn1)
I have setup 4 threshold based helpers to mimic thermostats with setpoints (TZ1-TZ4) using the temprature sensors as sources.
What I’m struggeling with is building the logic using automations in the GUI.
As far as I understand an automation will only be triggered if an event in the trigger section changes state.
This is the “logic” for what I assume would be 2 automations:
“On automation”
IF (TZ1==ON OR TZ2==ON OR TZ3==ON OR TZ4==ON) AND (SchdZn1==ON OR TimerBoost==ON): SET SWZn1=ON
“Off automation”
IF (TZ1==OFF AND TZ2==OFF AND TZ3==OFF AND TZ4==OFF) OR (SchdZn1==OFF AND TimerBoost==OFF): SET SWZn1=OFF
Does that mean I would need to add all the entities to the “trigger” section and then build out their logic in the “and if” section?
If so how would I group enities as above in my (cruel attempt at a logic equation)?
Or would I only be able to build something like that by writing it in some form of code?
I would be awesome if someone can give me something to start with, should be able to work it from there:
“On automation”
IF (TZ1==ON OR TZ2==ON OR TZ3==ON OR TZ4==ON) AND (SchdZn1==ON OR TimerBoost==ON): SET SWZn1=ON
“Off automation”
IF (TZ1==OFF AND TZ2==OFF AND TZ3==OFF AND TZ4==OFF) OR (SchdZn1==OFF AND TimerBoost==OFF): SET SWZn1=OFF
Will have a look on Monday if no-one else gets there first. I had a look at the template binary sensor TZ-combining suggestion but that won’t work: if TZ1 and 2 are OFF, both sets of conditions can be true at once.
I think we’ll end up with an automation that
triggers off all of the TZ, schedule and boost entities;
has an or: pair of conditions to check one of the two logic sets is met;
runs a quick test in the action (probably on the OFF logic) to see if it should be turning on or off then take the appropriate action.
I think I’m sorted.
I ended up using a template with the logic in that and then using 2 automation.
1 to switch on the boiler and 1 to switch it off.
I added some extra logic to the template like an enable toggle for the schedule, the boost and them all the “thermostats” I made from the temperature sensors.
I just wish the scheduler could be configured down to a 5 or 15 minute mark, but 30 min increments will do for now.
Here is a sample of the template ( I did 3, one for the hotwater zone and 2 heating zones)
{{ (is_state('binary_sensor.thermostat_bedroommain', 'on') or is_state('binary_sensor.thermostat_study', 'on') or is_state('binary_sensor.thermostat_livingroom', 'on'))
and ((is_state('schedule.sch_heating_zone1', 'on') and is_state('input_boolean.enable_heating_schedule_zone1', 'on')) or is_state('timer.timer_boost_zone1','active')) }}