I would like to display the status of a switch (I don’t want to be able to power it on/off), but I would still like to have a different icon-color dependent on the state. For this, I have created the following sensor:
The sensor is working, but the color doesn’t change. I have tried many different variations I found in the forum, but none of them is working. Any ideas?
If you already use a template sensor, then it’s typically easier to do everything in one place (instead of doing some things through customisation).
There is a much simpler solution (if you do not insist on the particular colour change): Create a binary template sensor, and pick a suitable device class. That way, the icon automatically changes colour, and you have a nice icon, and it’s much easier to use this binary sensor state for example in automations.
Thanks for your hint, the binary template sensor - solution sounds good, but I can’t get the current state of my switch… with the regular sensor, the above sensor was working, but with the binary sensor, the state is always stays off, even when the switch is on.
Do I have to change the “value_template” - part to something else? I also tried “value_template: switch.steckdose_wohnzimmer” and some other variations, but it’s not working…
Is anyone else having issue with the binary sensor color state no longer changing yellow? All my binary sensors remain the same color regardless of state (i.e. open/closed, motion/none, on/off, etc). State icon changes appropriately. HA version 106.2