Hi,
I am confused. I created an automation which actions depend on the state of the trigger:
alias: Helper E_Hzg Status
description: ""
triggers:
- trigger: state
entity_id:
- sensor.r_ehzg
to: null
conditions: []
actions:
- action: >-
input_boolean.turn_{% if(trigger.state == '1') %}on{% else %}off{% endif
%}
target:
entity_id: input_boolean.helper_ehzg
data: {}
mode: single
The automation fires whenever the state of sensor.r_ehzg
changes. But the result of the template is always input_boolean.turn_off
even if the state of the trigger is “1” (should be input_boolean.turn_on
in this case).
The r_ehzg is a mqtt sensor and when checking on the sensor history it displays ‘1’ or ‘0’ so I expected this to work.
What am I doing wrong here?
Thanks!
/KNEBB
11 posts - 3 participants