🔹 Auto-entities - Automatically fill cards with entities

After upgrading to Home Assistant 0.116.4 (from 0.115.3) I got errors in all my Auto Entities cards
Can someone help ?

Custom element doesn’t exist: auto-entities.
card:
title: Movments
type: entities
filter:
include:
- entity_id: binary_sensor.motion_sensor*
type: ‘custom:auto-entities’

1

Pretty much.

Just a thought after someone had an issue with my weather card… Do you use HACS? Is it set up as an integration or YAML? Do you have the HACS side menu? If still using yaml try switching to adding the integration in the GUI instead.

Yes, I have HACS and I have set it up via HACS.
I have HACS side menu.

In the breaking changes of the 0.116.4 it mentioned:
Custom Lovelace Cards
This release contains breaking changes for custom card developers, check the developers blog for more information.
If you have a custom card that stopped working this release, please report this with the custom card author.

I use this card and it’s working fine. Did you check you are running the latest version? Have you checked the card is in the lovelace resources?

I have ‘custom:auto-entities’ and it is working fine but i wanted to try adding another element with ‘custom:template-entity-row’ but i cant get it to work , it looks like maybe i have not installed the plugin correctly but i did it exactly the same as “auto-entities”, what have i got wrong.

type: 'custom:auto-entities'
card:
  title: Parcels
  type: entities
filter:
  include:
    - entity_id: sensor.*track_package_*
      options:
        type: 'custom:template-entity-row'  
        name: >-
          {{ state_attr('this.entity_id','friendly_name') |
          regex_replace(find="Seventeentrack Package: ", replace="",
          ignorecase=True)}}

parcels

How to have shown a state of an entity?
I am using this:

              include:
                - domain: sensor
                  attributes:
                    battery_level: "<=100"
                - domain: binary_sensor
                  attributes:
                    battery_level: "<=100"
                - domain: switch
                  attributes:
                    battery_level: "<=100"
                - entity_id: "*hue_smart*"
                  state: "<=100" 

But it doesn’t work…
The entities are shown regularly but without the state value…

This works for me:

card:
  show_header_toggle: false
  title: Batterie states
  type: entities
filter:
  include:
    - domain: sensor
      attributes:
        battery_level: <=100
  sort:
    method: state
    numeric: true
type: 'custom:auto-entities'

Hmmm maybe i was not so clear… what i need is to show a value of an entity state just like the option ‘attributes’ does.

How to include an entity inside the card and show his state value?

I don’t get you, sorry.

You want something like that?:

Yes, that’s what i try to have…

I have these sensors:

And i want to see their battery values.

I added this inside an auto entities card:

              include:
                - entity_id: "*hue_smart*"
                  state: "<=100" 

But i don’t get the battery value. How to do ?
Hope i am clear enough now…

You should have tried what I posted before. :sunglasses:

Add switch and binary_sensor to my code above and you should be fine:

card:
  show_header_toggle: false
  title: Batterie states
  type: entities
filter:
  include:
    - domain: sensor
    - domain: switch
    - domain: binary_sensor
      attributes:
        battery_level: <=100
  sort:
    method: state
    numeric: true
type: 'custom:auto-entities'

Except for the hue thing, I don’t know what domain it is. It’s just a light, no?

This works too, for all entities with battery in its name, therefor some excludes:

card:
  show_header_toggle: false
  title: All Batteries
  type: entities
filter:
  include:
    - entity_id: '*battery*'
  exclude:
    - domain: script
    - domain: automation
  sort:
    method: state
    numeric: true
type: 'custom:auto-entities'

Which gives me:

Note: there is no need to use battery_level: <=100 here.

No way, i tried both your examples but this is what i get:

Schermata 2020-10-22 alle 19.40.28

What devices are Cubo and Finestra (window?) and does the Hue Smart Buttons have a numeric value?
Asking because f.e. the blink battery has no numeric values, it just says ‘good’, ‘normal’ and ‘low’.

Consider to post your entire code here not only what you have posted before.

Cubo and Finestra are two binary_sensors.

