Hey folks,
I’m stepping my way through understanding templating, and I’m trying to use the below to achieve
When humidity is greater than 55%, switch on fan, and when it’s less than 55% switch off fan. Can anyone suggest what daft mistake I’m making in the below?
trigger:
- platform: template
value_template: >-
{% if state('sensor.main_bathroom_humidity') | float > 55 %}true{% endif
%}
id: Above 55% Humidity
- platform: template
value_template: >-
{% if state('sensor.main_bathroom_humidity') | float < 55 %}true{% endif
%}
id: Below 55% Humidity
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: Above 55% Humidity
sequence:
- service: switch.turn_on
data: {}
target:
entity_id: switch.main_bathroom_fan
- conditions:
- condition: trigger
id: Below 55% Humidity
sequence:
- service: switch.turn_off
data: {}
target:
entity_id: switch.main_bathroom_fan