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

yeah, agreed… dashboards require a lot of coding unfortunately as there is no uniformity among card development (I suspect because HA’s code doesnt have a many card features/capabilities natively the card devs can leverage)… Seems like everyone is reinventing a wheel.

Auto-entities is one of the few true user friendly card integrations so I was hoping it would make something this basic, as easy as it does everything else. Its a super useful card, but was hoping not to need to use a hack to do some basic things like ā€˜do not show the entity value’

by chance, I found that this disables all the clicks…

    options:
      type: simple-entity
      tap_action: none
      hold_action: none
1 Like

Longtime user, with pretty simple needs. I am transitioning some of my dashboard pages to the new sections format and I am happy to be using this to move some entries cards to use the new tile cards.

Tile cards are not supported in the direct way you might think by this extension, but there is a closed issue which provides some great examples and I’ve gotten this working easily. Posting it here in case it is useful to someone else trying to use auto-entities to make tile cards:

I know no cards which are ā€œunsupportedā€.

You’ve taken my words out of context. Easy to do so I have clarified the wording in my post.

You can use the various tap actions of the native entities card and set them to none

tap_action map (Optional)

Action taken on row tap. See action documentation.

hold_action map (Optional)

Action taken on row tap and hold. See action documentation.

double_tap_action map (Optional)

Action taken on row double tap. See action documentation

Edit: I see you discovered those :grinning:

2 Likes

Ok, some users probably thought that ā€œTile card is not supportedā€. But there are many examples here about using stack-like cards which these users seem to have not seen. Anyway, thanks for sharing some more examples.

Is there a way to exclude entities which are part of a group?

For example, a card which adds all lights automatically but will exclude individual entities which are part of a group?

Light 1, Light 2 are part of group Light. The card will only show the entity Light but not Light 1 and Light 2

          filter:
            include:
              - domain: light
                state: "on"
                options:
                  secondary_info: last-changed
            exclude:
              - label: grouped_lights
              - hidden_by: integration
              - hidden_by: user

I suggest utilizing the labels feature, you can label them grouped_lights like the example I provided or whatever makes sense to you.

You can also hide them and add the ā€œhidden_by:ā€ options as in the example.

Hope that helps!

1 Like

Hi, Is there a way to define the filter value, lets say threshold for low battery, using a input_number helper to make it more dynamic, rather than a defined number in the card?

Possible with ā€œtemplateā€ option, there are examples in this thread.

just to update on the grinding of the label include filter, Ive updated to the unreleased beta which was briefly mentioned by the author in the beta for 2025.4 recently.
it seems really fast in listing our entities, so I had hoped the label filter would have been fixed too. However, that is not the case. see filter on include: label causes lag and grinds the view Ā· Issue #438 Ā· thomasloven/lovelace-auto-entities Ā· GitHub

a straightforward config like:

type: custom:auto-entities
card:
  type: entities
  title: test filter label auto entities
filter:
  include:
    - label: intercom_speler

grinds the view, and even the editor in the UI when having entered - label and not even having typed the : yet…

be warned, or even better, join in in testing that, because it has been the one big flaw of the last year or so.
Now there is an imminent update to the resource, let’s give Thomas as much info that can help him fix this.

get the version here:

3 Likes

how do I create a tile card using auto-entities and mushroom?

you’d have to be more specific for us to even understand what you’re asking…

also, what have you tried?

Little help please. I’ve spend 2 hours getting no where. I tried…

Labels (Include and Exclude) - doesnt work
… still broken? the issue was closed a while ago

Name / Friendly Name (exclude) - doesnt work (can use ID, they are zone names)

Templates - that was a mess, it never worked as it seems to conflict with the Include.

Here’s the code without the template…

type: custom:auto-entities
card:
  type: entities
  title: Door & Window Recent Activity
  show_header_toggle: false
  state_color: true
filter:
  include:
    - label: Door
    - label: Window
    - attributes:
        last_tripped_time: < 1h ago
      options:
        state_color: true
        secondary_info: last-changed
  exclude:
    - label: Motion
sort:
  method: last_changed
  reverse: true
show_empty: false

Solution: remove/replace the Entity name text on the buttons. Took me 2 days to figure this out after multiple templates, searches and AI. Hope this helps others since there are too few examples of complete / working code on this thread.

And below a much fancier version using Expander and color border to show if any of the devices are on.

type: custom:auto-entities
card:
  type: custom:layout-card
  layout_type: horizontal
  layout_options:
    width: 60
    max_cols: 5
    square: true
card_param: cards
filter:
  include:
    - entity_id: input_boolean.bypass_*
      not:
        name: ""
      options:
        type: custom:button-card
        entity: this.entity_id
        show_name: true
        show_icon: true
        show_state: false
        name: >
          [[[
            return entity.attributes.friendly_name.replace("Bypass ", "").replace("bypass ", "");
          ]]]
        tap_action:
          action: toggle
        state:
          - value: "on"
            color: yellow
          - value: "off"
            color: grey
        styles:
          icon:
            - width: 30px
            - height: 30px
          name:
            - font-size: 50%
          state:
            - font-size: 50%

