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

as always, first make it a bare simple card, without any of the stylings, so you are sure auto-entities does what you want.

then rebuild those stylings.

also,

card_param: entity

is default, so can be left out? and other options that can be taken out, like show_empty etc

you have so much empty yaml there,

            data:
              entity_id: []
            target: {}

please get rid of that before being able to analyse the card

thanks for the pointers, very much appreciated!

I went back to this basic setup for the options, which works perfectly:

options:

type: custom:mushroom-cover-card
fill_container: false
show_position_control: true
show_buttons_control: true
show_tilt_position_control: false

After I added the grid and the mushroom-chips-cards back in with the following code (I think the layout-grid or similar is needed in order to use multiple cards in the options, right?), then things start to break again:

options:

type: custom:layout-card
layout_type: custom:grid-layout
cards:
  - type: custom:mushroom-cover-card
    fill_container: false
    show_position_control: true
    show_buttons_control: true
    show_tilt_position_control: false
  - type: custom:mushroom-chips-card
    chips:
      - type: entity
        entity: script.cover_tilt_up
        icon: mdi:window-shutter-open
        content_info: name
        tap_action:
          action: call-service
          service: script.cover_tilt_up

the cover card disappears completely and only the chips-card is shown:
image

if I understand you correctly, the auto-entities card is not yet involved, and already this breaks?

if yes, then that needs tomb fixed, before even thinking of adding this for all of your cover entities in an auto-entities card.

and about that: are those scripts all functional for all of the cover entities (which are injected by auto-entities into the card config)?

it works fine without the auto-entities card. Thatā€™s this code right here:

card without auto-entities

type: custom:stack-in-card
cards:

  • type: custom:mushroom-cover-card
    entity: myentity
    fill_container: false
    name: Jalousien
    show_position_control: true
    show_buttons_control: true
    show_tilt_position_control: false
  • type: custom:mushroom-chips-card
    chips:
    • type: entity
      entity: script.cover_tilt_up
      icon: mdi:window-shutter-open
      content_info: name
      tap_action:
      action: call-service
      service: script.cover_tilt_up
      data:
      entity_id: myentity
      target: {}
    • type: entity
      entity: script.cover_tilt_down
      icon: mdi:window-shutter-open
      content_info: name
      tap_action:
      action: call-service
      service: script.cover_tilt_down
      data:
      entity_id: myentity
      target: {}
      alignment: center
      card_mod:
      style: |
      ha-card {
      margin: 5px 0 10px 0;
      }
      ha-card .chip-container :not(:last-child) {
      margin-right: 20px;
      }

If I then put just the mushroom-cover-card into auto entities it works fine, but as soon as I add the mushroom-chips cards it breaks.

the scripts are using a variable for the entity. in the manual card I am passing the entity (myentity in the code above). I am hoping that as the auto-entities card filters the relevant entitites, that this can be filled out as well. emphasis on hoping

Check Add confirmations to some interactive entity-rows by karwosts Ā· Pull Request #21453 Ā· home-assistant/frontend Ā· GitHub

Great work @karwosts thank you very much !

2 Likes

Great stuff.

I am running into an issue using an exclude in a filter list for an attribute

type: custom:auto-entities
card:
  square: false
  type: grid
  columns: 1
card_param: cards
filter:
  include:
    - domain: binary_sensor
      entity_id: '*_rf_*'
      attributes:
        tamper: 1
      options:
        type: tile
        icon: mdi:antenna
    - domain: binary_sensor
      entity_id: '*_rf_*'
      attributes:
        lowbatt: 1
      options:
        type: tile
        icon: mdi:antenna
  exclude:
    - domain: binary_sensor
      entity_id: '*_rf_*'
      attributes:
        Loopnr: 0
sort:
  method: friendly_name
  reverse: false

The exclude is completely ignored, any idea what i am doing wrong?

Silly me, figured it out, the attribute name is all lower case.

