An easy way to display attribute IDs for an entity?

I’m using Battery Notes to display battery levels.

It reports a bunch of attributes for each entity, like this:

image

I’m trying to configure a filter in auto entities to exclude devices with ‘Unknown’ battery level.

Is there an easy way to poll HA for the attribute IDs (ie those in the format the ‘machine’ understands and not the human-readable values they’re reported as here)?

I’ve seen attributes in the format attribute.* before but …I don’t know how to derive that data from a list like this.

If your devices are all the same brand and connected the same way, you can use the Home Assistant Developer Tools:

Then click on states at the top and search for your entity, it will show you the machine id of the attribute under the attributes section (circled):

Why do you need to access an attribute, from what I can see the state of the sensor will be unknown? Which attribute do you want to base the card on?

Based on just the integration, it’s entities, and undesired state you could use either of the following configurations.

Using include/exclude filters:

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - integration: battery_notes
      and:
        - entity_id: '*_battery_plus'
  exclude:
    - state: unknown
    - entity_id: '*_low'

Using Template filter:

type: custom:auto-entities
card:
  type: entities
filter:
  include: []
  exclude: []
  template: |
    {{ integration_entities('battery_notes')
    | select('search', '_battery_plus')
    | reject('search', '_low')
    | reject('is_state', 'unknown')
    | list }}