I’ve searched the community pages, the HA-reddit-sub and read whatever google spewed out, but it seems all tricks to use value_templates, customization and whatever to change the color of icons or text, like icon_color or rgb_color, only seems to apply to CustomUI and not to Lovelace. Can anyone confirm that?
What I would like to do is painting the rooms temperature blue/green/yellow/red if it is cold/fine/warm/hot, or a red warning if there is a severe weather alert. But, as mentioned above, all to no avail.
If this isn’t possible with Lovelace, I hope it is on the dev to-do list.
It’s possible but with a custom card that you yourself develop.
Also, if you spend the time, you can make images with color tints. Then use a picture-glance card and change the image based on the state of a sensor. That’s probably the closest “out of the box” solution that you can do without a custom card.
Thanks for pointing me towards card-modder. I got it working without much of a problem, but it paints the whole card - not just one entity.
What I didn’t get is what you mean with filter. Do you mean entity_filters, or state_filters?
What I would like to recreate is the behaviour of the old ha-floorplan. I used to show all door and window-sensor-icons in green and red, depending on wether they are opened or closed, light-icons in yellow if switched on (as it is now) and dark when switched off, and the temperature (displayed as text) in even more colors, depending on the temperature.
I’ve been playing with a small form of icon colour depending upon state. I use it with icons to show movement and door opening state being returned from my alarm system. Each alarm sensor returns a value ‘T’ for triggered state and ‘-’ when in a non-triggered state.
Thanks, that is exactly what I am doing right now:
As you can see, doors, windows, lights (and motion sensors too) turn yellow if triggered or switched on. That is fine for lights, but for the “alarms” (windows, doors and motion sensors) I would like to have green and red instead. That is something which can’t seem to be done with standard Lovelace, as it seems.
Don’t think that is possible yet, at least I’ve not come across any of doing it. Only other option I can offer is the setting of the initial state, but that would still leave the ‘on’ state as yellow.
The off state colour can be set using the style colour setting in the ui card definition
The state-icon worked for me. Is it also possible to change the normal icon to another color.
I use them with a tap action to navigate to another screen.
Hi tiimsvk, sure we can try.
What Picture Element are you using, state_icon or state_label, etc.?
What exactly do you want to change color on, only the icon or the text?
Placing whole picture-elements card inside a config-template-card (CTC) - not a good way.
Place a particular element inside CTC instead.
Also, using CTC for CSS styling - not good at all; better to use card-mod dynamic variable inside a native “style” option.