Changing icon color based on situation

I know this has been asked many, many times, and that it has many, many solutions. I’ve scoured the net, but every solution I tried didn’t do what I hoped for my specific use case .

I’d like to change the icon color of an entity (including in configuration.yaml template, such as sensors) based on a certain situation/state/input/etc…

And what I’m asking is not changing the color on a card. It’s more like changing the “ON” color of a light from yellow to green, for example.

I’m asking this because a card color change won’t be transmitted to external hardware. I’m using stream deck and I’d like the color change to be sent to it

I know this can be done because of this: .Font color for Entity (custom icons) in "on" state always resets to white · Issue #270 · cgiesche/streamdeck-homeassistant · GitHub

Does anyone know how to achieve this, including using themes, state colors, or anything else, probably at the backend as opposed to the frontend??

P.S. Please bear in mind that I’m not an expert in yaml. I’ve only changed configuration based on tutorials and you guys’ help.

Thanks

Update: I installed Custom UI (not recommended - being phased out) and managed to change the icon color on the dashboard. This change, however, did not translate to Stream Deck

Update#2:
Found the solution, for anyone looking:

  1. Make a yaml file that you can access raw on the web.
    Example: https://raw.githubusercontent.com/cgiesche/streamdeck-homeassistant/refs/heads/master/public/config/default-display-config.yml

As you can see, it displays nothing but the yaml text; no menus; nothing. Make sure you name it “.yml” instead of “.yaml”. I used github for this, and I tell Stream Deck to access the raw github file (hint: github prvides a “raw” tab for files - you can see the link I provided starts with the word “raw”.)

  1. The yaml file you create should include the text shown in the yaml example above. This is the default configuration for Stream Deck Home Assistant plugin as provided by the developer. You can just copy and paste it into the yml file you created.

  2. Edit what you need and save your changes. For this you have to know how yaml works in Home Assistant.

  3. In Stream Deck Home Assistant buttons there’s a field captioned “Custom display configuration URL”; in that field paste a link to the yaml file you created.

  4. Click “Save and reconnect” and you’re done!!

Alternative method :

See this: Customization of Home Assistant plugin in Stream Deck

Solved! See second update in original post above!

Hi,
Thank you for your post. This pointed me to the right direction, but in my case, I am unable to see anything yet.
I put the yml file , I used the example one, and I am trying to show icon of lock when unlocked or locked.
Any help to troubleshoot this?

1 Like

I have the same Issue.

Tried using both local file and github rawfile but I don’t see any changes.

The file is named custom.yml and i select “Prefer icon from plugin”.

Thanks for help!

UPDATE
I deleted everything exept classes on the file making it look like this:
https://raw.githubusercontent.com/Alerico02/HA-Streamdeck-icons/refs/heads/main/customfile.yml?token=GHSAT0AAAAAADAC2UI7L5CSEZ24J4KPFUGCZ6KHOPA

It worked for me, note that it takes a bit of time to load custom icons and colors.

Sorry for the later reply. I don’t login often.

If you want to change the icon itself, you have to edit the yml file that customizes your Stream Deck and choose an icon per state. This, however, will apply to all icons of a certain type, not a specific one. For example, I wanted to change the icons of my sockets, each to represent the specific device it was connected to, but I couldn’t do it.

But what I could do, for example, is change the icon of a turned-off light vs turned-on light. This, as mentioned above, will apply to all lights, not a specific one.

If you need a tutorial on this, please let me know.

Sorry I was late to help, but I’m glad you managed to do it. The customization has some limitations still, but I’m glad we have it and I hope things will only get better in the future.