Hello,
I’ve been struggling to get the template syntax correct.
Basically I want to enable the humidifer switch if the humidity drops above a setpoint and enable when below the setpoint
I got this working without templates, but I need to move to template because I want to enable when below setpoint-offset en disable when above setpoint+offset.
This is my code: (without the offset), i get nog errors, but nothing is triggered:
alias: "Downstair, Humidity: Control V2"
description: ""
trigger:
- platform: state
entity_id:
- sensor.bedroom_luchtvochtigheid
- input_number.downstairs_humidity_request
- input_boolean.downstairs_humidity_control
condition: []
action:
- if:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.downstairs_humidity_control
state: "off"
- condition: template
value_template: >-
{{(sensor.downstairs_luchtvochtigheid|int)>(input_number.downstairs_humidity_request|int)}}
then:
- service: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.humidifier_schakelaar_2
else:
- if:
- condition: template
value_template: >-
{{(sensor.downstairs_luchtvochtigheid|int)<(input_number.downstairs_humidity_request|int)}}
then:
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.humidifier_schakelaar_2
mode: single
what is wrong with:
{{(sensor.downstairs_luchtvochtigheid|int)>(input_number.downstairs_humidity_request|int)}}
and if corrected can I implemente an offset like this?.:
{{(sensor.downstairs_luchtvochtigheid|int)>(input_number.downstairs_humidity_request|int)+1}}
kind regards,
Nick