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

its a bug, not a cache issue

Since a few days ago when I installed the updated Auto-Entities integration and latest HA version…

  • I have rebooted the PC several times
  • cleared cache several times
  • just now, I deleted all cookies and cleared the cache. (Chrome)
  • I opened Msft Edge, which I never use… and have never ever opened HA on it… again, never, not even once. And the same problem happens on Edge

Working fine for mešŸ¤·ā€ā™‚ļø

sometimes, that how bugs are :wink:

card displays properly in Dash, but the YAML shows as…

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - options:
        secondary_info: last-changed
      area: ""
      label: Light
  exclude:
    - name: "*Entry DS*"

after I update/fix by adding the Area back in using the UI…

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - options:
        secondary_info: last-changed
      area: living_room
      label: Light
  exclude:
    - name: "*Entry DS*"

Not really, bugs are typically consistent for all users. Rare cases, inconsistent. Anyways, are you 100% sure you are up to date with auto-entities? It had an update in the last day.

FYI: exact same configuration is working for me. So it’s something unique to your system and in all honesty it sounds like caching. Ctrl+F5 with dev tools F12 open and caching disabled.

otoh, now that you mention it, that label filter is really bad in my instance, while others seems to have no trouble.

I do have more than a few labels, but that apparently isnt it

using table in a template filter is just fine, so it is something in auto-entities, and not specific too the instance.

last Auto-entities update1.15.1 did make it somewhat better, but really not very usable yet

Weird I am seeing this too (also cleared cache to make sure).

This is the current code (copied from the raw configuration editor)

card:
  show_header_toggle: true
  title: Lampen
  type: entities
filter:
  include:
    - area: Woonkamer
      domain: light
  exclude:
    - attributes:
        is_hue_group: true
type: custom:auto-entities
sort:
  method: name

In the autoentities UI the area shows up empty.

When I select the ā€œWoonkamerā€ area it inserts the room id instead of the name (and adds an empty options attribute).

card:
  show_header_toggle: true
  title: Lampen
  type: entities
filter:
  include:
    - options: {}
      area: a8828da174494c97b53ac340dc58fe89
      domain: light
  exclude:
    - attributes:
        is_hue_group: true
type: custom:auto-entities
sort:
  method: name

Strangely enough when I switch to the code editor and paste in the original code and then switch back to the visual editor the Area field is filled correctly with ā€œWoonkamerā€ :person_shrugging:
Maybe better to report the issue on Github

Yes, I have the latest versions of everything. As you can see others have the same issue.

I love this card. The challenge seems to be since this is kind of a wrapper you get in a rabbit whole of where to put things like style changes.

I have a auto-entities that makes a dynamic card of todo-lists. Works perfectly.
What doesn’t work is the card-mod style change to swap the color for the font. It seems it gets down into the weeds with Shadow DOM.

type: custom:auto-entities
view_layout:
  grid-area: tasks
card:
  type: grid
  columns: 4
  square: false
card_param: cards
filter:
  template: |-
    [{%- for x in states.todo %}
      {{ { 
        'entity': x.entity_id,
        'type': 'todo-list',
        'title': (x.entity_id.split('.')[1] | replace('_local', '') | replace('_', ' ') | capitalize)
      } }},
      {%- endfor %}
    ]
card-mod:
  style: |
    custom:todo-list::part(header) {
      color: blue !important;  # Change title color to blue
      font-weight: bold !important;  # Bold the title
    }

Inspection shows me it should be the ::part(header) but that nor my other attempts made any change at all.

None of these worked either. I know this stuff is always a pain, but worth asking.

card-mod:
  style: |
    custom:todo-list::part(header) {
      color: blue !important;   # Change title color to blue inside shadow DOM
    }

card-mod:
  style: |
    custom:todo-list {
      --ha-card-header-color: blue !important;   # Override the header title color
      --primary-text-color: blue !important;     # Ensure text color is also blue
    }

card-mod:
  style: |
    custom:todo-list::part(header) {
      color: blue !important;   # Change title color to blue inside shadow DOM
    }


card-mod:
  style: |
    custom:todo-list::part(header) h1 {
      color: blue !important;  # Change the title color to blue
      font-weight: bold !important;  # Optional: Make the title bold for visibility
    }


card-mod:
  style: |
    custom:todo-list::part(header) h2 {
      color: blue !important;  # Change title color to blue
      font-weight: bold !important;  # Bold the title
    }

Any ideas?

You put the card mod style in the jinja filter.

Here

Well, get to figuring out what you 2 have in common.

yeah, mine was a simple Segment type view, no fancy code or custom mods. I just fixed them all. I have a few Auto-Entities cards that do have more fancy code in them so if I see the issue again I’ll let you know. thx!

Well, I swear I started there and got nothing, but thank for it works perfectly now. hats off you petro.

