🔹 Auto-entities - Automatically fill cards with entities

I want to list automation based on area. I can list all automation or entities based on area, can I combine both?
I named my automation in the following way, if the above is not possible, is it possible to filter the automation based on the first part of the automation name? eg: [Bedroom], [Dyson] etc?
image

Hello i have this card to show if something is open, is it possible to make like a “bottom card template” to reduce duplicate code when i have to add all my sensors?

type: custom:auto-entities
card:
  type: entities
  title: Security
  icon: mdi:shield-home
filter:
  include:
    - entity_id: binary_sensor.office_window_contact
      state: 'on'
      options:
        secondary_info: last-changed
        name: Office Window
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  {% if is_state('binary_sensor.office_window_contact', 'on') %}
                  animation:  blink 2s linear alternate infinite;
                  color: red !important;
                  {% endif %}
                }      
                @keyframes blink {
                  0% {opacity: 1;}
                  100% {opacity: 0;}
                }
                .info {
                  {% if is_state('binary_sensor.office_window_contact', 'on') %}
                  color: red;
                  {% endif %}
                }      
                @keyframes blinking {
                  0% {opacity: 1;}
                  100% {opacity: 0;}
                }
                .text-content:not(.info) {
                  {% if is_state('binary_sensor.office_window_contact', 'on') %}
                  animation:  blink 2s linear alternate infinite;
                  color: red;
                  {% endif %}
                }
        icon: mdi:window-open-variant

Any special reason to auto-create a list with just ONE entity with a known name?
Since you need to show the row only if “ON” - you may use a conventional conditional row.

In general (not for this case which is unclear for me) - try using decluttering-card.

1 Like

No special reason, I just didn’t know there was another way :roll_eyes: but thanks ill try it out!
Also I will see if I can figure out how to use decluttering-card

Thanks a lot for your answer!

Hi guys

How do I turn this into a grid layout.

type: custom:auto-entities
card:
  type: entities
  title: Fronius Readings
  state_color: true
filter:
  include:
    - integration: fronius
      options:
        type: custom:mushroom-entity-card
  exclude: []
sort:
  method: friendly_name

Hi,

I want to use filter template to display only entities for area based on input_text.
Now my code looks like:

type: custom:auto-entities
card:
  type: custom:layout-card
  layout: horizontal
  column_num: 2
  view_layout: horizontal
filter:
  exclude: []
  include:
    - domain: light
      options:
        type: custom:auto-entities
        card:
          type: custom:layout-card
        styles:
          card:
            - height: 200px
            - width: 200px
        filter:
          template: >-
            {% if area_name(config.entity) == states('input_text.room')
            %}           
              {{ [
                {
                  "type": "custom:button-card",
                  "entity": config.entity,
                }
             ] }}
            {% endif %}
        show_empty: false
show_empty: false

But not matching entities are not displayed, but are created and there are empty places .
DEV_–Home_Assistant-_2022-04-03_19.03.47

How can i achieve list without this empties ?

Regards

Is it possible to show the value of an attribute in the card rather than the main state value?

I have a bunch of Zigbee sensors integrated through zigbee2mqtt. They all have linkquality and battery attributes and some have other attributes as well. I would like to have a battery card that showed the battery levels of all of them for example.

Kind of this:

  - type: custom:auto-entities
    card:
      type: entities
    unique: true
    show_empty: true
    filter:
      include:
        - entity_id: device_tracker.*
          attributes:
            ip: "*.*"
          sort:
            count: 2
            method: name
          options:
            type: attribute          ##### show attribute value
            attribute: ip
            secondary_info: last-changed

image

The most difficult issue is to specify a filter to show only your required entities.
In my example only trackers with present “ip” attribute are listed.

1 Like

Thank you, that looks like what I need. I could not find that options: type: attribute in the documentation for the card.

I use this and it’s working OK.

card:
  title: Battery
  type: entities
type: custom:auto-entities
filter:
  include:
    - options:
        type: attribute
        attribute: battery
        secondary_info: last-changed
      attributes:
        battery: ">= 0"
sort:
  method: attribute
  attribute: battery
  numeric: true

Can I make it say “xx %” for the value?

1 Like

This is an option of the conventional Entities card.

Try using a suffix option.

Whatever is specified in the “options” section is passed directly to the row, this is not an auto-entities-specific.

Ah I see. Thank you.

For those who use Shelly devices and want a card with all their devices and clickable links to manage them:

card:
  show_header_toggle: false
  title: Shelly links
  type: entities
filter:
  template: |-
    {%- for state in states.sensor -%}
      {%- if  state.entity_id | regex_match("sensor.*ip", ignorecase=False) -%}    
          {{
            {
              'entity': state.entity_id,
              'name': state.attributes.friendly_name|replace(" IP",""),
              'type': 'weblink',
              'url': "http://"+state.state
            }
          }},
      {%- endif -%}
    {%- endfor -%}
type: custom:auto-entities

1 Like

i want to use the auto entity card and automatically build cards
so i would like to have a heading and seven entities in one vertical stack
these vertical stacks should repeat for all entities but always should contain 7 entities.

so:
vertical-stack1
heading1
entities1-7

vertical-stack2
heading2
entities8-14

and so on

any way to make a template for this?

Do you have any idea how to make the list of entities expand only to the bottom with new items?

Currently it expands both down and up making it impossible for me to place it near the top of the screen on the main screen.

Use 2 auto-entities cards with same filter & different sort options:

  • entities ## 0 … 6
  • entities ## 7 … 13

P.S. This method may be also used to list rows in 2 columns.

Unclear, can you provide more details with pics?

hey guys, reading through, but couldn’t find what im looking for.

Im wanting to have Auto Entities create cards that are grouped by area and only showing the lights in each area?

Any ideas?

Look at my post above… For entities card this works, but i have problem with other cards (light)

Nah I don’t want to filter, I want to create area cards that show all the lights??

I have floorplan with status

I would like the status field to be on the top left and new items from auto-entities to appear at the bottom and the list to only expand downwards, currently it expands both up and down as in the image below.