🔹 Auto-entities - Automatically fill cards with entities

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!

Auto-entities can be used with any card that uses entities: (as opposed to entity:).

However - layout-card can take an entities: option and turn that into once card per item… (see bottom of the readme).

1 Like

Yes your documentation was quite clear on the entities stuff (that is why I asked). I hadn’t looked into layout-card yet and I certainly didn’t know about this feature. Thanks again, I will take a look into this. It might be what I was looking for. A friend of mine is actually making something of this sort I believe. You might have heard of him (@dwains). But this will help me out for the time being.

Anyways thanks again for your awesome work/help.

This quite recent feature in monster-card comes from a contribution/PR i’ve made. Nice to see you’ve implemented it back in Auto-entites, thanks !
I’ll look your documentation deeper to switch from all my monster-cards to your new one.

1 Like

Thx for this plugin!
I noticed that in case of using Edge as browser the card doesnt load and gives an error : Custom element doesn’t exist: auto-entities.

In Chrome everything works fine.
Is this a known issue?

yes, Edge is a known issue itself :smiley:

2 Likes