Fancier code…

type: custom:expander-card
title: Bypass Notifications
expanded: false
child-margin-top: .7em
padding: 0
clear-children: true
clear: true
title-card-button-overlay: true
title-card-clickable: true
title-card:
  type: custom:button-card
  entity: input_boolean.bypass_deck_small_motion
  show_name: false
  show_icon: false
  label: Bypass Notifications
  show_label: true
  triggers_update: input_boolean.bypass_*
  styles:
    label:
      - font-family: monospace
      - font-size: 100%
    card:
      - border: |
          [[[ 
            const entities = hass.states;
            let hasActive = false;
            
            for (const [entity_id, state] of Object.entries(entities)) {
              if (entity_id.startsWith('input_boolean.bypass_') && state.state === 'on') {
                hasActive = true;
                break;
              }
            }
            
            return hasActive ? 'solid 3px orange' : 'solid 3px grey';
          ]]]
  square: false
cards:
  - type: custom:auto-entities
    card:
      type: custom:layout-card
      layout_type: horizontal
      layout_options:
        width: 60
        max_cols: 5
        square: true
    card_param: cards
    filter:
      include:
        - entity_id: input_boolean.bypass_*
          not:
            name: ""
          options:
            type: custom:button-card
            entity: this.entity_id
            show_name: true
            show_icon: true
            show_state: false
            name: |
              [[[
                return entity.attributes.friendly_name.replace("Bypass ", "").replace("bypass ", "");
              ]]]
            tap_action:
              action: toggle
            state:
              - value: "on"
                color: yellow
              - value: "off"
                color: grey
            styles:
              icon:
                - width: 30px
                - height: 30px
              name:
                - font-size: 50%
              state:
                - font-size: 50%

1 Like

I got mine working for motion sensors (I have more than 20 of them), but the distance between each line was too much, and the value was just ā€œDetectedā€ which is of minimal use, so instead I used a markdown card that works in the same manner, but actually shows the exact time with most recent one on top, and the description, and if there is no motion - a single line message ā€œCurrently no motion detected.ā€. (I guess I could add some code to hide the card altogether instead in that case.) In my opinion, this is much more elegant (and takes up much less space):

Here is the code -

type: markdown
title: 🚶 Movement
content: >
  {% set motion_sensors = states.binary_sensor
     | selectattr('entity_id', 'match', '.*motion.*')
     | selectattr('state', 'equalto', 'on')
     | sort(attribute='last_changed', reverse=true)
     | list %}
  {% if motion_sensors | length > 0 %} {% for s in motion_sensors %} {{
  as_local(s.last_changed).strftime('%I:%M:%S %p') }}: {{ s.name }}

  {% endfor %} {% else %} Currently no motion detected. {% endif %}

2 Likes

yes, a nice feature of Markdown.
did you consider labels (it will be nicer on the system to only ā€˜watch’ the labeled entities in stead of the whole states

content: >
  {% set motion_sensors = label_entities('beweging')
     | select('is_state','on')|list %}
  {% if motion_sensors | length > 0 %} 
  {% for s in motion_sensors|expand %}
  {{as_local(s.last_changed).strftime('%I:%M:%S %p') }} : {{ s.name }}

  {% endfor %} 
  {% else %} Currently no motion detected.
  {% endif %}

personally, I use
{{as_local(s.last_changed).strftime('%X') }} : {{ area_name(s.entity_id) }}

2 Likes

how do I specify which sensors I want to show up? for example illuminance under sensors

filter:
  include:
    - domain: sensor
      area: bedroom

this is off topic but is there a better way to view all the types of cards at once? I don’t want to click on each one

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - domain: sensor
      area: stuen
      attributes:
        device_class: "illuminance"
  exclude: []

This has been a long standing issue for me, but since the dashboard plugin seems to be getting some development time, I wanted to see if I could get this resolved. I want to order entities by numeric state. However, the sorting seems to not convert the states into numbers, and is instead ordering them as strings.

This happens in two places within my dashboards:

The battery levels one is the most straight forward to look at:

type: custom:auto-entities
card:
  type: entities
  state_color: true
  title: Z-Wave / Thread Battery Levels
filter:
  include:
    - domain: sensor
      name: "*: Battery level"
  exclude: []
sort:
  method: state
  numeric: true
  reverse: false

The power consumption is similar, but has many exclusions (redacted most of them):

card:
  title: Power Consumption Reporting
  type: entities
  show_header_toggle: false
sort:
  method: state
  reverse: true
  numeric: true
filter:
  include:
    - attributes:
        unit_of_measurement: W
  exclude:
    - entity_id: sensor.inverter_*
    - entity_id: sensor.current_*
...
    - entity_id: sensor.all_standby_power
    - name: .*\(Hidden\)
    - state: <=15
type: custom:auto-entities