I change the color of the picture elements according to the status in the card.
In the style, just add an ha-card and deifine a new variable.
This is working well for me.
I usually thought bout starting a new/own feature request based on
As I found this topic and even it has a slightly other approach (doing stuff in YAML), I would like to show my idea (doing it in the UI which is more the modern HA way of doing things) here too:
Allow to change entity icon based on entity state (binary sensors)
For binary sensors this should be quite easy:
field “icon for state on”: mdi:led-on
field “icon for state off”: mdi:led-off
In a next iteration the “state” needs to be user defined, e. g. “15” or “running” etc.
As mentioned in Change entity icon based on state this already is implemented in the backend for sensors with supported device class, e. g. binary sensors like door, window etc.
This feature request is about bringing the config options for this to the UI allowing users do define this on their own.
Thanks for linking. All those are based on entities with two states, with
we could use an almost endless list of states and corresponding icons. Why only limit to two states (which of course would fulfill likely 95 % of all requirements as read so far)? Going that extra mile would create a very powerful customization option.
Searched a lot and this seems to be the right place to ask. Is there nowadays a straightforward way to have colored entities for values like e.g. (I mean without addtional coding).
Temperature:
Below 0 Celcius blue and above red with gradient from blue to red, the hotter the more red?
I mean the value (state) of the entity in lovelace.
I have now a long list of temp sensors and like to see them in colors.
Wondering if someone can help. I have created a “navigation” button that switches to another dashboard where I can control my lights. See the pictures attached.
What i am trying to achieve is that the living zone icon should be grey when all of the light entities are off and a different colour when any of the light entities are on.
Easiest solution I think is to make a light group from those lights. It will have a binary state according to your preferences afaik, so you could use that as the state entity for your button.
I’m trying to color list of the devices, if I use sensor.*_voltage - it works for all card but I need to exclude device which I don’t need to display. If I use exact list of the devices and style, just one device colored, can you assist?
I have Mushroom chip for my internet connection. I’d like it to be green if connected and red if not. Is there an easy way to do this or is it dependent on coding or style sheets with card-mod?
since this older topic still lives, I am posting here to let you know we released 2 new versions of Custom-ui that let you use And customize and attribute icon_color.
custom-ui: the most complete version allows for templating to those icon colors. these templates are in JavaScript.
custom-icon-color: only provides that attribute so you can use it in the customize section.
both will allow you to use an attribute icon_color in template: entities, and then use regular Jinja in those templates
there is also support for the entity and button card, and we’ve started working on the Tile-card, but that still needs some work.
while at it, we’ve also released a new plugin:
custom-more-info, developed by @elchininet , and this allows you to control what is displayed on the More info panels of any entity.
(originally in custom-ui to hide the templates it set, but now fully fleshed out to control anything from history and logbook, to any attribute you might want to filter. Or unfilter from HA frontend default filters.)