Automatically add 'battery' entities to dashboard

Try integration:<your other integration identifier> and see what you get.
I’m wondering if it’s something to do with the entity being in 2 different integrations…

1 Like

I think that might be the problem in that custom:auto-entities seems to have an issue with the order that HA returns the integrations containing the entity.

If I change my filter to include integration: mqtt I only see 2 entities and in the previous screenshot, the majority of battery-notes entities are also in MQTT.

Confirmed - auto-entities seems to only see the first integration for the device, and may not be what the UI displays alphabetically?

Try integration: homematic(ip)_local (or it might be homematicip_local or maybe homematic_ip_local)

Pop this into dev tools, template to see your integration identifiers:

{% set devices = states | map(attribute='entity_id') | map('device_id') | unique | reject('eq',None) | list %}
{%- set ns = namespace(integrations = []) %}
{%- for device in devices %}
  {%- set ids = device_attr(device, 'identifiers') | list | first %}
  {%- if ids and ids | length == 2 %}
    {%- set integration, something_unique = ids %}
    {%- if integration not in ns.integrations %}
      {%- set ns.integrations = ns.integrations + [ integration ] %}
    {%- endif %}
  {%- endif %}
{%- endfor %}
{{ ns.integrations }}

If the other integration identifier lists them then use both:

include:
  - integration: battery_notes
      domain: binary_sensor
      attributes:
        device_class: battery
  - integration: <the other integration identifier>
      domain: binary_sensor
      attributes:
        device_class: battery

Another possibility is this note in auto-entities: Many integrations cannot be matched due to Home Assistant limitations
If this integration is one of those then your only choice is integration: battery_notes and if that does not list the missing ones then you’ll have to include them specifically by entity_id or by name

1 Like

@dbrunt You’ve found the reason! By integration identifier homematicip_local I can catch those devises:

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - integration: homematicip_local
      domain: binary_sensor
      attributes:
        device_class: battery
    - integration: battery_notes
      domain: binary_sensor
      attributes:
        device_class: battery
  exclude: []

May I am going to raise an issue for auto-entities card.
Many thanks for your help, I really appreacate your support and persistence!

1 Like