Is it possible to do styling on the elements in the picture-elements
lovelace card based on the state of an entity?
See below example, I want the state-label
to be red when the state is not equal to ‘home’.
This question is also for the image
, because it only supports ‘state_filter’, where I need a ‘state_not_filter’ or something like that:
- type: picture-elements
style:
overflow: hidden
image: /local/images/my_person.png
elements:
# Image
- type: image
entity: person.my_person
image: /local/images/my_person.png
tap_action:
action: more-info
state_filter:
"not_home": blur(5px)
# State Label
- type: state-label
entity: person.my_person
style:
left: 0
bottom: 0
pointer-events: none
font-size: 16px
line-height: 24px
color: white
background-color: rgba(0, 0, 0, 0.3)
width: 100%
transform: initial
padding: 0 8px