This is the entire code:

          - type: custom:auto-entities
            sort:
              method: name
              attribute: battery
            card:
              type: custom:bar-card
              style: |
                .card-header {
                  font-size: 18px;
                }
                bar-card-value, bar-card-name {
                  font-size: 12px;
                  transform-origin: 0 0;
                  text-shadow: 1px 1px #0008;
                  white-space: nowrap;
                }
                bar-card-value {
                  margin-right: auto;
                  margin-left: 6px;
                  margin-bottom: auto;
                  margin-top: auto;
                }
                bar-card-currentbar, bar-card-backgroundbar {
                  border-radius: 12px;
                  border: 1px solid #DDD9;
                }
              unit_of_measurement: "%"
              severity:
                - color: '#bf4040'
                  from: 0
                  to: 30
                - color: '#bf9540'
                  from: 30.1
                  to: 70
                - color: '#40bf40'
                  from: 70.1
                  to: 100
              animation:
                speed: 1000
                delay: 1000
                state: 'on'
              color: '#222222'
              direction: right
              entity_row: true
              height: 25px
              width: 100%
              limit_value: true
              min: 0
              max: 100
              title: 'Livello Batterie:'
              stack: vertical
              target: 15
              attribute: battery_level
              positions:
                icon: 'off'
                indicator: 'off'
                title: inside
                minmax: 'off'
                value: inside
                show_minmax: true
            filter:
              include:
                - domain: sensor
                  attributes:
                    battery_level: "<=100"
                - domain: binary_sensor
                  attributes:
                    battery_level: "<=100"
                - domain: switch
                  attributes:
                    battery_level: "<=100"
                - entity_id: "*hue_smart*"
#                  state: "<=100"                
              exclude:
                - entity_id: "*umidit*"
                - entity_id: "*plug*"
                - entity_id: "*illumin*"
                - entity_id: "*pressur*"
                - entity_id: "sensor.mi_h_4c65a8d05d5d"
                - entity_id: "*hue*lamp*"

Sorry, I didn’t know about the bar-card integration and you are mixing it up with auto-entities, so this was a bit trickier.
I suspect it don’t work for you because of wrong indentation.

Since the Hue buttons are recognized as sensors you should get them either by using an (auto-entities) filter with - domain: sensor or - entity_id: "*hue_smart*" or - entity_id: '*battery_level*'

Here is a shortend example which uses bar-card inside auto-entities and works for me, you may use this a basis to start over (bevor adding bar-cards other fancy stuff, like text formating, etc.) :

type: 'custom:auto-entities'
sort:
  method: state
  numeric: true
card:
  type: 'custom:bar-card'
  severity:
    - color: '#bf4040'
      from: 0
      to: 30
    - color: '#bf9540'
      from: 30.1
      to: 70
    - color: '#40bf40'
      from: 70.1
      to: 100
  show_header_toggle: false
  title: Batteries
filter:
  include:
    - entity_id: '*battery_level*'

A word about the auto-entities sorting you’re trying use in your original code:

sort:
   method: name
   attribute: battery

If you use attribute, you have to use attribute as the method:

sort:
   method: attribute
   attribute: battery

Is it possible to use with a picture glance card? :slight_smile:
I have a camera that I would only like to show when the camera is “on”.

Have you tried using a conditional card? That is how I achieved this!

Im still very new… and for some reason I can’t filter out everything except browser_mod… i know this something silly…but plz help :). —> i get this error “Cannot convert undefined or null to object”

    type: custom:auto-entities
    show_empty: false
    card:
      type: entities
      title: Lights on
      show_header_toggle: false
    filter:
      include:
        - domain: light
        - domain: switch
      exclude:
        - state: "off"
        - state: "unavailable"
        - attributes:
          type: browser_mod

for me i get this error, when using -atributes

Cannot convert undefined or null to object
type: 'custom:auto-entities'
show_empty: false
card:
  type: entities
  title: Lights on
  show_header_toggle: false
filter:
  include:
    - domain: light
  exclude:
    - state: 'off'
    - state: unavailable
    - attributes: null
      type: browser_mod
1 Like

This is because of a bad indentation of the last line.
Try

- attributes:
    type: browser_mod
1 Like