2022.12 Color states are broken/unusable

Thanks to others for doing the hard work. I’ve done a bit of tweaking to include descriptive colours and also remove the duplication for light and dark modes. Also for those who are not familiar with using themes and to try and summarise everything into one place, here are some hopefully simple instructions that everyone should be able to follow fairly easily and save having to read the entire thread if just looking for as close as I feel we can currently get to a solution. Note, as far as I can tell, certain things can’t be reversed currently e.g. locks are only coloured when locked and not when unlocked as there is no state-lock-unlocked-color to set it to amber and there is no state-alarm-disarmed-color to set it to green.

Place the following in configuration.yaml:

frontend:
  themes: !include themes.yaml

For 2022.12.0 to 2022.12.3, create a themes.yaml file in your config directory and copy the following into it. For 2022.12.4, see the updated themes.yaml contents here.

Classic:
  state-default-color: '#44739E' # Blue-Grey
  state-alarm-armed-color: '#F44336' # Red
  state-alarm-arming-color: '#FF9800' # Orange
  state-alarm-pending-color: '#FF9800' # Orange
  state-alarm-triggered-color: '#F44336' # Red
  state-alert-color: '#F44336' # Red
  state-automation-color: '#FFC107' # Amber
  state-binary-sensor-color: '#FFC107' # Amber
  state-binary-sensor-alerting-color: '#F44336' # Red
  state-calendar-color: '#2196F3' # Blue
  state-camera-color: '#2196F3' # Blue
  state-climate-auto-color: '#4CAF50' # Green
  state-climate-cool-color: '#2196F3' # Blue
  state-climate-dry-color: '#FF9800' # Orange
  state-climate-fan-only-color: '#00BCD4' # Cyan
  state-climate-heat-color: '#FF5722' # Deep Orange
  state-climate-heat-cool-color: '#FFC107' # Amber
  state-climate-idle-color: '#BDBDBD' # Disabled (Light Grey)
  state-cover-color: '#9C27B0' # Purple
  state-fan-color: '#00BCD4' # Cyan
  state-group-color: '#FFC107' # Amber
  state-humidifier-color: '#2196F3' # Blue
  state-input-boolean-color: '#FFC107' # Amber
  state-light-color: '#FFC107' # Amber
  state-lock-jammed-color: '#F44336' # Red
  state-lock-locked-color: '#4CAF50' # Green
  state-lock-pending-color: '#FF9800' # Orange
  state-media-player-color: '#3F51B5' # Indigo
  state-person-home-color: '#4CAF50' # Green
  state-person-zone-color: '#2196F3' # Blue
  state-remote-color: '#2196F3' # Blue
  state-script-color: '#FFC107' # Amber
  state-sensor-battery-high-color: '#4CAF50' # Green
  state-sensor-battery-low-color: '#F44336' # Red
  state-sensor-battery-medium-color: '#FF9800' # Orange
  state-sensor-battery-unknown-color: '#BDBDBD' # Disabled (Light Grey)
  state-siren-color: '#F44336' # Red
  state-sun-day-color: '#FFC107' # Amber
  state-sun-night-color: '#673AB7' # Deep Purple
  state-switch-color: '#FFC107' # Amber
  state-timer-color: '#FFC107' # Amber
  state-update-color: '#4CAF50' # Green
  state-update-installing-color: '#FF9800' # Orange
  state-vacuum-color: '#009688' # Teal
  modes:
    light:
      state-default-color: '#44739E' # Blue-Grey
    dark:
      state-default-color: '#44739E' # Blue-Grey

I have changed the colour of state-lock-locked-color from red to green on my latest edit, as, for me at least, it makes more sense to be green than red, indicating all is OK and it’s locked.

