🔹 Auto-entities - Automatically fill cards with entities

Finally released in HACS.

This lovelace plugin lets you automatically put entities into lovelace cards.
You can e.g. make an entities card which shows all your remotes which have a low battery.
Or a glance card which shows all lights that are currently on.
There’s lots of matching options. Like selecting all media players where the currently playing song matches a regular expression.
And you can also finally sort the entities!

Here’s just some examples from my development setup:

53 Likes
Using binary_sensor template as a glance and listing entities
Card with Entities filtered by Integration
Clean Tile-Based Lovelace UI - only 2 cards needed!
Use template in entity list in an automation?
List & count entities / devices connected to specific AP
When using auto-entities, show attribute rather than state
Light Entity Card
System Monitoring - How does yours look?
Notification on Low Battery Levels
Counts the lights on
Auto-entities with else card within vertical stack
Show Entities without values
Dashboard Auto Entity Card Code
Battery-state-card truncating entity value
Auto-enties card filter on nested attribute
Using Auto Entities to create a bunch of Mushroom Chips
Assign current date and time to my input_datetime
Dashboard With All at "home" devices
Mushroom Cards - Build a beautiful dashboard easily 🍄 (Part 2)
Meshcore Contact Management (combining a template plus hold-action)
Auto-Entities card, removing entities that are also part of a group
List of devices currently switched on
Separating switches from sensors using auto discovery
Two window sensors one output | Zwei Fenstersensoren eine Ausgabe
Using labels for conditional cards
Auto alerts page based on sensor values specified in entity
Allow URL query strings to /developer-tools/state to preset filters
Dashboard Entity Card - Filter Include Not
Feature Request: Use Labels to build Dashboards
Solcast hourly forecast zero/null values
REST - Nutrislice JSON Values
Powercalc - Virtual power sensors
First attempt with a custom card returns "Required key 'entities.0.entity' is missing"
Variables in template for lovelace cards
Conditional, sorted entity-filter card?
Auto Entities card?: How to display another card when no results are found in the initial filters
How to place an update available icon on the dashboard?
Auto-Entities + Card-Mod: Hide entity state
Newbie - trying to create condition for a gauge card
Customizing a Lovelace Card
Show current state on device/entity lists
Populating entity filter card from a binary sensor group
New Lovelace card – Flex Cells Card
Auto-entities: all zwave lights & switches [filter help]
Help creating dynamic code for (new) sensors
How to template a set of custom buttons
Lovelace Card for showing media players dynamicaly
Does custome cards (like auto-entities) can combine a template with a hold_action?
Is it not possible to use a template in the title for the map card?

Hey Thomas,

I am currently moving all my monster-cards to your new auto-entities-card and there is one thing thats a bit annoying and has to do with another card of you - the browser-mod-integration:

I my lovelace config I have an auto-entities-card that displays all lights across the house that are currently switched on. I have the header_toggles enabled which makes it pretty easy to turn off all lights in the house with a single click. With the browser-mod-integration each device currently using hass also is visible as a light:

autoentities
The problem is when I click the header toggle my screen on my computer and smartphones goes black. I don’t store cookies on my computers so everytime I reboot I get a new ID.
Is there a way to generally ignore all devices (lights) from browser-mod in a auto-entities-card? Maybe something like a regular expression?

Keep up the great work!

All browser_mod entities have the attribute: type: browser_mod. You can exclude that.

4 Likes

Perfect! Thank you. But I still can’t get it to work. Can you help me out or maybe add this case to your README.md?

I’ve tried the following but it’s not working:

type: 'custom:auto-entities'
show_empty: false
card:
  title: Eingeschaltete Lampen
  type: entities
entities: null
filter:
  exclude:
    - domain: light
      state: 'on'
      type: 'browser_mod'
  include:
    - domain: light
      state: 'on'
sort:
  method: name

Try checking some of the examples of filtering on other attributes.
https://github.com/thomasloven/lovelace-auto-entities#examples

And you don’t need to match everything in the exclude filter.
Just

exclude:
- attributes:
   type: browser_mod

is enough.

1 Like

Finally it’s working. Thank you very much.

Hello,

maybe someone can point me into the right direction, i’m a bit stucked here:

I have following entities and attributes:

Entity #1 : camera.aarlo*
Attribute: battery_level

Entity #2: plant.*
Attribute: battery

Each attribute is following a numeric value (measured in %).

I’d like to show these using auto-entities if one of these devices is less than 20% battery.

Tried the following code (starting for entity #1 only) but Lovelace tells me “Cannot convert undefined or null to object”.

### Battery Alarms
         - type: 'custom:auto-entities'
           show_empty: false
           card:
             title: Schwache Batterien
             type: entities
           #entities: null
           filter:
             include:
               - domain: camera
                 - entity_id: "battery_level"
               - attributes:
                 battery_level: "<= 20"

Thanks a lot in advance!
/ Ralf

After correcting indentation, this would show

  • All your cameras
  • The impossible entity with entity id battery_level (not sensor.battery_level or anything), so nothing
    AND
  • All entities with an attribute battery_level that is less than or equal to 20.

which is probably not quite what you want.

The error you’re describing, though, comes from somewhere else. It only happens if you have attributes: followed by nothing.

Thanks for the fast reply, but I’m still stucked how the code should look like to get what i tried to do?

Thanks
/Ralf

EDIT: found answer in this post: Lovelace Battery Entity Card
Post #17

But thanks for the help!

/ Ralf

Why sorting with

  sort:
    method: state

gives that

EDIT: work in version 1.6+

1 Like

And even

    filter:
      include:
        - entity_id: '*battery*'
    sort:
      method: state
      numeric: true

gives unsorted results:
Anmerkung 2019-12-07 133346
Would be nice to give us a hint how to fix this.

THX!

That’s not included in the 1.5 release.
Install the master version to get it.

1 Like

Wow, great! Version 1.6 is working like a charm.
image
You´r awesome! :smiley:
Thank you!! :+1:

Is there a way to display the attribute value instead of state of some entities? I want to show the battery value of vacuum and device_tracker but it just shows docked and home.

card:
  show_header_toggle: false
  title: Battery Status
  type: entities
filter:
  include:
    - domain: device_tracker
      attributes:
        battery: <= 100
    - domain: vacuum
      attributes:
        battery_level: <= 100
    - entity_id: sensor.*battery*
      state: <=100
sort:
  method: state
type: 'custom:auto-entities'
2 Likes

That’s what template sensors are for.

1 Like

As always, @thomasloven, top quality support!
Thank You!

Some updates:

Auto-entities now supports

  • Displaying entities based on last_change or last_updated
  • Sorting entities by name, entity id, state, attributes, last change etc…
  • Display up to a maximum number of entities (e.g. display the first 10 matches)
  • Skipping a number of entities (e.g. display match 10-20)
  • Replacing this.entity_id with the current entity id in options (e.g. for setting tap_action to call a service on the matched entity)
4 Likes

This card is truly amazing (like most of your addons/plugins). I have a rather crazy question though. Seeing that auto entities can find entities and fill them according to an area, I was actually wondering if this would be possible with other cards than entities or glance.

E.g. I would like to generate a vertical/horizontal stack with 3 buttons on each row and have them filled automatically like auto-entities does except then with entity button or button-card.

So it would fill button-cards with entities inside a specific area. I might be asking something really exotic and/or something that is impossible. But seeing these two specific addons (auto-entities and lovelace_gen) I would think that this might be possible one way or another.

Still this card is amazing and I use it more often than I did before, but auto filling other cards than entities or glance would be really amazing.

Thanks for all your great work @thomasloven you make the HA experience a lot better for all of us!