Loopnr: 0 ā†’ loopnr: 0

Hi Ildar. I hope you can still remember this post from Nov. 2023:

It was about completely hiding/deleting the RUN/CANCEL actions. Not only with " " to adapt the action_name.
ab1b9bf0ea31fcbf30562b774d2cf297504a5d41

I would be very interested in your solution with card_mod. Would you share it with us?
Iā€™ve tried countless code snippets from your card_mod thread, but apparently there is something different inside auto-entities than in the normal entities card.
Thank you in advance.

Post the code that you have that gets you your screenshot.

Thank you for your response. Itā€˜s not my Screenshot, it is from this post:

But i have the same question:

Here is my code:

type: custom:auto-entities
card:
  type: entities
  show_header_toggle: false
filter:
  include:
    - entity_id: scene.*
      state: 'on'
      options:
        action_name: 'on'
        secondary_info: last-changed
sort:
  method: friendly_name
  reverse: false
show_empty: false

With the parameter action_name i manipulate the action button. But i would like to hide the complete action(button).

that wont help you anyways as scenes are no longer ā€˜onā€™ but they have a timestamp as state

you can see that if you add type: simple-entity which takes away the button and shows the state of the scene

1 Like

Please do not concentrate on the filter. I know the on/off problem with scenes. The code is no longer up to date, I have adjusted the include in the meantime. The entities are listed, thatā€™s not my problem.

I also tried simple-entity, but especially in scenes the state is so long (date, time, etc.). Or do you know a way to not display the state with card_mod?

Hi!

After the update to 2024.7, the custom:auto-entity card, when there are no elements and it should be hidden, leaves an empty space, here is an example of 3 cards (empty) in a vertical stack, is there any way to fix this?

image

here you go:
image

type: custom:auto-entities
card:
  type: entities
  show_header_toggle: false
  card_mod:
    style:
      hui-scene-entity-row$: |
        mwc-button {
          display: none;
        }
filter:
  include:
    - entity_id: scene.*
      options:
        action_name: 'on'
        secondary_info: last-changed
sort:
  method: friendly_name
  reverse: false
show_empty: false
2 Likes

Yeah! Thatā€™s it! Thank you so much. Finally. Youā€™re the best.

1 Like

You could have found that yourself if you followed the guidelines and examples in the main post in card-mod thread

Weā€™re here to help, but that is not always the same as providing final solutionsā€¦ā€¦

And maybe you should use another card all together as this does look a bit silly now. Why would you list scenes if not to enact them?

Any chance you post a minimal card config so we can see what you do?

Oh believe me, I tried. As you can see from my first question in the card-mod thread, which was over 2 months ago. Iā€™m someone who is just searching and trying to help myself. But I just couldnā€™t find it. And exactly the hint with


hui-scene-entity-row$: |

i couldnā€™t find it there. And I am very grateful to Dimitri for helping me. I donā€™t understand whatā€™s bothering you now? What did I do wrong?

For me, the result on my dashboard doesnā€™t look silly. The names of my scenes are much longer than in Dimitriā€™s example, the action buttons etc. even have these names cut off. Now it looks good. BTW: I use this card to see which scenes are currently active.

But again, so that I can do better: what did I do wrong with my question that bothered you so much?

please dont get me wrong, I am not bothered the slightest, and you did nothing wrong.

I believe you could have given it a bit more effort trying to find that correct path in the dom, in stead of simply trying

because that illustrates you didnt start at the root of the challenge: try to find the correct dom path (which I am aware can be frustrating sometimes, I had that same experience the other day on a silly button myself)

Dimitri has solved your problem now, but will you be able to do it yourself next time?

Also, more importantly, I just dont think you will get what you want:

youā€™ll get a list of names, and secondary info of the timestamp. Not a list of currently active scenes.

So, in al honesty, I hope you come back here, and with aid of this fine community get a better approach to reach your goal