I have been using Generic Thermostats to control radiator valves. I’m using an input_boolean helper to indicate if the generic thermostat conditions mean the radiator should be on or off and another input_boolean which is related to whether or not I actually want the heating to come on.
- platform: generic_thermostat
name: b_temp
unique_id: b_temp_av
heater: input_boolean.b_state
target_sensor: sensor.average_temp_bedroom
min_temp: 17
max_temp: 22
cold_tolerance: 0.2
hot_tolerance: 0
min_cycle_duration:
seconds: 5
- id: srv_b
alias: sRV_B
trigger:
- platform: state
entity_id:
- input_boolean.b_state
from: 'off'
to: 'on'
- platform: state
entity_id:
- input_boolean.b_state
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: input_boolean.heating_switch
state: 'on'
action:
- service: '{% if is_state_attr(''climate.b_temp'', ''hvac_action'', ''heating'')
%} switch.turn_off {% elif is_state_attr(''climate.b_temp'', ''hvac_action'',
''idle'') %} switch.turn_on {% endif %}'
entity_id: switch.srv_bedroom
initial_state: 'true'
mode: restart
# turning the switch on closes the radiator valve
If the input_boolean.b_state turns on and I want the radiator to start warming the house (input_boolean.heating_switch is on) then my action checks the state attribute of the climate entity. If it’s already in ‘heating’ then the radiator valve switch will turn_off (or probably just remain off), so that the radiator valve stays open.
The reason I’ve done it this way is because when I turn the heating on/off, all my radiator valves run this respective automation, so they will open/close based on the generic thermostat but if I turn the heating off, all the switches will turn off and the valves will all open, to avoid any valves getting stuck closed.
I recently requested for the Generic Thermostat Integration to allow the use of input_booleans as the actuator switch but the merging to allow this was stopped by balloob and the recommendation is to use a Template Switch instead.
I created this setup many years ago and now trying to revisit it and remember my own logic is challenging (ever gone back to an excel spreadsheet and try to remember the formulas you set up!?) either way…
TL:DR
Could I have some guidance on how I could use a Template Switch to achieve the same? I do appreciate I could just keep this in YAML but if balloob says use a Template Switch seems something worth investigating.