Beginners Question: Very simple status display change does not work

Dear all, sorry for the may be very silly question. Coming from OH3 I’m new here.
Installation, integration of all the shelly, sonos and so on worked fine.
But, trying to show the status in a scenario was not successful. After searching online for hours…

My problem:
Simple mains switch. Color should change dependent on the status.
But, whatever I do, the color does not change. What is wrong?
I already tried Upper and Lower case and may other things.

type: button
entity: switch.zb01_switch
name: ZB01 Steckdose config
state:
  - value: 'Off'
    color: red
  - value: 'on'
    color: green
show_name: true
show_icon: true
tap_action:
  action: toggle
show_state: true
icon_height: 50px
hold_action:
  action: none
icon: mdi:power-plug

Thanks in advance, I have no idea left…

built in home assistant cards only allow color changing through themes. So, in order to adjust color based on state, you change your theme. Otherwise, if you want to change the color of single entities in a specific spot in your UI, you have to use something custom. Like cardmod, or custom:button-card.

From what I can tell with your current configuration, you’re actually applying custom:button-cards configuration on the built in button card. That won’t work. You probably just want to incorporate custom:button-card.

1 Like

Hello Petro,
Many thanks!!
That helps a lot.

Regards