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

Simple templating question for last_changed

$
0
0

Can I template the last changed attribute of an entity_id?

e.g. If I pass a script a variable which is an entity_id can that script then determine the last changed value for that entity?

service: script.my_script
data:
  triggered_by: trigger.id

In script.my_script is there a correct syntax to do this?

- condition: template
  value_template: >
    {% set last_changed = states.triggered_by.last_changed %}

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106310

Trending Articles



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