Could you add a way to template the name? It’s very very often that when I have a group of entities that requires using this custom card, that they all share something in the name that I want to take out.
Just wanted to share this little thing i came up with:
Auto entities lists all my areas and creates a area-card with temp, humidity and lux… still working on how to get a different icon for each area, dont wanna rename my rooms, but could be a possibility…
type: custom:auto-entities
filter:
template: |
[ {% for omrade in areas()|sort %}
{{
{
'type': 'custom:streamline-card',
'template': 'klimakort',
'variables': [
{'entry': omrade}
]
}
}}
,
{% endfor %} ]
include: []
exclude: []
card:
square: false
type: grid
columns: 2
show_empty: true
card_param: cards
sort: {}
and a decluttering card (streamline-card… because that has a gui-editor lol)
streamline_templates:
klimakort:
card:
type: custom:mushroom-template-card
primary: '{{area_name(''[[entry]]'') | title }}'
secondary: >-
{% set temp = (area_entities('[[entry]]') | select('is_state_attr',
'device_class', 'temperature') | map('states') | select('is_number') |
map('float') | list or [0]) | average | round(1) %}
{% set hum = (area_entities('[[entry]]') | select('is_state_attr',
'device_class', 'humidity') | map('states') | select('is_number') |
map('float') | list or [0]) | average %}
{% set lux = (area_entities('[[entry]]') | select('is_state_attr',
'device_class', 'illuminance') | map('states') | select('is_number') |
map('float') | list or [0]) | average | round(1) %}
{{ [ ('🌡️' ~ temp|int ~ '°C') if temp, ('💧' ~ hum | int ~ '%') if hum,
('🔆' ~ lux | int ~ 'lx') if lux] | select() | join(' ') }}
icon: hue:room-office
entity: '[[entry]]'
fill_container: true
tap_action:
action: navigate
navigation_path: '#popup-[[entry]]'
layout: vertical
Doesn’t the normal area card do exactly what the custom area template card you’re making does? Even shows the icons for each area
Yes it does but imo its fugly and dosent fit the rest of my design
I just activated all “last seen” attributes of the entities:
It should be possible to sort the entities regarding to their last seen status or not?
Can anybody help me to get the correct yaml working?
I am struggling with it
edit:
got it:
type: custom:auto-entities
card:
type: entities
filter:
include:
- entity_id: sensor.*_last_seen
sort:
method: last_changed
numeric: false
reverse: false