I am using a picture elements card for my floor plan.
In it, I am applying an icon change to my garage doors:
- type: state-icon
entity: cover.garage_door_west
icon: mdi:garage
style:
inset: 7% auto auto 14%
The problem is, when the garage door is open, it simply changes the color of the icon. I would also like the icon itself to change to mdi:garage-open
.
I know I can do this with conditionals:
- type: conditional
conditions:
- condition: state
entity: cover.garage_door_west
state: "closed"
elements:
- type: state-icon
entity: cover.garage_door_west
icon: mdi:garage
style:
inset: 7% auto auto 14%
- type: conditional
conditions:
- condition: state
entity: cover.garage_door_west
state_not: "closed"
elements:
- type: state-icon
entity: cover.garage_door_west
icon: mdi:garage-open
style:
inset: 7% auto auto 14%
I’m just wondering if there is a way to do this simpler, where it affects EVERYWHERE I use this state-icon, so I don’t have to program this conditional in every card I use.