🔹 Auto-entities - Automatically fill cards with entities

i have inserted your suggestion and it did not update. still the same
image

type: custom:auto-entities
show_empty: false
card:
  type: glance
  title: Lights On Right Now
filter:
  include:
    - integration: WLED
      options:
        tap_action:
          action: more-info
        hold_action:
          action: toggle
    - domain: light
      state: 'on'
      options:
        tap_action:
          action: more-info
        hold_action:
          action: toggle
    - domain: switch
      state: 'on'
      options:
        tap_action:
          action: more-info
        hold_action:
          action: toggle
  exclude:
    - entity_id: '*tp_link*'
    - entity_id: '*washing*'
    - entity_id: '*deco*'
    - entity_id: '*led*'
    - entity_id: '*panel_sound*'
    - entity_id: '*google*'
    - entity_id: '*tv*'
    - entity_id: '*doorbell*'
    - entity_id: '*bluetooth*'
    - entity_id: '*remote*'
    - entity_id: '*report*'
    - entity_id: '*motion*'
    - entity_id: '*microphone*'
    - entity_id: '*garage_speaker*'
    - entity_id: '*firestick*'
    - entity_id: '*cloud*'
    - entity_id: '*program*'
    - entity_id: '*display*'
    - entity_id: '*schedule*'
    - entity_id: '*Chandler*'
visibility:
  - condition: user
    users:
      - cd026962296f457589569fc1e5d6706d
      - 206a02d709c74c11b47b2a5ba9f5372f

Make you card simpler.
First , test the integration filter and use lower characters

thank you that worked. but it gave more info than i bargained for lol. I just wanted the lights only.

Great, so now add domain: light under the same dash (so don’t add a new dash)

So I’m really struggling to find a way to remove the toggle button for entities populated using auto-entities. I’ve tried using card-mod but getting nowhere fast. I just need some simple pointers please.
I’ve tried lots of permetations of the following which I want to list out all of my lights which have been switched off at the mains, but I don’t want to see the toggle as I want the card to be as small and simple as possible.

type: custom:auto-entities
show_empty: false
card:
  type: entities
  title: Unavailable entities
  show_header_toggle: false
  card_mod:
    style: |
      ha-switch {
        display: none;
        }
filter:
  include:
    - domain: light
      state: unavailable
