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

Thanks!

I donā€™t really know how to use template filterā€¦
Does it add a condition to the include/exclude filters or it canā€™t be used at the same time ?
Those are my actual filters, i just need to apply time condition on them.

          include:
            - state: open
              name: /Couloir/
            - state: open
              name: /CH 2/
            - state: open
              name: /CH 3/
            - state: 'on'
              domain: light
            - state: 'on'
              name: /LumiĆØre/
              domain: switch
            - state: 'on'
              domain: media_player
            - state: 'on'
              domain: switch
              name: /Ordinateur/
          exclude:
            - name: /iPad/

Thanks.

How to exclude a helper group. Do i need to include ā€œgroupā€ in the name or can anything else be done?
Domain seems not to be work. like

exclude:
    - state: 'off'
    - state: unavailable
    - domain: 'group'

Iā€™m trying to add show_header_toggle: true to this card, but it doesnā€™t seem to work nesting it under ā€œcard:ā€ like it would on an entities card. Can anyone help? Have been googling for a few hours now. Here is the card with the not-working show_header_toggle: true added.

type: vertical-stack
cards:
  - type: custom:auto-entities
    card:
      type: grid
      title: Master Bedroom
      columns: 1
      square: false
      show_header_toggle: true
    card_param: cards
    filter:
      include:
        - area: master_bedroom
          domain: light
          options:
            type: custom:mushroom-light-card
            show_brightness_control: true
            show_color_control: true
            show_color_temp_control: true
            fill_container: false
            use_light_color: true
            layout: horizontal
      exclude:
        - name: '* [Ll]ight *'
    show_empty: true
    sort:
      method: state
      reverse: true
      numeric: false

Thanks for any help anyone can provide. Canā€™t seem to find my use case when looking around.

The ā€œshow_header_toggleā€ option is not a part of the Grid card.

1 Like

Slowly but surely I am beginning to understand the function of the auto-entieties card.

Now I would like to use the card to display all of my plants in an dashboard and in another dashboard the plants that have a problem.

Before I jump in now, I would be great if the pros could have a look on the project if this is possible.

Currently everything is built by hand.

Code for an area

type: vertical-stack
cards:
  - type: custom:mod-card
    card:
      type: custom:mushroom-title-card
      title: KĆ¼che
    card_mod:
      style:
        mushroom-title-card$: |
          .title {
            --title-font-size: 18px;
            --title-font-weight: bolder;
          }
        .: |
          ha-card {
            padding-bottom: 0px !important; 
          }
  - type: custom:flower-card
    entity: plant.philodendron_sensor_18
    show_bars:
      - moisture
      - conductivity
      - temperature
    battery_sensor: sensor.plant_sensor_18_battery
  - type: custom:flower-card
    entity: plant.sensor_15_feuerkuesschen
    show_bars:
      - moisture
      - conductivity
      - temperature
    battery_sensor: sensor.plant_sensor_15_battery
  - type: custom:flower-card
    entity: plant.korbmarante_sensor_03
    show_bars:
      - moisture
      - conductivity
      - temperature
    battery_sensor: sensor.plant_sensor_03_battery

If you pros think that it is possible i will try to build it.

Does anyone know how to get this card within auto entities?
Id like to get all my users into thisā€¦
Where ā€œlaurensā€ is is 1 of the usersā€¦ But iv got more users

