jcwillox / lovelace-canary

🐤 Adds many useful extensions to lovelace, such as templating secondary info, stacking within a card and more!
MIT License
103 stars 4 forks source link

Nothing appearing #4

Closed zygote279 closed 4 years ago

zygote279 commented 4 years ago

Pretty sure I'm misunderstanding this, but nothing appears to be visible with this code:

entities:
  - entity: vacuum.roomba
    image: \local\images\roomba980.png
    secondary_info:
      attribute: vacuum.roomba.battery-level
      prefix: "Battery: "
      postfix: "%"
  - entity: vacuum.roobot
    image: \local\images\deebot.png
    secondary_info: last-changed
title: Robot Vacuums
type: entities

Can anyone point out what I'm doing wrong here? It's working fine without this part:

    secondary_info:
      attribute: vacuum.roomba.battery-level
      prefix: "Battery: "
      postfix: "%"
jcwillox commented 4 years ago

I don't believe vacuum.roomba.battery-level is an attribute. From what it looks like the entity is vacuum.roomba and the attribute is battery-level. The entity will be extracted automatically from the row (it can be overridden to pull an attribute from a different entity). All you need to do is change it to attribute: battery-level.

This probably isn't relevant but it's also worth noting that the attribute option does not support dot-notation for specifying nested JSON, in your case its literally looking for an attribute with the name (key) "vacuum.roomba.battery-level".

zygote279 commented 4 years ago

Thanks, useful direction - I actually tried this first, but just produces no addition to the UI, code below - anything obvious I'm missing?

Screenshot_20200425-174840

zygote279 commented 4 years ago

Screenshot_20200425-175035

jcwillox commented 4 years ago

Looking at that last screenshot the attribute is not battery-level it's actually battery_level, so try attribute: battery_level that should work

zygote279 commented 4 years ago

Heh, spotted that overnight and tested, still getting no result unfortunately - no errors or anything, just blank!

On Sun, 26 Apr 2020, 00:53 Josh Willox, notifications@github.com wrote:

Looking at that last screenshot the attribute is not battery-level it's actually battery_level, so try attribute: battery_level that should work

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jcwillox/lovelace-canary/issues/4#issuecomment-619456400, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCZW454DGNGAXU4BJ3YJX3RONZXTANCNFSM4MQZFVEQ .

jcwillox commented 4 years ago

Closing as this is an old issue that it appears no one else had. Also I don't believe it's an issue with Canary.

However, this is what the config should look like, note that the attribute is case and character sensitive and must be specified exactly.

entity: vacuum.roomba
secondary_info:
  attribute: "battery_level"
  prefix: "Battery: "
  postfix: "%"