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

Iā€™d use that

how do i put filter battery level is 50 or less in this

card:
show_header_toggle: false
title: Batteri Niveautest
type: entities
filter:
exclude:
- state: ā€˜offā€™
- state: unavailable
include:
- entity_id: ā€˜.battery_levelā€™
show_empty: true
type: ā€˜custom:auto-entitiesā€™

Mine version:

    cards:

      - type: custom:auto-entities
        show_empty: false
        card:
          type: glance
          title: Batteries running low!!!
          show_header_toggle: false
        filter:
          include:
            - entity_id: sensor.*.battery_level*
              state: <= 30

Thanks !!! IT works :slight_smile: nice :smile:

In a normal entities card, I can add styling to a divider to hide it (height: 0px;) so just the label is visible:

type: entities
entities:
  - label: HOME ASSISTANT CORE
    style: |
      div.divider {
         height: 0px;
       }  
    type: section
  - entity: sensor.version_installert
  - entity: sensor.updater_tmpl
  - entity: sensor.potential_breaking_changes
  - entity: sensor.hacs
  - entity: sensor.uptime_tmpl
  - entity: sensor.db_size_tmpl

Looks like this:

2_ui

I am using the auto-entities card to hide row 2, 3 and 4. When I add the same styling there, nothing happens to the divider:

card:
  show_header_toggle: false
  type: entities
filter:
  include:
    - label: HOME ASSISTANT CORE
      options:
        style: |
          div.divider {
            height: 0px;
          }  
      type: section
    - entity_id: sensor.version_installert
    - entity_id: sensor.updater_tmpl
      state: Versjon*
    - entity_id: sensor.potential_breaking_changes
      state: '> 0'
    - entity_id: sensor.hacs
      state: '> 0'
    - entity_id: sensor.uptime_tmpl
    - entity_id: sensor.db_size_tmpl
type: 'custom:auto-entities'

1_ui

@QbaF
How did you configured the xiaomi battery percentage???
Battery is an attribute of the state, not a stateā€¦
Cannot get the xiaomi battery workingā€¦ :-S

When you include a single row with type: you should not use options:, but put the options directly on the row. Exactly as you did with label:.

@Dinges28
I have Xiaomi battery level as a sensor.

@QbaF
Can you explain?

Which Xiaomi sensor You have and how do You connect it to HA?

I have motion sensors, switches and magnetic sensors, paired with xiaomi hub, native integration with HA

A ok, maybe that is the reason, I do connect via Conbee.

But You can make a sensor from attribute using Template or Add-on Attributes.

the attributes add-on i did not know. Thank you for the tip!

Hi @thomasloven

Iā€™ve the Nuki smart lock, and I wants an indication when the battery state is low.
For this purpose, there is an attribute called ā€œbattery_criticalā€ which can be ā€˜falseā€™ or ā€˜trueā€™.
I tried it as follow (without success):

  - type: custom:auto-entities
    card:
      type: entities
      title: Low Battery
      show_header_toggle: false
    filter:
      include:
        - domain: lock
          options:
            type: "custom:secondaryinfo-entity-row"
          attributes:
            battery_critical: "{% if is_state('{entity}.attributes.battery_critical', 'true')%} Battery is low ! {% endif %}"

Please advice.

Hi, which plugin are you using for the garbage info? And the icons? :slight_smile:
Very interested to this setup! Especially the icon pack

sure, here you go @xirixizā€™s afvalwijzer custom component: https://github.com/xirixiz/Home-Assistant-Sensor-Afvalwijzer

1 Like

Thatā€™s not how any of this works.
The filter contains the conditions on which to filter.

The best way I can interpret what youā€™re trying to do (though it wouldnā€™t work, because attributes does not support templates - as indicated by there being no mention of it in the docs) is to display locks where battery_critical is equal to Battery is low ! when battery_critical is equal to true. Canā€™t imagine there are many of thoseā€¦

o.k.
Thanks.

Trying to filter media_players based on the source_list attribute and a value of Roku Media Player - but not having any luck.

          include:
            - domain: media_player
              attributes:
                source_list: '*Roku Media Player*'

Does appear itā€™s some kind of list/array, so not sure if that makes a difference?
image

It does in that it canā€™t be doneā€¦ wellā€¦ not easilyā€¦

You can use the special attribute:index/key syntax to check each entry in the list, but youā€™d have to check all of them manuallyā€¦ that is

include:
  - attributes:
      source_list:0: "*Roku Media Player*"
  - attributes:
      source_list:1: "*Roku Media Player*"
  - attributes:
      source_list:2: "*Roku Media Player*"
  - attributes:
      source_list:3: "*Roku Media Player*"
  .. etc...

Unless youā€™re sure Roku Media Player is always at the same position in the list, then you only have to check that indexā€¦