Change closed garage color…

Locks & Alarm are green when in locked / armed mode while garage is blue in closed mode. Also alarm is blue in disarmed mode. This creates confusion while doing a quick view on a phone screen. How do I change garage to green in closed mode.

Home Assistant

  • Core2024.4.0
  • Supervisor2024.03.1
  • Operating System12.1
  • Frontend20240403.1


i don’t believe you can do this with the standard button cards that you are using (someone else may correct me, but i don’t know how).

however you should be able to do it using the custom button card. take a look here… here’s a link to the specific section that tells you how to do just what you’re asking:

Thanks for your input. Sorry for being a noob.
I’m trying to build garage card based on your input but may need a little more input.

Hi, as stated in How to help us help you - or How to ask a good question → Format it properly please use YAML code instead of pictures.

this card is not part of ha by default. you can get it via hacs.

Take a look at the installation instructions here. Don’t do the manual installation. Follow the hacs one

@armedad Here is how you can change the color on the standard button card. I don’t have a garage door cover but this should work for @HAUZER

show_name: true
show_icon: true
type: button
tap_action:
  action: toggle
entity: cover.bed_curtains
show_state: true
card_mod:
  style: |
    ha-state-icon{
    {% if is_state(config.entity,'open') %}
     --state-color: red !important
            }
    {%else%}
     --state-color:green !important
    {%endif%}
         }
    
1 Like

ah, yes, using card_mod hacs extension.

is there a good list of all the --state-* that are settable? or a good method to find them out? I tried once to reverse engineer it by using chrome inspector to find the css element of an icon, but that was a bit of a rabbit hole (or I did it wrong)

I used Chrome’s inspector to isolate the icon’s definition inside the shadow-root
You can also see that the color is defined as style=" --state-color:

As you add additional edits to the style it can get more complicated than what I just described.

1 Like

that deserves to be a community guide.
i dunno why, but getting the right css to mod isn’t fluid to me yet.

Well, you tackle automations really really well and I’ve used quite a few of your posts as learning lessons!