Display Attribute Value for Entity on Card

Hi,

Got a couple integration with entities that have several attributes. Some of the attribute info I want to display on a card. I have tried the following which does not work.

Hoping not to have to create individual template sensors to extract values.

type: entities
title: Device Info
entities:

  • entity: sensor.my_device
  • type: attribute
    entity: sensor.my_device
    attribute: battery_level
    name: Battery Level

Check out this if you have HACs installed

  1. Please format your posted code (place it in triple “`” backticks).
  2. Should work:
type: entities
entities:
  - entity: device_tracker.demo_anne_therese
    type: attribute
    attribute: battery
    name: xxx

Check if you defined a proper name of the attribute.

Of course, same could be with multiple-entity-row proposed above:

type: entities
entities:
  - entity: device_tracker.demo_anne_therese
    type: attribute
    attribute: battery
    name: xxx
  - type: custom:multiple-entity-row
    entity: device_tracker.demo_anne_therese
    attribute: battery
    name: xxx
  - type: custom:multiple-entity-row
    entity: device_tracker.demo_anne_therese
    entities:
      - attribute: battery
        name: xxx

thanks - I ended up doing the multiple-entity-row after digging through the forums and Redit. Doubt this is case now, but is it possible to get a sub attribute? Another words, I get Networking info for my Pi’s, but could I narrow focus so I only get mac address? If I had to do a couple template sensors just for that I am ok with. What I wanted to avoid doing template sensors for all of them.

If same can be done by a stock card - no need to use a custom one.

Create a template sensor.
Or use a custom card which supports jinja/JS - like a template-entity-row.