Lovelace: Attributes card / entity row


#1

Attributes card

Attributes are not that popular because they are hidden inside more info dialog and harder to display. This card aims to simplify it for things like package trackers & other sensors that have more attributes to bring those attributes forward on the main page.

enitty-attributes-card

attributes-in-entities

You can find the code here

Instructions

The instructions are also found on the above repo.

  1. Download entity-attributes-card.js
  2. Place the file in your config/www folder
  3. Include the card code in your ui-lovelace.yaml
resources:
  - url: /local/entity-attributes-card.js?v=2
    type: js
  1. Write configuration for the card in your ui-lovelace.yaml

Example

- type: custom:entity-attributes-card
  title: Attributes Card
  heading_name: List
  heading_state: States
  filter:
    include:
      - key: climate.hvac.*
      - key: media_player.bedroom.app_name
        name: Application
      - key: media_player.bedroom.media_title
        name: Media center
      - climate.heatpump.current_temperature

How to embed this inside entities card:

screen shot 2018-07-09 at 13 47 38

- type: entities
  title: Entities card
  entities:
    - media_player.bedroom
    - type: custom:entity-attributes-card
      entity: media_player.bedroom
      filter:
        include:
          - media_player.bedroom.app_name
          - media_player.bedroom.media_title
    - sensor.short_name
    - sensor.battery_sensor
  1. Reload your Lovelace tab (no need to restart Home Assistant or other things) and you should see the card.

#2

Nice. I was only wondering yesterday if something like this was possible yet when I was looking at an entity with some hidden values in an attribute that I really wanted to expose to the UI. Will give it a go when I get home!


#3

You can check dev branch for goodies. I will update post once I merge to master.

Now you can name attributes and have them from multiple entities


#4

Would you be able to have an all attributes list? (perhaps with excluded attributes?). This is because I have some sensors that have a varying number of attributes with unknown value and unknown attribute names.

James


#5

It’s best to just to use the monster-card and filter on the unknown for state or attribute values if you know which attributes.

I am not sure of your actual use case, but try monster card first.


#6

Thanks. I’ve posted on the monster card thread. I can’t figure out how I would do what I’m trying!


#7

i am trying to add this card to my love lace, and it looks like the card loads correectly, but i am not bale to configure it correctly. What i am trying to do is to get battery_level from my motion sensors.
Preformatted text
- type: “custom:entity-attributes-card”
entity: binary_sensor.1_hall_switch
attributes:
- “battery_level”
This is the config in the lovelace_ui file, and the error i get in the ui is:
Cannot read property ‘include’ of undefined

What am i doing wrong?


#8

The docs in the original post is out of date. Use https://github.com/ciotlosm/custom-lovelace/blob/master/entity-attributes-card/README.md until I fix that


#9

Thanks that did it