I’m not sure you can set the unavailable color for a specific domain. Looking through the ha-styles.ts
file referenced on the Home Assistant Frontend page, I only see references to a general state and history unavailable option. The state one is state-unavailable-color
.
To answer my own question this works in a theme to change the colour away from transparent:
history-unavailable-color: '#bdbdbd'
Thank you, I discovered the same just as you were replying.
Just updated t0 2023.2.4 and the stock Light card is still not fixed.
Even though the multiple issues on GitHub relating to this are closed by @piitaya.
This is preventing me moving to 2023.2.x on my production system.
When we will we see this feed through to an update?
Thanks
might have overlooked in all possible options now, but dont we have some default ‘alert’ color anymore, now we have
--state-binary_sensor-carbon_monoxide-on-color: var(--red-color);
--state-binary_sensor-gas-on-color: var(--red-color);
--state-binary_sensor-heat-on-color: var(--red-color);
--state-binary_sensor-lock-on-color: var(--red-color);
--state-binary_sensor-moisture-on-color: var(--red-color);
--state-binary_sensor-problem-on-color: var(--red-color);
--state-binary_sensor-safety-on-color: var(--red-color);
--state-binary_sensor-smoke-on-color: var(--red-color);
--state-binary_sensor-sound-on-color: var(--red-color);
--state-binary_sensor-tamper-on-color: var(--red-color);
seems a system default for those would be very helpful, just in case we dont set these colors individually, but dont want to default to the binary-on color amber.
personally I set mine to state-binary_sensor-problem-on-color: var(--alert-color)
. but doing so for all of them seems a bit over the top if we could set a default alert.
or what am I no seeing now…
heck, its there: frontend/ha-style.ts at e81f596d76fbb02989e8fdfcecc763d3e82b0680 · home-assistant/frontend · GitHub
duh…
or… nope I still have to set
state-binary_sensor-safety-on-color: var(--alert-color)
because state-alert-on-color: var(--alert-color)
doesn’t set those device_classes
so, my question remains… can we not set a default variable for those device_classes.
additional question: what does the state-alert-on-color
do
alert.xyz
is active, while state-alert-off-color
reflects, that an alert is recognised (muted).
sure, but what constitutes as an alert.
Ive established the binary_sensors with those device_class mentions aren’t
wait, is that the integration alert? Alert - Home Assistant
right, I now see your syntax.
that would make sense
1 problem solved. still requiring a generic alert type device_class color variable in that case
Have you already tried
--rgb-state-binary-sensor-alerting-color: var(--rgb-red-color)
no… I havent because that is not documented in the ha_styles. it would be an adequate variable name though:
state-binary_sensor-alerting-color: var(--alert-color)
or
state-binary_sensor-alert-on-color: var(--alert-color)
for that matter.
dont think I tried those, so will do just to be sure…
nope, those wont work… as is to be expected ofc
opened a discussion in the Front repo
It was documented and some of those variables still work (for whatever reason) so it was worth a try.
we should always stick to dev branch…
as --rgb-state
colors have been abandoned completely, I cant see how any of these still work?
unless they are any of these frontend/ha-style.ts at e81f596d76fbb02989e8fdfcecc763d3e82b0680 · home-assistant/frontend · GitHub
A bit of an open question if I can (finding it useful to try and better understand a few things based on points and answers from above and how that is applied in my HA instance).
After a recent update I noted an icon for climate (heat) now changes to a dark orange (and happy to leave as is)! - I can see this is reflected in Front End docs -
Additionally the icon for timer (schedule) operating the boiler here changes (amber) and I’m not wholly sure if this reflect an automation On/Off (ie as there’s no explicit “schedule” entry listed in the front end ha-styles.ts) or schedules are treated differently.
Entity ID for this schedule = schedule.schedule_heating
As I also have a “Boiler Status” entity that reflects status as idle/heat coming from a template (Entity ID = sensor.template_hive_thermostat_running_state) and wonder if there a means to have this icon change colour based on idle(inactive?) / heat(active?) - noting that there is currently no reference to sensor.template (or templates) in the above Front End ha-style.ts link.
I’d imagine that we can expect many more developments with regard to colours and I’ve been somewhat intrigued in the recent developments since 2022.12 and perhaps only just beginning to tap into (ever expanding) capabilities; and learning more by trial & error.
OK - I can see schedule is defined (as a domain) within :- Home Assistant Frontend - Home Assistant
just so you are aware, you linked an older version and should be looking at frontend/ha-style.ts at de5199e34c4864482963c689879a712628067308 · home-assistant/frontend · GitHub
if schedule is a domain and uses these states (I dont use the schedule myself, so cant test )
you should be able to use a var like state-schedule-on-color
. Have you tried that yet?
on the boiler template sensor: why not make it a binary sensor, (and maybe even set a device_class. Ive filed a FR for a Heater just for this purpose, but since that has not yet been implemented, you could use something close )
on the regular sensors: suppose we keep card_mod/custom-ui alive for those for now, because there are so many possibilities, that would be hard to provide system defaults for.
Ofc we have the battery colors, (and I found hope we could add those colorings to wifi strength etc etc) but other than those, we’re down to the 2 custom options mentioned.
Thanks Marius - I did notice my error after posting (line numbers different); and later half answered part of my query in that schedule-on-color would likely be changeable if I wanted to as it’s at domain level (I struggled initially with domain and device_class meanings etc …but somewhat clearer now.
The docs are excellent if you understand all other elements mentioned in said docs and often explain well through examples (to those that know) but some additional populated examples of what “typical” examples translate too is hugely helpful when very new.
I got a bit blinded by failing to understand device_class in the front end references for Color Rules; where state-cover-blind-open-color (I think) reinforces the definitions.
Getting a little more adept at seeking out answers from earlier forum posts now; and of course colours seems rather a moving target to be learning the ropes on. So I’ll try and explore how to change the sensor as suggested. What could possibly go wrong between an icon colour of personal choice or stone cold radiators, eh?
I sense I’d have struggled far more with HA without the UI assistance provided for new users so hugely grateful its easier to dive deeply into things with community advice & support.
It have been a while since the release ruined all the colors.
My entire lovelace configuration are based on colors such as var(--rgb-*color*-color)
but all colors is black since.
Has it been fixed in 2023.3?
This was addressed last release, you should checkout the frontend documentation to see the variables that are now supported.
I’ve introduced this lines few revision ago and was working well
state-alarm-armed-color: ‘#F44336’ # Red
state-alarm-arming-color: ‘#FF9800’ # Orange
state-alarm-disarmed-color: ‘#4CAF50’ # Green
state-alarm-pending-color: ‘#FF9800’ # Orange
state-alarm-triggered-color: ‘#F44336’ # Red
But now since 2023.2.x stopped working again coming back to Alarm Panel in green when armed and grey when disarmed.
Any suggestion ?
yes, read this and adapt your settings:
Great! Thanks Marius
I’ve customised my theme like
state-alarm_control_panel-armed_away-color: ‘#F44336’ # Red
state-alarm_control_panel-armed_custom_bypass-color: ‘#F44336’ # Red
state-alarm_control_panel-armed_home-color: ‘#F44336’ # Red
state-alarm_control_panel-armed_night-color: ‘#F44336’ # Red
state-alarm_control_panel-armed_vacation-color: ‘#F44336’ # Red
state-alarm_control_panel-arming-color: ‘#FF9800’ # Orange
state-alarm_control_panel-disarming-color: ‘#FF9800’ # Orange
state-alarm_control_panel-pending-color: ‘#FF9800’ # Orange
state-alarm_control_panel-triggered-color: ‘#E7FF00’ # Yellow
state-alarm_control_panel-disarmed-color: ‘#4CAF50’ # Green
cant find a device_class to set on a binary_sensor, whihc I like to makes of the sun below horizon color:
in fact, the binary is called dark_outside
, and indeed related to the sun, but not being below horizon, but having a certain angle…
- unique_id: dark_outside_elevation #outside_daylight_sensor
name: Dark outside
state: >
{{state_attr('sun.sun','elevation') < -4}}
icon: >
mdi:brightness-{{'4' if this.state == 'on' else '5'}}
attributes:
icon_color: >
{{'purple' if this.state == 'on' else 'gold'}}
currently using custom-ui to set the icon_color, but would have hoped to be able to set tha aside and use a device_class here…