Why the heck is Lovelace state_color off by default?

It’s not enough to have things working. The point is to have them working in efficient way.
Everything can be achieved multiple ways. Humans were moving big blocks of stone yet before inventing the wheel.

Setting one global variable is more efficient than setting it individually in 50 cards. Isn’t it obvious?
And it’s not valid only about first usage. Once you decide to change your mind, you must go through all cards again.
If you still have doubts multiple it by number of HA users to get real waste of time.

In general having repeating fragment of code is anti-pattern. Avoiding it should be rule of thumb

4 Likes

Exactly! How about allow to set color based on state in customize global yaml file?. Yes I know you can do this already with a janky outdated customizeui integration (which I hope to stop using as soon as possible :slight_smile: )

+1.

I personally have gone through all my cards and set the state_color option to “on”. I believe it is more intuitive to visually differentiate an “enabled” from a “disabled” device, especially when you have more than 2 elements. In addition, I believe that a color setting would make sense (why yellow?)

I do understand where @zsarnett is coming from on the never-ending number of customizations, but I think that this one is a feature that many of us use consistently and thus deserves this elevation.

I also tried the custom integration, but would rather have a native implementation.

Thanks!

You know you can change that (globally) in themes right?

Yes. I just think this option deserves its own customization due its heavy use, at least for me.

Can it be changed for default theme easy way? I mean without creating new theme

Using themes is the easy way.

It sounds like suggestion of writing browser plugin (which I could say it’s easy task) to change css styles of web page.

People don’t want to go hard way, learning new things if intuitively those should be achievable easy way

So, as the month draws to a close, let’s look at this one statistically for a second.

Out of 746 WTHs this is the 21st most popular. Of the ones above it 5 were already publicly on the roadmap to be done anyway before wth came along, and 6 have been ‘solved’ or closed for another reason (ie, in spite of being a highly voted wth the solution was actually already available).

Taking those 11 away, this is in the top 10 unresolved WTHs that wasn’t already in the pipeline, and is presumably as easy as changing a ‘false’ to a ‘true’ somewhere for someone that knows where to look.

Just an observation :wink:

4 Likes

debian ~ # cat h/ui-lovelace.yaml | grep “state_color” | wc -l
276

It would also reduce the loading time of my config :wink:
Jkw