I had an automation where the set points were hardcoded into the automation.
alias: 01. HW2 Cyl2 Valve On/Off
description: ""
triggers:
- trigger: state
entity_id:
- binary_sensor.hot_water_2_output
to: "on"
id: "on"
- trigger: state
entity_id:
- binary_sensor.hot_water_2_output
to: "off"
id: "off"
- entity_id: sensor.mixer_wwc2_current_temperature
above: "59"
id: hot
trigger: numeric_state
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id: "on"
- condition: numeric_state
entity_id: sensor.mixer_wwc2_current_temperature
below: "58"
sequence:
- data: {}
target:
entity_id:
- switch.hw_cyl2
action: switch.turn_on
- conditions:
- condition: trigger
id:
- "off"
- hot
sequence:
- data: {}
target:
entity_id:
- switch.hw_cyl2
action: switch.turn_off
mode: single
I wanted to move the setpoints into an input_number.
This works
alias: 01. HW2 Cyl2 Valve On/Off
description: ""
triggers:
- trigger: state
entity_id:
- binary_sensor.hot_water_2_output
to: "on"
id: "on"
- trigger: state
entity_id:
- binary_sensor.hot_water_2_output
to: "off"
id: "off"
- trigger: template
value_template: >-
{{ states('sensor.mixer_wwc2_current_temperature')|int -
states('input_number.dhw2_set_temperature')|int + 1 }}
for:
hours: 0
minutes: 0
seconds: 10
id: hot
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id: "on"
sequence:
- data: {}
target:
entity_id:
- switch.hw_cyl2
action: switch.turn_on
- conditions:
- condition: trigger
id:
- "off"
- hot
sequence:
- data: {}
target:
entity_id:
- switch.hw_cyl2
action: switch.turn_off
mode: single
but I can’t reproduce the second condition which is intended to stop the valve opening if the temperature is already above 58C.
I tried
- conditions:
- condition: trigger
id: "on"
- condition: template
value_template: >-
{{ states('sensor.mixer_wwc2_current_temperature')|int -
states('input_number.dhw2_set_temperature')|int + 2 }}
Any ideas? TIA.