square: false
columns: 1
type: grid
cards:
  - type: conditional
    conditions:
      - entity: sensor.laurens_state
        state_not: unknown
    card:
      type: custom:button-card
      custom_fields:
        picture:
          card:
            type: picture
            image: |
              [[[
                return states['sensor.laurens_session_thumbnail'].state
              ]]]
            style: |
              ha-card {
                box-shadow: null;
              }
        bar:
          card:
            type: custom:bar-card
            entities:
              - entity: sensor.laurens_progress
            positions:
              icon: 'off'
              indicator: 'off'
              name: inside
            height: 19px
            color: '#e49f29'
            name: |
              [[[
                return states['sensor.laurens_state'].state
              ]]]
            style: |-
              ha-card {
                --ha-card-background: none;
                border: none;
              }
              bar-card-card {
              }
              bar-card-name {
                margin-left: 125px;
                text-shadow: 1px 1px #0005;
              }
              bar-card-value {
                margin-right: -100px;
                text-shadow: 1px 1px #0005;
              }
        intro: |
          [[[
            return "<b>laurens</b> is currently watching..."
          ]]]
        title: |
          [[[
            return states['sensor.laurens_full_title'].state
          ]]]
        stream: |
          [[[
            return states['sensor.laurens_video_resolution'].state + " > " + states['sensor.laurens_transcode_decision'].state + " > " + states['sensor.laurens_stream_resolution'].state + ""
          ]]]
      style: |
        ha-card {
          box-shadow: null;
          padding: null;
          margin: null;
          border: null;
        }
      styles:
        card:
          - height: 100px
        custom_fields:
          picture:
            - margin: '-5px -7px -5px 7px'
            - padding: '-10px 0px -10px -5px'
            - border: '-10px 0px -10px -5px'
          bar:
            - margin-left: 0px
            - margin-right: 0px
            - margin: '-10px 115px -12px -125px'
            - font-size: 13px
          intro:
            - text-align: start
            - font-size: 15px
            - color: '#e49f29'
            - margin-bottom: 20px
          title:
            - text-align: start
            - font-size: 13px
            - margin-bottom: 2px
          stream:
            - text-align: start
            - font-size: 13px
            - margin-top: 5px
        grid:
          - grid-template-areas: >-
              "picture x intro intro intro" "picture x title title title" 
              "picture x bar bar bar"  "picture x stream stream stream"
          - grid-template-columns: 1fr 15px 1fr 1fr 1fr 15px

Yep, just did a write up here. HTH!

1 Like

Hi guys, I would like to show only the sensor with the lowest numerical value with auto entities, can anyone help me out? Thank you

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - entity_id: sensor.prezzo_benzina_q8_gambolo
    - entity_id: sensor.prezzo_benzina_esso_vigevano_rotonda
    - entity_id: sensor.prezzo_benzina_kerotris_vigevano_gommista
    - entity_id: sensor.prezzo_benzina_q8_vigevano_esselunga
    - entity_id: sensor.prezzo_benzina_mtm_vigevano_rosso
    - entity_id: sensor.prezzo_benzina_af_petrol_vigevano_ipercoop
sort:
  method: state
  reverse: false
  numeric: false
show_empty: true

15

Which integration are u using for this?

No integration and one scrape.

According to the documentation you could add the option count to the sort area.

sort:
  method: state
  reverse: false
  numeric: false
  count: 1

That should do the trick.

Thanks 1000

Is there a way to show all available hue scenes for a spesific light?
I have tried this:

type: custom:auto-entities
card:
  type: button
filter:
  include:
    - domain: scene
    - state: light.kontor_hr
      options:
        tap_action:
          action: call-service
          service: hue.activate_scene
          service_data:
            entity_id: this.entity_id

But it displays just one big button.

Or this:

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - domain: scene
    - entity_id: light.kontor_hr
      options:
        tap_action:
          action: call-service
          service: hue.activate_scene
          service_data:
            entity_id: this.entity_id

But that lists all available scenes, not just for the light kalled light.kontor_hr

handy idea ! just tried this and it worked

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - entity_id: scene*
  exclude: []

Hello is it possible to hide the name of each entity?

Yes, your code work, but it doesnā€™t limit to one specific light, which is what Iā€™m looking for.

I tried using templates, but getting identation errors I cannot seem to solve. Here is what I tried:

type: 'custom:auto-entities'
card:
  type: entities
  entities:
    - type: section
      label: Scenes for Kontor
    {% set scenes = state_attr('light.kontor_hr', 'hue_scenes') %}
    {% for scene in scenes -%}
      - type: button
        tap_action:
          action: call-service
          service: hue.hue_activate_scene
          service_data:
            entity_id: light.kontor_hr
            scene_name: "{{ scene }}"
        name: "{{ scene }}"
    {% endfor %}
  show_empty: false
  filter:
    include:
      - entity_id: light.kontor_hr

