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

sorry!! I Dont understand this part . could be great if you could helpā€¦thankxxx

First do points 1,2 and then post here json file.
Start with a simplified version of your card to get a code shorter.

Anyway, I provided a detailed instruction for a ā€œcannot write a temple myselfā€ case.
HA requires ā€œlearningā€ - if a user does not learn then he always needs someone to write a code.

Hi,

is there any way to make this gem work with the GitHub - alexarch21/history-explorer-card: A card for Home Assistant Lovelace for exploring the history of your entities interactively and in real time.?

I get the following entity data for the history explorer card:

entities:
  - entity_id: "123"

whereas I need something like this:

graphs:
  - type: "line"
     entities:
       - entity: "123"

Any chance I can make a convertion? I saw card_params, but this is not sufficient?

I am trying to set a filter for any entity that has ā€˜iphoneā€™ in the name, while ignoring case. Unfortunately this does not work. How can I filter using a regular expression like this?

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - attributes:
        device_class: battery
  exclude:
    - name: '*iPhone*'  # does work
    - name: '*iphone*'  # does not work
    - name: '/*iphone*/i'. # does not work
sort:
  method: state
  numeric: true

Iā€™m trying to use auto entities with ownbee/bootstrap-grid-card: Bootstrap grid in Lovelace UI (github.com) and tried diffrent thing:

- type: custom:auto-entities
          card:
            type: custom:bootstrap-grid-card
          card_param: row
          filter:
            include:
              - domain: light
                area: Living Room
                options:
                  type: "custom:button-card"
                  class: "col-3 col-md-2"
                  template: button_light
            exclude:
              - domain: light
                name: /[Ll]ights/
                area: Living Room

Gives the error: No cards configured
I also tried:

- type: custom:auto-entities
          card:
            type: row
          card_param: cards
          filter:
            include:
              - domain: light
                area: Living Room
                options:
                  type: "custom:button-card"
                  class: "col-3 col-md-2"
                  template: button_light
            exclude:
              - domain: light
                name: /[Ll]lights/
                area: Living Room

Gives the error Unkown type encountered: row, Is there a way to get this to work to fill the columns within the bootstrap row?

I want to use wildcards with group: as we can with e. g. entitiy_id. How?

Working:

      include:
        - entity_id: binary_sensor.*presence*

Not working:

      include:
        - group: binary_sensor.*presence*

group: seems to only accept exactly one group and lists its entities. I need to list the entities of several groups, all sharing a similarity in their name. Thatā€™s what I want to take advantage of.

I know one or two workarounds (like adressing the entities of all those groups manually or just listing all single groups by their name etc.) but those are not smart at all.

Why not create a group of groups and use that?

Not smart at all too.

  • Will need to maintain an additional, totally useless group manually
  • Just for auto-entities
  • Not sure if it would even work cause the groupā€˜s entities would be groups (children) but I want grandchildren

No Iā€˜m not going that path. auto-entities should have that power.

No-one said it would be easy. :wink:

Well, itā€™s an open source project, so fee free to submit a PR. :wink:

Not necessarily. You can use automations to dynamically update groups

1 Like

Nice idea. But again an additional step and a workaround for a lacking feature in auto-entities :slight_smile:

I agree that this would be a nice new feature, but since the addon is someoneā€™s side project, I donā€™t expect it to be released soon. So if you are in need of a solution you should pick any workaround with the least friction. Which workaround that is, is a personal preference.

1 Like

I tested my assumption: I was right. Having

  • group containing
  • other groups
  • which contain entities

and using the root group as include filter (group: binary_sensor.root_group) will only list the root groupsā€™ entities - which are the other groups. Not getting the grandchildren that way. So that workaround is a dead end.

Iā€™ve got around 20 Ring security sensors and they each have 4-5 entities each:

  • state
  • tamper status,
  • battery level,
  • ā€œinfoā€,
  • bypass mode.

Iā€™m to use auto-entities to do a device filter for *Ring*Sensor* and get all the entitiesā€¦ but Iā€™m getting 80-100 individual entities which is a bit intense.

Is there a way to use this Lovelace plugin to fetch all Ring sensor entities AND group entities from the same device into one row/item? Maybe using multiple-entitity-row?

