So, I’m trying to have a picture change, depending on the state of a binary sensor…
this is the Lovelace configuration (without the rest of the card, because it would be too much - and everything else works fine):
type: picture-elements
image: /local/background.png
name: Name
elements:
- type: image
entity: sensor.binary-sensor_01
image: /local/picture_on.png
style:
top: 35%
left: 69%
width: 11%
state_image:
'off': /local/picture_off.png
if I use a switch as the entity, it works just fine - if the device is on, it shows picture_on.png
, if it’s off, it shows picture_off.png
however, if I use a sensor as the entity its just grey and always shows picture_on.png, no matter what state it actually is - if I change state_image: 'off':
to ‘unavailable’, it shows picture_off.png - even though the sensor is on
what am I doing wrong?!