I’m a beginner in Home Assistant, I have no idea what is or isn’t standard, I was hoping that “state color” would came with a way of stating the color
I’ve never modified the theme. Could I use that, then? Define blue for colors under 15°C and orange above or something like that.
Otherwise, I’d be happy if I could change the icon depending on the temperature. I assume the heading card doesn’t allow that but maybe I could template a sensor that has an icon defined by its state??
(Again: I’m a beginner, and an idiot, I have no idea if that’s possible)
For numeric sensors, only a “battery” device_class has supported coloring & thus partucular colors (but not thresholds) can be defined in a theme.
Means - coloring for other numeric sensors should be done by other ways like card-mod/custom-ui.
Not sure custom-ui supports the colors in the Header card (havent tested it myself yet, I dont use the header badges because they are invisible in a dark theme…)
It will probably customize icons, because icons are supported on the entity in core HA. But template entities also support icon templates in core.
If it doesnt customize the icon_color, it probably wont in the future and Ive written this about its future and hope to phase it out.
Unless someone will provide working PR’s, thats about it for custom-ui.
Our hopes should be on core state-colors first, and if not, card_mod…
UPDATE
Well, as it stands, Custom-ui seems to be broken in HA 2024.10 even, so no luck there at all I am afraid.
I’d welcome and appreciate a fix (wee did that before and mostly is was simpler than anticipated, so not al all impossible), but for now the end has come sooner than I expected…
As I said, only “battery” class supports colors. Probably some other classes should have color support as well. As for temperatures: consider “sensor.indoor_temperature” & “sensor.cpu_temperature” - both may have “device_class: temperature” but different levels for “cool” & “hot”.
it’s a bit odd you mark your own post as solution to the ask you had,
about state color and temperature, while your simple and regular template sensor only sets an icon…
you really should check out all the available state-colors which is a lot more than just battery-colors.
it doesnt fix your particular request, but my test headers are rather colorful using the many available domains and colors set in the theme, default or custom
“card-mod or custom-ui” is not much of an explanation but you’re right, it’s a solution. I’m not implementing it because I try to limit custom components as much as I can but I’ll keep it in mind
thing is, I don’t think I should pursue because I really want to phase out custom-ui.
If newcomers install it, and start modding there heading badges, and we need to support all that, the end is not in sight…
My hopes are up for card-mod, and some adaptation there, if builtin state-classes don’t suffice.