I wish there was a way to use auto-entities to display all attributes of an entity on a seperate line of just some way to show all attributes on a card just like they were all seperate entities
so for instance I am using template sensors for these (plus 20 more):
I’d like to just show this without the templates although the friendly names are different to the attribute in some cases…
1 Like
David, I think there is a way to do it - but w/o friendly names for attributes:
- auto-entities with “filter → template” option.
- The template must create a list of all attributes for some entity.
type: custom:auto-entities
card:
type: entities
filter:
template: |-
{% set SENSOR = 'device_tracker.life360_papa' -%}
{%- for attr in states[SENSOR].attributes -%}
{{
{
'type': 'attribute',
'entity': SENSOR,
'attribute': attr,
'name': attr
}
}},
{%- endfor %}
Produces this for sun.sun
:
As I can guess, “friendly names” for attributes are presented in UI automatically:
- “_” replaced by spaces;
- the 1st letter is capitalized.
This may be achieved by:
'name': attr|capitalize|replace("_"," ")
15 Likes
I got this error:
Configuration errors detected:
- Custom element not found: auto-entites
This is a custom card, it must be installed first
1 Like
Would help a lot if you explained how to add this custom card
It is custom card “auto-entities” you can install it via HACS.
{%- for attr in states[SENSOR].attributes|select('search','.......') -%}
or reject(…)
1 Like
Marvelous! |select('search','........')
did the trick.
{%- for attr in states[SENSOR].attributes|select('search','sensor.') -%}
Thank you!
BTW, title
works better than capitalize
for matching HA default friendly names.
'name': attr|replace('sensor.','')|replace('_',' ')|title
2 Likes