But this gives me the error:

Configuration errors detected:

    bad indentation of a mapping entry (7:5)

     4 |   entities:
     5 |     - type: section
     6 |       label: Scenes for Kontor
     7 |     {% set scenes = state_attr('ligh ...

And no matter where I move the indentations, I can never get it working.
Can anyone help me?

Thanks.

As far as i understand things right. The card parameter is to select the container, a card that is able to display many entities like the entty card ord the grid card or a vertical stack card. And with the options entry you define the card inside the container.

So if you select grid in card you could use button inside options.

Example

type: custom:auto-entities
filter:
  include:
    - entity_id: sensor.net_gas_station_*
      options:
          type: custom:mushroom-template-card
          entity: this.entity_id
          primary: '{{state_attr(entity, ''brand'')}} - {{state_attr(entity, ''city'')}}'
          secondary: '{{states(entity)}} ā‚¬'
          picture: /local/gas_station/{{state_attr(entity, 'brand')}}.png
card:
  square: false
  columns: 2
  type: grid
show_empty: false
card_param: cards
sort:
  method: state
  numeric: true

This gives me a grif of fuel station sorted by price.

Maybe that helps with your scenes

I think you are talking about the hue scenes that are created with the Hue App and are made visible in Home Assistant by the Hue integration. I donā€™t think you can filter by lamp/entity in the scene as my hue scenes only show the data below in the developer tools.

group_name: Woonkamer
group_type: room
name: Smaragden eiland
speed: 0.6031746031746031
brightness: 85.04
is_dynamic: true
friendly_name: Woonkamer Smaragden eiland

Since Hue scenes are associated with rooms or zones I use the code below to list all hue scenes in an area in an entities card. Home Assistant seems to automatically assign Hue Scenes to areas in Home Assistant if they have the same name as the room/zone in Philips Hue app so the list stays up to date when I change things in the Philips Hue appā€¦

Maybe that also works for you?
Then you could expand it to make it look more like you want.

card:
  type: entities
  title: Scenes
filter:
  include:
    - area: Woonkamer
      domain: scene
      integration: hue
type: custom:auto-entities
sort:
  method: friendly_name

I really like how you were able to get a different picture for each entity.
I want this for my hue scenes, but Iā€™m not there yet.
Will post a longer post below of what I have achieved so far.

Yes, you are right.
I concluded with the same; the scene entity_id are not listed when doing it like this.

Based on help from the community, this is what I got so far:

It still needs some tweaking, and I need to figure out how to use different pictures for the different buttons, but:

type: custom:auto-entities
card:
  square: false
  type: grid
  columns: 2
card_param: cards
filter:
  include:
    - entity_id: scene.kontor*
      options:
        type: custom:button-card
        show_entity_picture: true
        entity_picture: /local/hue-icons/hue-icon_lyst.png
        show_name: false
        name: nothing_yeet
        tap_action:
          action: call-service
          service: hue.activate_scene
          service_data:
            entity_id: this.entity_id
        double_tap_action:
          action: call-service
          service: light.turn_off
          service_data:
            entity_id: light.kontor_hr

Gives this output:
image

3 working buttons :slight_smile:

Iā€™m not sure if this is a Auto-Entities discussion anymore, or if it should be moved to custom: button-card, butā€¦

We still need to figure out how to use different pictures for different scenes somehow.

I have created pictures for different scenes and name them the same as the scene name

Maybe it is possible to strip the scene entity name so only the scene name remains.
Example: strip scene.kontor_hr_golden_pond so only golden_pond remains

That way we could create something like this:
entity_picture: /local/hue-icons/hue-icon_{{stripped_entity_name]]_lyst.png

I also think it would be wise to remove the text from the picture and use a stripped show_name instead.
That way the icons could be used by others than me

Thanks again for helping out, I really appreciate it