```

General schema:
card-mod thread → 1st post → link at the bottom → auto-entities
Particular styles - ask in that thread.

which link at the bottom , there are loads
if you mean - 🔹 Card-mod - Add css styles to any lovelace card - #1396 by Ildar_Gabdullin
and then click on the auto-entities
list of posts with styles then it just comes back to this thread. so i’m confused

it comes to a particular post in this thread

Hi all, looking for some help in filtering after I couldn’t find anything online.

what I have:
I currently have an auto-entities card set-up to give me all lights except light groups.

what I’m trying to achieve:
However, l would like to display single lights differently than lights that are part of a group.
Single lights I just want to display as is, but for grouped lights I want to display the actual group and then have the option to expand the members of the group using collapsable cards.

my issue:
I just cannot figure out how to set up the filters for this.
What I would need:

  1. include all entities that are:
  • domain: light
  1. exclude all entities that are:
  • a group (checking the entity_id attribute)
  • part of a group → how??

any idea how this can be achieved? Unfortunately I don’t even have an approach to show for this, as I can’t figure out where to start (there’s no attribute for this as far as I know).

edit: fixed a mistake in my exclude; I need to include entites that are part of a group, not the ones that are not part of a group

1 Like

add a label to those groups (light group or whatever) and exclude/include those label entities or the reverse, just as you would need it.

then, use 2 different auto-entities configs for both of your requirements inside a container card

not sure though if we can use auto-entities to only show the groups, and make those folded/collapsible, you might need to use a n option setting with fold-entity-row for that for each row (filtered group) and set the fold option GitHub - thomasloven/lovelace-fold-entity-row: 🔹 A foldable row for entities card, containing other rows

Thanks for the input!
I just fixed a small mistake in my initial post, not sure if this affects your feedback.

I am trying to exclude all entities that are part of a group. But I think your reply already considered this.

If I give the labels to the group, do these populate down to the child-entities so that these can be excluded as well? That’s not how I would have expected it to work.

Regarding the implementation of the card: I am assuming that this can be handled via the options settings (haven’t tested id yet), but I have created a decluttering card with the template so I am assuming this to work without issues as soon as I can figure out to even set the filter for this :smile:

no, there labels are per entity, and dont trickle down

correct
also, depending on what you want auto-entities to populate, you might need to use the card_param option, if it doesnt default to the entities:

dost assume that, decluttering can be finicky and behave unexpectedly

I’d first make it work in a direct config, and if you have that, create a decluttering based on that

no, there labels are per entity, and dont trickle down

But that would mean I’d have to give labels to each entity that is part of a group - and if ever a new entity becomes part of a group, I have to remember to put the label on this as well.

Of course, it would work - but doesn’t seem all that seamless considering all the amazing filtering options available for the auto-entities card.

But of course, if there’s no identifier, then obviously these entities can’t be identified; I just hoped there was any way to do this that I didn’t think of… :confused:

no? you could include/exclude based on those labelled groups

can you tell me how to do that? my approach would have been to do it like this:

  include:
    - domain: light
  exclude:
    - attributes:
        entity_id: $$*
    - label: part of group

Then I’d have all entities that are not groups and are not part of groups. But in this case I’d have to give the label to all entities that are part of a group.

Any suggestions/improvements welcome :slight_smile:

You can use the group feature of auto-entities?

type: custom:auto-entities
show_empty: false
card:
  type: entities
filter:
  include:
    - domain: light
      integration: group

will give you all lights that are groups
(might have to check the Hue groups, but, for those you can add the other filter on the attribute)

ofc, also exclude with these

other syntax:

type: custom:auto-entities
show_empty: false
card:
  type: entities
filter:
  include:
    - domain: light
      not:
        integration: group

no need for a label at all…sorry for misleading you there

oh :astonished:

will set this up and report back!

Tested this but I don’t think this is entirely what I’m looking for.

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - domain: light
  exclude:
    - label: exclude
    - integration: group

As far as I can tell, integration: group replaces the following, right?

attributes:
        entity_id: $*

But what I am still missing is a way to exclude the entities that are members of groups. these still show up in the list of entities.

Let’s take the following example:

I have 5 light entities: light.entity1 through light.entity5

I also have 2 light groups:
light.group1:

  • light.entity1
  • light.entity2

light.group2

  • light.entity3
  • light.entity4

light.entity5 is in no group.

I am looking for a filter setting that ends up giving me just light.entity5

  • light.group1 and light.group2 get eliminated by integration: group (thanks for the hint!)
  • but how to eliminate light.entity1, light.entity2, light.entity3, and light.entity4?

reason for this: as I am displaying my grouped lights separately with the mentioned collapsable card:
image

I don’t want the lights to show up twice. without this filter I have them once as an individual card (see top) and once within the collapsable grouped card (see bottom).

Any idea how this could be achieved? :slight_smile:

Another issue I have noticed:
both cards are set-up with the auto-entities card. The top single card is just a basic auto-entities card. The bottom one is a nested auto-entities card using decluttering-cards. I am getting a list of all light groups and am creating the following card for this:

type: custom:auto-entities
filter:
  include:
    - domain: light
      integration: group
      options:
        type: custom:decluttering-card
        template: illumination_light-group
        variables:
          - Light Group: this.entity_id
          - Title Expand: Mein Test
  exclude:
    - label: exclude
    - area: system
show_empty: false

The Light Group: this.entity_id is then being used within the decluttering card again to get all the children of the group using:

include:
  - group: '[[Light Group]]'
    options:
      type: custom:mushroom-light-card
      use_light_color: true
      show_brightness_control: true
      collapsible_controls: false
exclude:
  - area: System
  - label: exclude

As you can see in the screenshot, this basically works fine. BUT: it takes a loooot of time to load the children elements into the collapsable card. However, as soon as I turn on one of these lights, the children elements are loaded immediately, no delay at all.

any idea what’s going on here and how to improve it?

Before anything else:

Test if taking out the label: filter improves speed

I can’t use it , as it completely grinds the view.

I have an open issue on that in the repo

@Mariusthvdb
What I have done is basically remove one layer of auto-entites by just setting it up manually for the two groups:

      type: horizontal-stack
      cards:
        - type: custom:decluttering-card
          template: illumination_light-group
          variables:
            - Light Group: light.group_dummy_light_group
        - type: custom:decluttering-card
          template: illumination_light-group
          variables:
            - Light Group: light.dummy_light_group_2

so basically auto-entities now doesn’t create cards for the groups, but only within the groups.

this loads immediately on page load. it is only when I create these cards using auto-entities (-> nested auto-entities: auto-entities creates cards for groups and then cards within each group), that the delay is introduced