lovelace-multiple-entity-row
lovelace-multiple-entity-row copied to clipboard
Colored icons for attributes
I have defined the list of the entities as attributes, each one represented by an icon.
Since they are all binary attributes, I would like each icon colored based on the value of the attribute itself.
Currently, all the icons are colored based on the main entity state.

- type: 'custom:multiple-entity-row'
name: Front Door
entity: binary_sensor.front_door
show_state: false
secondary_info: last-changed
entities:
- attribute: alarm
state_color: true
icon: 'mdi:bell'
- attribute: bypass
state_color: true
icon: 'mdi:shield-off'
- attribute: lowbatt
state_color: true
icon: 'mdi:battery-alert'
- attribute: fault
state_color: true
icon: 'mdi:alert'
Would it be possible?
Here's a mockup of what I'd like to achieve (2nd attribute is ON, all other attributes are OFF):

What do you think @benct ? Any chance to have this feature?
Has anyone figured out a way to work around this?
An attribute does not have a type and a device_class, so it's not currently possible to define its state. I think new properties should be added in the configuration for the purpose. An option could be to create a template entity whose state is calculated from the attribute, and use this entity in the card.
Could we perhaps have an option for state_template? That would allow us to define a template that, when true, would indicate an "on" state.
That could be an option, although templates are not supported by the card. Consider the solution with the separate template entity already works now, though defining all the needed template entities might not be very practical (it depends on how many you need)
@stezak77 Right.
I already have a REST sensor which queries my Hyperion server, and a template sensor that organizes my needed values into sensor attributes.
I only use six attributes in this way at the moment, which in this instance only means six new switches for my card... but I could easily see a more complex usage of this row leaving my entities cluttered very quickly.
I've done as you suggested, and it does work for my situation, as well as giving me the opportunity to make those icons interactive via a REST command. While this is a somewhat reasonable workaround, it would be very much more convenient to have an actual solution.
Thanks for the help! I've got it working the way I wanted now anyways 😁