For solutions sake.

      - type: custom:auto-entities
        view_layout:
          grid-area: tasks
        card:
          type: grid
          columns: 4
          square: false
        card_param: cards
        filter:
          template: |-
            [{%- for x in states.todo %}
              {{ { 
                'entity': x.entity_id,
                'type': 'todo-list',
                'title': (x.entity_id.split('.')[1] | replace('_local', '') | replace('_', ' ') | capitalize),
                'card_mod': {'style': 'ha-card { --ha-card-header-color: #2196F3; }'}
              } }},
              {%- endfor %}
            ]

Thanks again.

Can I combine auto-entities, glance, and grid cards?

For example, merge these two?

type: custom:auto-entities
card:
  type: glance
  state_color: true
filter:
  include:
    - domain: binary_sensor
      area: family_room
      options:
        type: custom:mushroom-entity-card
    - domain: binary_sensor
      area: family_room
      options:
        type: custom:mushroom-entity-card
  exclude: []
card:
  square: false
  type: grid
  columns: 2

Or can I have two glance cards in the same card on different rows?

type: custom:auto-entities
card:
  type: glance
  state_color: true
filter:
  include:
    - domain: binary_sensor
      area: family_room
      options:
        type: custom:mushroom-entity-card
  exclude: []
type: custom:auto-entities
card:
  type: glance
  state_color: true
filter:
  include:
    - domain: sensor
      attributes:
        device_class: illuminance
      area: family_room
      options:
        type: custom:mushroom-entity-card
  exclude: []

adding to my findings above, I have to confess that even

      - type: custom:auto-entities
        card:
          type: entities
        filter:
          include:
            - integration: hue
              domain: event
          exclude:
            - state: unknown
        sort:
          method: state
          reverse: true

causes the drag. In all aspects: the view itself, opening the top right menu, reloading the page… ive deleted this one card, and the view flies.

minimizing that to

           include:
            - integration: hue 

is enough for the drag too appear

FYI, found / posted bug… [Bug] Excludes do not always work.. specific YAML examples included Ā· Issue #541 Ā· thomasloven/lovelace-auto-entities Ā· GitHub

Auto-entities pages can take a very, very long time to render when the Dashboard view itself has more than a few entities that load, even with simple filters and even for super simple (not ā€˜fancy’) displays like the below screenshot. On my super fast PC it renders in under a second, on my tablet is can often take 60+ seconds to render all the cards - they show slooowly, one – at — a ---- time. That screen below is not usable at all on the tablet.

I suspect the problem is HA’s web page is constantly loading all values, instead of doing lazy loading pages (only requesting status/value updates for displayed entities).
So the CPU gets overloaded processing status/values for all entities (I have over 2500 entities)… and it never stops.

maybe, but the various filters have very different response times.
Filtering on label is really not usable in my config, where domain or entity_id are super swift.

Yes, having a few auto-entities on a single view doesnt help. But, Ive tested this in all single card views to isolate the issue and label remains the big troublemaker, as it has done from the start.

(not running a super computer here, but not an rpi2 either… I’d say my manic is above the average Pi most people are running HAOS on, so that is not what we should be looking at finding the source of the issue)

that could be it yes, not only Companion app though. I never edit in the app, only on Desktop, and the suffering is real…

Anyone know how to workaround the bug Auto-Entities has when using with light-entity-card ?

AE’s Exclude filters do not work. Any back-door tricks?

You use a template filter and build the yaml as a list of dictionaries.

you lost me with using dictionaries. I only found 1 line, in one post, which might be similar to what I think you are saying…

so DeepSeek helped by making this, but the exclusions are not working…

type: custom:auto-entities
show_empty: false
card:
  type: grid
  columns: 5
  square: false
  grid_options:
    columns: auto
card_param: cards
filter:
  template: >
    [ {% for e in states.light 
         if e.name is match('.*RGB.*') 
         and not e.name is match('.*Left.*') 
         and not e.name is match('.*Right.*') 
         and not e.name is match('.*1') 
         and not e.name is match('.*2') 
         and not e.name is match('.*Unavailable') %}
      {{ dict(
          entity=e.entity_id,
          type='custom:light-entity-card',
          shorten_cards=false,
          consolidate_entities=false,
          child_card=false,
          hide_header=false,
          header="",
          color_wheel=true,
          persist_features=true,
          brightness=true,
          color_temp=true,
          white_value=true,
          color_picker=true,
          speed=true,
          intensity=true,
          force_features=false,
          show_slider_percent=true,
          full_width_sliders=true,
          brightness_icon="weather-sunny",
          white_icon="file-word-box",
          temperature_icon="thermometer",
          speed_icon="speedometer",
          intensity_icon="transit-connection-horizontal",
          effects_list=true
      ) }}{% if not loop.last %},{% endif %}
    {% endfor %} ]
sort:
  method: friendly_name
  reverse: false
  numeric: false
grid_options:
  columns: full