I can understand @e-raser s thought on it belonging to the functionality already, given Thomasā€™ own documentation on GitHub - thomasloven/lovelace-auto-entities: šŸ”¹Automatically populate the entities-list of lovelace cards

Any filter option can use * as a wildcard for string comparison

Given that, I suppose an Issue on the repo is in order, maybe Thomas can explain, or fix.

on expanding the nested groups: FR: Add expand on nested groups (lights, switches etc) Ā· Issue #268 Ā· thomasloven/lovelace-auto-entities Ā· GitHub

1 Like

@luisleonardo.pt Could you share your code? Iā€™m interested in doing the same thing?

As a side note, I found the interface choking on entering direct YAML for my card (specifically on the regex).

I wrote the code up in a separate editor, copy-pasta-ed into the field and saved it. The same exact thing that I keyed into the interface and did not work, now works without a problem.

Auto-entities card displaying battery status:


type: custom:auto-entities
card:
  type: entities
  title: Button cell battery status
filter:
  include:
    - name: /.*?[Ss](ensor|witch)\d.*?([Pp]ower|[Bb]attery)/
sort:
  method: state
  reverse: false
  numeric: true
show_empty: true

Does anybody know of a way to simply create a vertical list of areas with any of the stock cards?

image

The left most column should simply list the areas nameā€™s rather than the full sensor name (here just as place holder a glance card).

type: horizontal-stack
cards:
  - type: custom:auto-entities
    card:
      type: glance
      show_state: false
      show_icon: false
      columns: 1
    filter:
      include:
        - entity_id: sensor.eq3_temp*
      exclude: []
  - type: custom:auto-entities
    card:
      type: glance
      show_name: false
      show_icon: false
      columns: 1
    filter:
      include:
        - entity_id: sensor.eq3_temperature*
      exclude: []
  - type: custom:auto-entities
    card:
      type: glance
      show_name: false
      show_icon: false
      columns: 1
    filter:
      include:
        - entity_id: sensor.xiaomi_temperature*
      exclude: []
  - type: custom:auto-entities
    card:
      type: glance
      show_name: false
      show_icon: false
      columns: 1
    filter:
      include:
        - entity_id: sensor.xiaomi_humidity*
      exclude: []

Meanwhile I found it !
For people looking for an example of mushroom integration, he is mine :

type: vertical-stack
cards:
  - type: custom:mushroom-title-card
    subtitle: Batteries
  - type: custom:auto-entities
    sort:
      method: state
      numeric: true
    card:
      type: entities
    filter:
      include:
        - entity_id: '*battery_level*'
        - attributes:
            device_class: battery
            state_class: measurement
          options:
            type: custom:mushroom-template-card
            primary: '{{ states[''this.entity_id''].attributes.friendly_name }}'
            secondary: '{{ states[''this.entity_id''].state }}%'
            icon: >-
              {% set battery_level = states['this.entity_id'].state |float(0) %}
              {% set battery_round = (battery_level / 10) | int(0) * 10 %} {% if
              (battery_round >= 100) %}
                {{ 'mdi:battery' }}
              {% else %}
                {% if (battery_round > 0) %}
                  {{'mdi:battery-' ~ battery_round}}
                {% else %}
                  {{ 'mdi:battery-alert' }}
                {% endif %}
              {% endif %}
            icon_color: >-
              {% set battery_level = states['this.entity_id'].state |int(0) %}
              {% set battery_round = (battery_level / 10) | int(0) * 10 %} {% if
              (battery_level >= 50) %}
                {{ 'green' }}
              {% else %}
                {% if (battery_level > states('input_number.number_batterij_drempel') |int(0)) %}
                  {{'orange'}}
                {% else %}
                  {{ 'red' }}
                {% endif %}
              {% endif %}
            tap_action:
              action: none
            double_tap_action:
              action: none
      exclude:
        - attributes:
            friendly_name: '* Battery Level'
      sort:
        method: state
        numeric: true

2 Likes

why use the icon template? youā€™ve selected the device_class: battery, which does that for you
or doesnt the mushroom card show the core device_class? (asking since I dont use the Mushroom cards)

If you donā€™t specify an icon in a mushroom template card, none will be displayed