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

Templating entity_id from trigger attribute works for one action but not for the other

$
0
0

As in the topic, I’m trying to write “generic” code, for few triggers. Each trigger entity has related entities id as attributes. Example below is an attempt to chain 2 actions, first being condition, to trigger the snapshot for certain zone only if door in that zone were not opened before.

The latter works image entity_id is properly templated depending on the trigger, while the initial condition, fails to save with error:

Message malformed: Entity {{ state_attr(trigger.entity_id is neither a valid entity ID nor a valid UUID for dictionary value @ data['actions'][0]['entity_id']

actions:
  - condition: state
    entity_id: "{{ state_attr(trigger.entity_id, 'zone_door') }}"
    state: "off"
    for:
      hours: 0
      minutes: 0
      seconds: 15
  - action: image.snapshot
    metadata: {}
    data:
      filename: /media/snapshots/test.jpg
    target:
      entity_id: "{{ state_attr(trigger.entity_id, 'zone_snapshot') }}"

Am I doing something wrong, or is it just the case of “it is what it is”… …being conditions not accepting templating of entity_id?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106525

Trending Articles



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