🔹 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:

7 Likes

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.

1 Like

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.

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

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: