Hi,
Noob question - I’m using custom button card, and I cannot for the life of me change the background colour of a card based on its state being either on or off. I feel like this is a really easy thing to do, but I have been searching and searching and I cannot work this out.
This is what I have so far, but I’m really struggling to understand when to put a dash or not, so that may be the issue too.
Any help would be really appreciated. Thank you
show_name: true
show_icon: true
type: custom:button-card
state:
- value: 'on'
color: red
styles:
card:
- background-color: orange
- value: 'off'
color: blue
styles:
card:
- background-color: green
tap_action:
action: toggle
entity: switch.sonoff_1000c0d660
name: Hallway light
theme: noctis