Is there a way to add a column to each entity or, while using templates instead of "include," is there a way to include "last-changed?"
I'm using this template to strip out "battery" from the entity names. But when I use template instead of include filter, secondary info doesn't work. If I try using both template AND include filter, then the entities are all duplicated.
type: custom:auto-entities
card:
type: entities
show_header_toggle: true
options:
secondary_info: last-changed
filter:
template: >-
{% for state in states.sensor -%}
{%- if state.entity_id | regex_match("sensor.*battery*", ignorecase=True) -%}
{{
{
'entity': state.entity_id,
'name': state.attributes.friendly_name.lower().replace('battery', ''),
}
}},
{%- endif -%}
{%- endfor %}
sort:
method: value
reverse: true
numeric: true
Is there a way to add a column to each entity or, while using templates instead of "include," is there a way to include "last-changed?"
I'm using this template to strip out "battery" from the entity names. But when I use template instead of include filter, secondary info doesn't work. If I try using both template AND include filter, then the entities are all duplicated.