I wanted to share what I have done with slate regarding HA release 2023.2. This is mostly a personal preference, but it should give one an idea of how to make changes themselves if they so desire.
Home Assistant’s “State Color” scheme came out in 2022.12 and after much discussion, it was redone in 2023.2 and with it, more theme variables are now official. These variables are related to coloring icons based on their state (on/off, etc), their domain (light, switch, cover, etc.) and even their device class. The state color scheme applies to Lovelace cards that have their state_color
set to true.
However not everyone likes some of the default colors and this is where the personal preferences comes in.
I have found that “covers” which are purple when the covers are on, just don’t look good with the slate theme.
Lights and switches are a “yellow” color when on, which is fine with slate, but I wanted them to look like slate’s “accent” color which is more of a gold color.
To make these changes, I have added the following to the end of the slate.yaml file:
# few fix for 2023.2 State Colors
state-active-color: 'var(--accent-color)'
state-light-on-color: 'var(--accent-color)'
state-light-active-color: 'var(--accent-color)'
state-switch-on-color: 'var(--accent-color)'
state-switch-active-color: 'var(--accent-color)'
state-cover-open-color: '#FFFFFF'
state-cover-active-color: '#FFFFFF'
state-cover-shade-open-color: '#FFFFFF'
state-cover-garage-open-color: '#FFFFFF'
Another thing I wanted to share that is outside the scope of the slate theme, but is related to icon colors…
If you have colored lights, when they are set to white, the HA light bulb icon will also be white. When a non-colored light bulb is on, it is set to state-light-active-color
which is not white, it will be either yellow (default), or slate’s accent (if using my changes above). Some people like it this way, but I thought this to be inconsistent. There is not anything that can be done in slate.yaml
, but I found a solution I thought I would share. First, you have to use Card Mod for this solution. Card Mod allows one to override the style
of a lovelace card, and with a little bit of work, one can set icon colors, and in particular if a colored light is set to white. With my Lovelace Entities Card, for each entity that is a colored light, I have set the style as follows:
type: entities
entities:
- entity: light.my_colored_light
card_mod:
style:
hui-generic-entity-row $ state-badge $: |
ha-state-icon {
{% if is_state(config.entity,'on') and state_attr(config.entity, 'hs_color' )[1] <= 10 %}
color: var(--state-light-active-color) !important;
filter: none !important;
{% endif %}
}
title: TITLE OF ENTITY CARD
state_color: true