šŸ”¹ Auto-entities - Automatically fill cards with entities

Try combining it with a conditional card, so itā€™s hidden when it should be blank

I am struggeling set up a condition for entities which fit a certain string, have a state >85 and not the unit %. I tried the following, but the result is empty. Maybe one of you would be so kind to help me.

        - entity_id: sensor.*_memory_use*
          state: '>85'
          attributes: 
            unit_of_measurement: "%"

Edit: It is working if I omit the attributes part.

try state: ā€œ> 85ā€

And Use The DOCS as ā€œreferenceā€ when adding a Card
GitHub - thomasloven/lovelace-auto-entities: šŸ”¹Automatically populate the entities-list of lovelace cards.

Thank you for your answer. I should have mentioned, that it is working, if I omit the attributes part.

Ok, check your sensors in /Developer Tools / States, whether they actually have an Attributes " ```
unit_of_measurement:

They do, I copied it from there. But, I found a workaround. Thank you non the less.

1 Like

HELP: is there a simple way to style the card to show larger images? Iā€™m using it to show the latest movement snapshots taken from my camera, but they appear as small circles:
image
Iā€™d like to see them as It would be great to see them large enough to understand whatā€™s going on.

you probably best use another card then, and not shown them as entities.
use them eg as background for a custom:button-card

or use the core picture card

Has anyone managed to get show_empty: false working with the new sections please?

I have this set and empty auto-entity cards result in empty space still.

Are you sure the auto-entities actually ends up empty? Or, does it end up with a card type that is empty?

If the latter, then auto-entities will see a card and show it.

You can post your code and we can help from there.

1 Like

Thanks for your reply jeffcrum, this is what I haveā€¦

type: custom:auto-entities
card:
  show_header_toggle: false
  title: Battery warning
  type: entities
  state_color: true
filter:
  include:
    - attributes:
        device_class: battery
      state: <=10
  exclude:
    - entity_id: binary_sensor.keypad_battery_low
    - entity_id: sensor.iphone_97_battery_level
    - entity_id: sensor.ed_mobile_battery_level
    - entity_id: sensor.eds_pixel_watch_2_battery_level
sort:
  method: state
  numeric: true
show_empty: false

Hi,

I am trying to use this card but for some reason it ends up in an infinite loop.
Here is one example I am trying to setup:

type: custom:auto-entities
show_empty: false
card:
  type: glance
  title: Lights on
filter:
  include:
    - domain: light
      options:
        tap_action:
          action: toggle
sort:
  method: state

And in the preview I see an infinite loop with this card and its slowing down the whole web browser:

Any ideas why this is happening?

if youā€™re looking t find the lights that are ā€˜onā€™ you need to add that too:

type: custom:auto-entities
show_empty: false
card:
  type: glance
  title: Lights on
filter:
  include:
    - domain: light
      state: 'on'
      options:
        tap_action:
          action: toggle
sort:
  method: state

be aware that this config also shows the light groups etc that all belong to the light domain, so if you want to exclude those, add an exclude filter on the relevant attribute .

other than that, I didnt see the looping so cant help you there

1 Like

I copied and pasted your code into a test card. Then added another exclude line to make it empty.

It works just fine. As it is, no card shows. If I change show_empty to true, it shows an empty card.

Sorry, I am not sure I explained the issue well. The show_empty setting does correctly toggle if a card is shown. The issue is that when set to false there is a space where the card would have been, affecting the position of other cardsā€¦

Screenshot 2024-05-06 144649

Screenshot 2024-05-06 144656

Can I get the general waste card right beneath the section title?

You might actually be onto something here. If @eplusg has strangely configured groups (e.g. group a contains group b and b contains a), then I can see an infinite recursion happen.

1 Like

No. I get it. So, I setup a card with data, followed by your code I used above, and another card with data.

When the middle card gets no records from auto-entities, the third card is immediately below the first card with no gap.

This was directly on a new test dashboard.

Iā€™m trying to populate a Buttons row for an Entities card by expanding a group of entities using a decluttering template:

light_area_template:
  card:
    type: entities
    title: "[[title]]"
    entities:
      - type: custom:auto-entities
        card:
          type: buttons
        filter:
          include:
            - group: "[[group]]"
              options:
                show_name: true
        sort:
          method: name
          ignore_case: true
        exclude:
          - state: "unavailable"

Iā€™m then calling it like so:

- type: custom:decluttering-card
  template: light_area_template
  variables:
    - title: "Living"
    - group: group.light_area_living

This is however not working, and it returns an error: Unknown type encountered: buttons
image

This would be the code that works for this particular group:

  - type: entities
    entities:
      - type: buttons
        entities:
          - entity: "light.zigbee_light_lamp_living_front"
            show_name: true

          - entity: "light.zigbee_light_lamp_living_back"
            show_name: true

          - entity: "light.zigbee_light_lamp_billy"
            show_name: true

          - entity: "light.light_living_corner"
            show_name: true

          - entity: "light.light_living_center"
            show_name: true

          - entity: "light.light_living"
            show_name: true

And produces this result:
image

Any idea how I could make this work using auto-entities?

Try with

options:
 show_name: true
 type: button

PS: However those ā€œButtonsā€ you are showing in PIC looks like Mushroom-chips !

Thatā€™s so strange. The pictures I shared above with the gap are a new test card with my code as also shared above. I wonder why weā€™re experiencing different behaviour.