Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 109044

Automation trigger.state always FALSE?

$
0
0

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_ehzgchanges. 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

Read full topic


Viewing all articles
Browse latest Browse all 109044

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>