I am trying to get my mdi icons to change color (or appear and disappear or change the icon itself) based on the state.
There is so much information on the forum here, but nothing seems to work.
This is what I have now…
type: picture-elements
elements:
- type: icon
icon: mdi:motion-sensor
entity: binary_sensor.zolder_motion_trap_beweging
style:
top: 65%
left: 16%
border: 0px
state_color: false
card_mod:
style: |
ha-card {
--state-binary_sensor-on-color': green;
--state-binary_sensor-off-color': red;
image: /local/pictures/floor2.png
The icon stays black.
What is the right way to:
- Change the color for a binary sensor?
- Change the icon itself for a binary sensor?
- Change the color for a light (preferably based on the color of the light itself)?
- Change the color based on a numeric (of text) value?