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

The type you are using for the template is actually ā€˜special row elementsā€™, at least that is how it is working for me.
https://www.home-assistant.io/lovelace/entities/

type: 'custom:auto-entities'
show_empty: true
card:
  type: entities
filter:
  template: |
    {%- for chore in state_attr('sensor.grocy_chores', 'chores') -%}
      {{ { 'entity' : 'sensor.grocy_chores',     
           'name' : chore.name,
           'icon' : 'mdi:broom',   
           'type' : 'button',
            }
             }},
    {%- endfor -%}

Hi Marius,

Maybe you can help me. The auto-entities in the glance card works how I want it.
But, with the auto-entities I donā€™t now how to show the image instead of the standard icon.

Can you help me?

please post a config and a sensor you want to show an image for. My guess is, you want to customize the sensor using an image instead of the icon. if thatā€™s the case, you need something like this:

homeassistant:


  customize:

    sensor.afvalwijzer_restafval:
      entity_picture: /local/afvalwijzer/restafval_saver.png
      friendly_name: Restafval

    sensor.afvalwijzer_plastic:
      entity_picture: /local/afvalwijzer/plastic_saver.png
      friendly_name: Plastic

    sensor.afvalwijzer_gft:
      entity_picture: /local/afvalwijzer/gft_saver.png
      friendly_name: Gft

    sensor.afvalwijzer_papier:
      entity_picture: /local/afvalwijzer/papier_saver.png
      friendly_name: Papier

which should be somewhere in your configuration.yaml (so not in the Lovelace card).

the lovelace auto-entities card will show these sensors, with their customized images, instead of the default mdi:icon.

1 Like

This is exactly what I am looking for.
I think thought that is has to be in a separate file ā€œcustomize.yamlā€

Thx, works perfect :ok_hand:

nope, it cĆ”n be, but doesnā€™t have to be.

It hƔs to be in the hierarchy I posted, and where you put that is up to you.

personally, I have all my generic customizations in a dedicated package, and all specific ones in their own package along with all other configs of that specific set of integration / uses.

is there any way to use auto-entities with button card?

Sure. You can use any (?) card within the auto-entities.

I use custom:button-card to display the pollen-forecast:

              - type: 'custom:auto-entities'
                card:
                  title: 'Pollen: Heute'
                  type: entities
                  style: [...]
                filter:
                  include:
                    - entity_id: sensor.fc1*
                      state: low
                      options:
                        type: 'custom:button-card'
                        entity_id: this.entity_id
                        layout: icon_name_state2nd
                        styles: [...]
                        show_label: true
                        label: niedrig
                        show_state: false

I dont know if that is exactly what i need. i Want to generate and sort entities i specify in include option to generate button like this in horizontal-stack-card

hey all,
is there a way to do an ā€œorā€ statement for the ā€œstateā€ which you have within include?

i wanted to include either ā€œerrorā€ or ā€œunavailableā€ here:

  include:
    - label: Robots
      type: section
    - name: '*Rover*'
      domain: vacuum
      options:
        name: Rover Issue
        type: 'custom:secondaryinfo-entity-row'
        secondary_info: '<b style=''color:red''>[[ vacuum.rover.attributes.status ]]</b>'
      state: unavailable

i tried this both with and without the " and the - but didnt work

state:
  - "unavailable"
  - "error"

The docs mention the or option for filters. Pretty sure you can achieve what you want by using it.

  • or: Match any in a list of filters.

hey, i see that, but cant get it to work still?

      state: 
        or: 
          unavailable
          error

See below, it must be under include or exclude

type: 'custom:auto-entities'
sort:
  method: entity_id
  numeric: true
card:
  type: entities
  color: '#0707de'
  show_header_toggle: false
  state_color: true
  title: ''
show_empty: false
unique: true
filter:
  include:
    - entity_id: '*prusa*'
    - entity_id: sensor.shelly_shsw_pm_b90adf_current_consumption
  exclude:
    - state: 'off'
    - state: unavailable
    - state: unknown
    - state: '0'

Try:

type: custom:auto-entities
card:
  type: entities
  show_header_toggle: false
filter:
  include:
    - or:
       - state: unavailable
       - state: error

I had previously set up auto-entities to show my local bus and train schedules (in real time). The data is obtained via a REST sensor from their API.

I havenā€™t used the setup for a while due to Covid, but now I tried to get it back running. I copied the setup, but for some reason auto-entities does not seem to honor the filter options:

First, it should not display lines that have under three minutes until departure. Next, I tried to exclude line 39 from Helsinki but it shows up there. Same for LeppƤvaara, 550 shows up even when excluded.

Here is a example of the sensor entity values (not taken at the same time as above):
image

Does anybody have any clues what could be wrong?

Hi,

just need some help with special options. maybe someone has an idea?

Problem:

I want to have all switches with state ON, excluding some entitiesā€¦

I just were able to exclude 1 (one) entity. tried several variations - but did not succeed excluding multiple entities.

any idea what could help?

my not working example :wink:

- type: custom:auto-entities
card:
  type: glance
  title: active entities
  show_state: true
  show_header_toggle: false
  state_color: true
filter:
  include:
   - domain: switch
      state: "on"
      not:
        entity_id: switch.fritzbox_7590_ui_wifi    
        entity_id: switch.fritzbox_7590_ui_wifi_5ghz
      options:
        secondary_info: last-changed

use exclude

1 Like

thanks!! so easy :wink: that helped me to look the right directionā€¦

How can i show the Headline with a Icon ?

Example:
header

- type: custom:stack-in-card
        title: Test
        style: |
          ha-card .card-header {
            font-size: var(--font-size-subtitle);
            margin-bottom:0;
            padding-bottom:0;
          }
        cards:
          - type: custom:auto-entities
            card:
              show_header_toggle: false
              #title: Shelly
              type: entities
            filter:
              include:
                - entity_id: '*shelly*'

this works only for the headline, but how can i add a icon ?

Thanks for help!

Is it possible for the auto-entities plugin to show only those entities from a given Integration, e.g. Z-wave or Zigbee?

yes, depending on your naming convention