Home Assistant dashboard custom element: Auto-entities
Here you find Home Assistant (lovelace) dashboard examples related to the custom element auto-entities which you can easily use on your own dashboards.
Auto-entities is a very powerful addon card that can let you make dynamic entity lists based on multiple filters, include and exclude entities and different type of sorting.
The git repository with also all options and some examples can be found at https://github.com/thomasloven/lovelace-auto-entities
Table of Contents
- Temperatures (rounded, sorted and colored)
- Humidity (rounded, sorted and colored)
- Show lights ordered by state
- Show only the lights which are ‘on’ at the moment
- Latest activities (motions and doors)
- Missing devices
- Full moon (single condition)
- Only X days left (multiple conditions with AND)
- With attribute data
- Chores
Temperatures (rounded, sorted and colored)
Show all temperature sensors in order of their temperature from high to low. And show the rounded temperature to a real number and for temperature higher than ideal give them an orange or red color. Blue icons when the temperature is below 10 degrees.
# Sourcecode by vdbrink.github.io
# Dashboard card code
type: custom:auto-entities
card:
type: entities
show_header_toggle: false
state_color: false
title: Temperaturen aflopend
filter:
include:
- entity_id: sensor.temp*.temperature
options:
type: custom:template-entity-row
state: |
{{ states(config.entity)|round(0)}} °C
style: |
:host {
--paper-item-icon-color:
{% set level = states(config.entity)|round(0) %}
{% if level >= 26 %} firebrick
{% elif level >= 25 %} orange
{% elif level < 10 %} blue
{% else %} var(--primary-text-color)
{% endif %}
;
}
show_empty: false
sort:
method: state
reverse: true
numeric: true
Humidity (rounded, sorted and colored)
Show all humidity sensors in order of their humidity from high to low
and only when the value is higher or equal than 65%.
Hide sensor temp12
and with value unavailable
.
Show the rounded humidity to a real number and for humidity higher than 70% red,
higher 60% orange, higher than 55% white.
# Sourcecode by vdbrink.github.io
# Dashboard card code
type: custom:auto-entities
card:
type: entities
show_header_toggle: false
state_color: false
filter:
include:
- entity_id: sensor.temp*_humidity_rounded
options:
type: custom:template-entity-row
state: |
{{ states(config.entity)|round(0)}} %
style: |
:host {
--paper-item-icon-color:
{% set level = states(config.entity)|round(0) %}
{% if level >= 70 %} firebrick
{% elif level >= 60 %} orange
{% elif level >= 55 %} white
{% else %} var(--primary-text-color)
{% endif %}
;
}
exclude:
- entity_id: sensor.temp12_humidity
- state: unavailable
- state: <= 65
show_empty: false
sort:
method: state
reverse: true
numeric: true
Show lights ordered by state
Show the lights which are currently on
always on top.
Hide also the unavailable ones.
# Sourcecode by vdbrink.github.io
# Dashboard card code
type: custom:auto-entities
card:
type: entities
show_header_toggle: false
state_color: false
filter:
include:
- entity_id: light.*
exclude:
- state: "unavailable"
sort:
method: state
reverse: true
Show only the lights which are ‘on’ at the moment
# Sourcecode by vdbrink.github.io
# Dashboard card code
type: custom:auto-entities
show_empty: false
card:
type: entities
filter:
include:
- domain: light
state: "on"
options:
tap_action:
action: toggle
Latest activities (motions and doors)
Show the latest 10 active motion-, presence- and contact door sensors which are changed in the last 30 minutes.
# Sourcecode by vdbrink.github.io
# Dashboard card code
type: custom:auto-entities
card:
type: entities
state_color: true
title: Latest activities
filter:
include:
# active motion sensors
- domain: binary_sensor
state: 'on'
attributes:
device_class: motion
options:
secondary_info: last-changed
# active presence sensors
- domain: binary_sensor
state: 'on'
attributes:
device_class: presence
options:
secondary_info: last-changed
# contact/door sensors
- domain: binary_sensor
entity_id: '*_contact'
options:
secondary_info: last-changed
exclude:
- last_changed: '> 30m ago'
sort:
method: last_changed
count: 10
reverse: true
Missing devices
Show devices which didn’t change their value for more than 1440 minutes (1 day).
# Sourcecode by vdbrink.github.io
# Dashboard card code
type: custom:auto-entities
card:
type: entities
state_color: true
title: Missing devices
filter:
include:
- entity_id: /sensor.*_temperature/
options:
secondary_info: last-changed
last_changed: '> 1440'
- domain: binary_sensor
attributes:
device_class: motion
options:
secondary_info: last-changed
last_changed: '> 1440'
- entity_id: /sensor.*_contact/
options:
secondary_info: last-changed
last_changed: '> 1440'
sort:
method: last_changed
count: 15
reverse: false
Full moon (single condition)
Show this only when the entity sensor.moon
has the status full_moon
.
# Sourcecode by vdbrink.github.io
# Dashboard card code
type: custom:auto-entities
card:
type: entities
filter:
include:
- entity_id: sensor.moon
state: full_moon
show_empty: false
Only X days left (multiple conditions with AND)
For the paper pickup day, I only want this visible when there are only three days left.
Show only when the number of days is less than 4 AND more than -1.
See here how to create a day countdown based on a date.
# Sourcecode by vdbrink.github.io
# Dashboard card code
type: custom:auto-entities
card:
type: entities
filter:
include:
- entity_id: sensor.paper_waste_pickup_countdown
state 1: "< 4"
state 2: "> -1"
With attribute data
Show all room presence entities and as secondary_info
an attribute value, in this case the distance
attribute.
type: custom:auto-entities
card:
type: entities
state_color: true
title: Tracker
filter:
include:
- domain: sensor
entity_id: '*.room_presence'
options:
type: custom:multiple-entity-row
secondary_info:
attribute: distance
exclude:
- state: unknown
- state: unavailable
sort:
method: last-changed
reverse: true
Chores
I created a separated page about this subject where I use multiple auto entities lists to show which chores must be done and which are already done.
<< See also my other Home Assistant pages
Top | Homepage | Best Buy Tips