Closed jesperldk closed 3 years ago
{{ config.entity_id }}
I couldn't really find any docu on this, but by experimenting a bit, it seems like config.entity holds the name of the entity, but I could not figure out what config.entity_id is.
Anyway, I can now do:
type: custom:template-entity-row
state: "{{ state_attr( config.entity, 'message' ) }}"
secondary: "{{ relative_time( states[config.entity].last_updated ) }}"
And is very happy :-)
edit: well, relative_time( states[config.entity].last_updated )
does not update (of course), and does not make sense :-(
Yes, you're right. It's config.entity
. Sorry.
Auto-entities sets entity:
of each item configuration, and config
is mentioned in the template-entity-row readme.
When using auto-entities, it would be really nice if template-entity-row somehow could reference the current entity in jinja. As an example, it would allow me to show a specific attribute from the entity as secondary.