As with all the colours you can copy and paste them to each variable to suit your needs. e.g. if you want covers to no longer be the new Purple colour and the default Blue-Grey, change state-cover-color: '#9C27B0' # Purple to state-cover-color: '#44739E' # Blue-Grey. As mentioned previously, we can’t quite revert everything to exactly how it was before, but this does allow us to get pretty close and certainly to a more useable state, in my eyes at least.

Next, create a new automation to load the Classic theme on startup for all users:

# Set the default theme to Classic
- id: A550734A-8AAC-4436-AF15-8193FAF984D5
  alias: "System: Set default theme to Classic"
  trigger:
    - event: start
      platform: homeassistant
  action:
    - service: frontend.set_theme
      data:
        name: Classic
        mode: light

Subsitute dark into the automation in place of light if you would rather have dark mode set. Note you may also need to set your theme to Backend-selected in your profile if you have changed this previously.

Lastly, restart Home Assistant.

Also, for easy reference, I’m duplicating here a couple of useful links to the state entity colours and state entity colour variables.

51 Likes

If you don’t mind keeping that post updated, I’ll mark it as a solution for people who don’t want to read the whole thread.

7 Likes

Sounds like a plan. I’ll try to keep it updated if anything further comes up. I’m following the thread closely. :slight_smile:

1 Like

I have also came to conclusion that the best will be to use some custom themes. Many thanks for this one as it is not that obvious how to get the yaml file for the standard theme :slight_smile: We’re back in the good accessibility of the frontend!

Hello.

In the coming days, I will propose a guide to upgrade your theme to the new variables and I will list all the new supported variables so you can use them without any worry. I just don’t want to write it too quickly because there are a few variables to adjust using your feedbacks.

We’ve been stuck for years with unofficial theme variables using --paper-item things. We want to propose a better way to theme things, officially supported.

I try to read feedbacks, ignore non-constructive complaints and do PRs to fix things as much a possible. :slightly_smiling_face:

32 Likes

That would be appreciated. Could we also have variables for e.g. state-lock-unlocked-color and state-alarm-disarmed-color at some point in the future, as it seems a bit strange that we can’t set a highlight/alert colour when the lock is unlocked, unless I have missed something.

2 Likes

And is this sustainable with custom themes and when new updates are released ?

There are discussions about alarm/lock on Github :wink:
It’s not an easy subject as a lock can be viewed a secure device (lock is the active state) or an alerting device (unlocked is the active state in this case).

2 Likes

If it’s documented, it will be sustainable.

2 Likes

This is awesome, thanks for this work ! :+1:

But the covers are still purple, is it intentional ?, because there weren’t before 2022.12.
So although it’s now close, I wouldn’t call this a total workaround (yet).
No big deal, I’m just nit-picking :wink:, I’ve already modified it, and I’m happy now…

It worked! Just have to adapt the right color and it looks like before! Thanks a lot!

1 Like

Can you give some explanations and details, Paul? Would really appreciate it.

Until now I heard only here and there that is might be because … or that it is said (where, from whom) that some things … But not really the technical background.

Just subsititute whatever colours you want for each device type. It’s still a bit of a work in progress as I spot devices that are the wrong colours. You can put the Default colour for each device type if you want. I will update the post with this information.

1 Like

Yes, so just change the cover color to whatever you want

state-cover-color: '#9C27B0' # Purple

You can see the answer directly from paul here: I dislike the 2022.12 Color changes - #46 by Mariusthvdb

No. I can’t. This is only about color names (what I didn’t ask), not why it is now without rgb(), etc. (what I asked in my post).

Has been discussed here (the same link was already posted some comments further up here): Inconsistency with defining colors in a default theme · Issue #14666 · home-assistant/frontend · GitHub

Yes, exactly this. I’ve updated the post to explain this in more detail.

1 Like

That would be great! Would you also mind writing it for those of us who haven’t the first idea of themes so the ones we have downloaded, we can update? :smiley:

You missed the point, I know that obviously, I was just saying that this was not a “Classic” theme is the covers are purple, so asked if this was an error or intentional…