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

How would I remove the prefix Cabinets? I have four rooms with many Hue Scenes and this is just one, I hope to add to a popup card.

type: custom:auto-entities
card:
  show_name: true
  show_icon: false
  show_state: false
  type: glance
  state_color: false
  columns: 3
filter:
  include:
    - domain: scene
      area: Cabinets
      options:
        tap_action:
          action: call-service
          service: scene.turn_on
          service_data:
            entity_id: this.entity_id
show_empty: false
sort:
  method: none
  ignore_case: false

Someone got auto-entities to work with the new precise mode?

How to set the grid_options attribute to resize a single card (e.g. button)?

Hello, I have a problem sorting my garbage cans. These should be sorted in the order in which they are learned. However, 10 always comes first.

type: custom:auto-entities
card:
  type: grid
  columns: 4
card_param: cards
filter:
  include:
    - entity_id: sensor.blaue_tonne
      options:
        type: picture-elements
        elements:
          - type: state-label
            entity: sensor.blaue_tonne
            style:
              color: black
              font-weight: bold
              font-size: 1.2rem
              top: 50%
              left: 50%
        image: >-
          https://www.heilbronn.de/fileadmin/_processed_/d/7/csm_Piktogramm_Blaue_Tonne_e2a0b827f9.jpg
    - entity_id: sensor.gelbe_tonne
      options:
        type: picture-elements
        elements:
          - type: state-label
            entity: sensor.gelbe_tonne
            style:
              color: black
              font-weight: bold
              font-size: 1.2rem
              top: 50%
              left: 50%
        image: >-
          https://www.heilbronn.de/fileadmin/_processed_/5/e/csm_Piktogramm_Gelbe_Tonne_c23c9e0328.jpg
    - entity_id: sensor.graue_tonne
      options:
        type: picture-elements
        elements:
          - type: state-label
            entity: sensor.graue_tonne
            style:
              color: black
              font-weight: bold
              font-size: 1.2rem
              top: 50%
              left: 50%
        image: >-
          https://www.heilbronn.de/fileadmin/_processed_/7/7/csm_Piktogramm_Restmuelltonne_8e0d0c655d.jpg
    - entity_id: sensor.braune_tonne
      options:
        type: picture-elements
        elements:
          - type: state-label
            entity: sensor.braune_tonne
            style:
              color: black
              font-weight: bold
              font-size: 1.2rem
              top: 50%
              left: 50%
        image: >-
          https://www.heilbronn.de/fileadmin/_processed_/4/e/csm_Piktogramm_Biotonne_b1e84ed581.jpg
  exclude: []
sort:
  method: state
  numeric: true

you aren’t using auto-entities as it should be done, since you explicitly list the entities yourself.

let auto-entities do the work for you, by using a filter to include, (suggestion: use sensor.*_tonne) and then you can also make the sort work

see Garbage pickup date (mijnafvalwijzer.nl) custom_component - #944 by Mariusthvdb for examples how to sort your garbage :slight_smile:

I understand this may be out of the scope of auto entities. I use auto entities to populate this ā€œlogbookā€ card.

  - type: "custom:button-card"
    template: card_title
    label: "Automations"
  - type: custom:auto-entities
    card:
      type: "logbook"
      hours_to_show: 12
      square: false
    filter:
      include:
        - domain: automation
          area: living_room
          state: "on"
      exclude:
        - domain: automation
          label: dimmer
        - domain: automation
          label: occupancy
    sort:
      method: name

Is there a way to use the auto-entities’s filter as the filter for conditional cards?

For example if the filter comes out with 0 entities, don’t display the title ā€œAutomationsā€ and don’t display the logbook card below either…

Read Docs about alternative card which is shown if a filter gives nothing.

I see that… the way I think this would work…

type: custom:auto-entities
card: <not sure what goes here if the list IS NOT EMPTY but I only want to show my custom title card>
card_param: <card_param>
entities:
  - <entity>
  - <entity>
filter:
  template: <template>
  include:
    - <filter>
    - <filter>
  exclude:
    - <filter>
    - <filter>
else: <not sure what goes here if I just want an empty card>
unique: <unique>
sort: <sort_method>

I think maybe this is somewhat what I need. I’ll keep digging… thanks for the hint…

Yes, but this is a rather advanced staff, have not proposed it.

I think the if you use a Jinga macro template to provide the entities to your auto entities template, you can use that same macro to provide account to a conditional card.

Why cant i regex multiple groups?

I’d preferrable filter by floor, but that is a too big hassle so I’m trying to filter by three light-groups i have on a specific floor, but this doesnt work, anyone got a clue?

filter:
  include:
    - domain: light
      group: "/light.group_[stuelys|kontorlys|kjokkenlys]/"
      options:
        type: tile
        features:
          - type: light-brightness
card:
  square: false
  type: grid
  columns: 2
show_empty: true
card_param: cards

Use https://regex101.com/
Untested:

"/light.group_(?:stuelys|kontorlys|kjokkenlys)/"

Hi, is there a possibility to populate the entities like this:

foo:
  - switch.power_outlet_1
  - switch.power_outlet_2

instead of

foo:
  - entity: switch.power_outlet_1
  - entity: switch.power_outlet_2

In the docs it’s specified to only work the seconds way, but maybe there is a workaround or even a fork with this feature.

Populate there?
Elaborate please.

Okay maybe I way a little too vague. My fault :grinning:. The following screenshot shows how the entities are inserted into the card, in this example the scheduler-card.

image

Here the entities are inside the key ā€œincludeā€ as a list of strings instead of a list of objects with ā€œentityā€, which is normally the case in for example the entities-card.

I hope this explains a bit better what I need.

Also here is the complete card if that helps:

type: custom:auto-entities
card:
  type: custom:scheduler-card
  tags: []
  exclude: []
  discover_existing: false
  title: false
  time_step: 1
  display_options:
    primary_info: default
    secondary_info:
      - relative-time
      - additional-tasks
    icon: action
  sort_by:
    - state
    - relative-time
  show_header_toggle: false
filter:
  include:
    - label: power-socket
      domain: switch
      options:
        - this.entity_id
  exclude: []
show_empty: true
card_param: include

So, AE gives

include:
  - entity: sensor.x
  - entity: sensor.y

and your card needs

include:
  - sensor.x
  - sensor.y

Right?

Try using a ā€œtemplateā€ option of AE to fill the ā€œincludeā€ option as needed.
(or ask the scheduler-card’s author to add ā€œentityā€ keyword as optional)

What exactly do you mean by ā€œtemplateā€?
I tried a bit with the options of the filters but that just adds more keys next to the ā€œentityā€ key which I dont want

Well I looked at the repo and saw about 100 open issues and the last release/commit is also a bit older so it’s maybe not really maintained anymore but didn’t look deeper into the issues.

Was just wondering if anyone got an idea or even a fork with this already

This is an option of auto-entities, check Docs.

As I understand this, it’s just another way to filter, which leads to the same problem still outputting ā€œ- entity: foo.barā€, atleast that’s what the second last of these examples got me when I tested it

Hmm, you are right:


Unfortunately, there is no option in AE to omit/replace the ā€œentityā€ word…

What might help you - lovelace_gen.

Thanks. This actually looks very helpful as I’m currently experimenting with getting my dashboard more dynamic