home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.08k stars 2.79k forks source link

Color Temp should not change icon color #19435

Open damusmf opened 3 years ago

damusmf commented 3 years ago

The problem

https://github.com/home-assistant/core/pull/55219

this PR forces color temp lights to report RGB values to change the color of the icon, breaking the aesthetics of most themes and leaving it almost impossible to distinguish between lights that are on vs off at a glance. As lights that are off are white and lights that cool white are also the same white.

What is version of Home Assistant Core has the issue?

core-2021.9.5

What was the last working version of Home Assistant Core?

core-2021.8.8

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Most themes, the off color of icons is white. So if lights are on cool white they are now also white and impossible to distinguish from off. And when on and warm white they have an orangy icon. These icons used to follow the current theme and only adjust based on brightness while maintaining the color of the theme.

image here the Lamps are ON but cool white, the ceiling and closet are off. Previously they would have been the themes color for on, in this case yellow.

image Top 3 are not color temp lights while the bottom 3 are, completely breaking the consistency of the theme and every other icon.

Different attributes when on vs off image image

Color temp bulbs are not RGB and the attribute shouldn't be forced onto the entities. This was a "bug" previously when lights were reporting incorrect supported features, https://github.com/home-assistant/core/issues/52661, and now it is baked in as an actual "feature".

probot-home-assistant[bot] commented 3 years ago

light documentation light source (message by IssueLinks)

brunomgsousa commented 3 years ago

Same here my RGB lights show orange color icon when I request warm white, and when I swipe to cool white show rose icon color. ☹️

jerodjchastain commented 3 years ago

Mine is doing the same thing. has anyone found an answer yet? I did try to remove a device and pair it again but still the same thing!

dohlin commented 3 years ago

This change wasn't the greatest idea - it makes it quite literally impossible to tell when a state icon light that is cool white is 'on' vs 'off'. Sure, the old default 'Yellow' didn't make a whole lot of sense for a cool whit light, but at least you could easily tell whether it was on of off....and it still changed colors if you changed a multicolor light to any other color.

Because there's no "perfect" scenario for this, this PR should definitely be reverted and left to the theming options as it was before - for individual customization. Also - having the theme control it fixes cool white light state icons now looking like they do nothing when turned on, vs all fan/smart outlet/etc. state icons still turning yellow as before. This just was not a very well thought out change. If not reverted entirely, at the very least a global override should be put in. Please!!

joe-sydney commented 3 years ago

Yes, my cool white light icons can't be seen in lovelace... unless I use dark mode which is not what I'd like to do.

I'd say it is pretty much broken in this case and I had to revert to 2021.8 in the hope of this being rectified in the future.

cw

joe-sydney commented 3 years ago

In the meantime, I've hardcoded the color so that it shows the default yellow regardless of the color_temp... (while the brightness still changes the shade of the icon)

    elif color_mode == COLOR_MODE_COLOR_TEMP and self.color_temp:
        #hs_color = color_util.color_temperature_to_hs(
            #color_util.color_temperature_mired_to_kelvin(self.color_temp)
        #)
        hs_color = (49, 98)
        data[ATTR_HS_COLOR] = (round(hs_color[0], 3), round(hs_color[1], 3))
        data[ATTR_RGB_COLOR] = color_util.color_hs_to_RGB(*hs_color)
        data[ATTR_XY_COLOR] = color_util.color_hs_to_xy(*hs_color)
broyuken commented 3 years ago

Not sure whats up with yours but mine show a pinkish color when they are on the coolest white. I actually really like the change.

image

joe-sydney commented 3 years ago

Thanks. Your reply triggered further investigation, and what I have found is that the lights that supported max coolness of 5700K were fine (like yours, a faint pinkish/apricotish color, but other lights that supported up to 6500K completed disappeared.

Looking at this again, I am not sure if this is the same problem as OP and I apologise if it is not.

Rather than fixing the color per my workaround above, I tried the following workaround to make sure the icon display never goes beyond 5700K (without actually affecting the light itself), and it seems to be working ok (still a little too faint for my poor eyesight)... color_util.color_temperature_mired_to_kelvin(max(175,self.color_temp)) in place of: color_util.color_temperature_mired_to_kelvin(max(self.color_temp)

dohlin commented 3 years ago

I believe the gen 3 Hue white & color ambience bulbs support up to 6500k, and that's what I had mine set to. It's difficult if not impossible to tell when they're on - certainly a poor user experience being unable to instantly at a glance tell when lights are on which really sucks.

@joe-sydney this is probably a stupid question but where are you making this color_util.color_temperature_mired_to_kelvin(max(175,self.color_temp) change? I have a generic "light reset" script I use to set all lights back to a default color/brightness when they get changed, but other than that all I'm really using are state icons on a Lovelace picture elements card so I'm not really sure where this would be changed at.

joe-sydney commented 3 years ago

This line of code is in the actual light component itself and not a user configuration. I use venv virtual environment so the file I tweaked is here: /srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/light/init.py

Until something is done by the devs, I have had to make a change each time I upgrade homeassistant (as the change gets overridden). But I can't not do it, because the light icon either gets too faint or disappears all together.

dohlin commented 3 years ago

Interesting...I'm currently using an HomeAssistant OS install. Wonder if I could potentially SSH into it and do a sudo nano update on that file. What a royal pain. ☹️

I'm shocked that apparently so few people use >5700k color temps with Lovelace state icons...or apparently just don't care about seeing whether their lights are on or not. Seems like this is a very flawed commit.

joe-sydney commented 3 years ago

Does yours gradually disappear as you increase the coolness of your light beyond a certain level? On HA you can see what mired you're on. The 175 (mired) corresponds to 5700K, I believe... 1000000/color_temp_in_kelvins

dohlin commented 3 years ago

I honestly haven't played with it that extensively, but I believe so. I usually have the color tone as cool as it will go...and the difference between the 'off' color vs the 'on' color at that color temp is incredibly hard to distinguish. Like almost hard enough that I have to already know a light is on in order to make out the most miniscule of color difference.

For now one of the things I did was changed my default light settings to technically be the lightest possible blue color (instead of straight white) since 6500k or whatever is already very cool in color it's not really noticable, but it changes the state icon color to a faint blue. The faint blue is still pretty difficult to see at a glance, but it's at least not practically impossible.

joe-sydney commented 3 years ago

OK, that's why I am not sure you have the same problem as me because you said you can't tell the difference between on and off. Off was fine for me, but when it is on, the icon goes invisible when the light is changed to very cool as you can see from one of the pictures I included. Totally Gonesky.

dohlin commented 3 years ago

I see. Yeah mine don't totally disappear like you've noted. They just functionally don't react to pressing the state-icon button because the state-icon button basically stays the exact same color.

I believe the theme I'm using is Midnight v2 from HACS, iirc. It's definitely not a light theme, buts it's far from a dark theme either. Not sure if that could make a difference or not.

GaTechThomas commented 3 years ago

Maybe have an "outline" setting that would show the same icon's outline in a fixed color. The outline color would need to be settable.

Potential implementation would be to have the same icon stacked just behind the colored icon, and scaled very slightly larger. Would certainly need to be sure to test with transforms of all types.

wojtek14a commented 2 years ago

Could we get a simple bool setting like state_color in the button card? I find it really annoying, I understand the need to distinguish lights ant the fact that changing its color in UI is te simplest solution but in the every day scenario my family found it confusing and started to ask me why the light in living room is pink and the one in garage is blue if they're both white, not RGB. Not to mention the temperature in which one of my lights go full white, which at first glance looks like a bug, not a feature.

TheFes commented 2 years ago

Totally agree with @wojtek14a this should be optional and configurable using a boolean.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

deviantintegral commented 2 years ago

This is still a problem, and an accessibility issue at that due to poor contrast. Here's a current example of some full-colour bulbs on "white":

Screen Shot 2022-03-06 at 9 15 54 AM

I think adding an outline as suggested above would be a good way to fix this.

GaTechThomas commented 2 years ago

This type of issue has been around for as long as computer displays have existed. Surely there's a UI expert here who can suggest a tried and true design pattern.

deviantintegral commented 2 years ago

While I'm not a designer, I work with them and we often have to handle issues like this. Common techniques include:

I think an outline (conditional or not) would preserve the desired functionality while maintaining usability.

joe-sydney commented 2 years ago

Right now because some of my light icons become too faint or outright invisible, I have to make tweaks to the component manually after each update :(

As I found above, the icon becomes faint/invisible beyond a certain color temp, ie around 5700K.

Perhaps in the code below (which is what I tweak each time), the Kelvin can be maxed out at 5700K or less. Or perhaps re-scale it the output of color_util.color_temperature_mired_to_kelvin(self.color_temp).

elif color_mode == COLOR_MODE_COLOR_TEMP and self.color_temp: hs_color = color_util.color_temperature_to_hs( color_util.color_temperature_mired_to_kelvin(self.color_temp) )

hs_color = color_util.color_temperature_to_hs(2000+0.66*(color_util.color_temperature_mired_to_kelvin(self.color_temp)-2000)) )

dohlin commented 2 years ago

I totally support the idea of some sort of outline. That seems like a great way of indicating state, while still allowing accurate full color representation.

brunomgsousa commented 2 years ago

The same problem here. 2022-03-07_00h52_38

wojtek14a commented 2 years ago

Now that this topic live again and could potentially be resolved soon, I would like to stress out that I personally find this feature useless/confusing BUT I understand why it exists and the fact that many users find it useful. Current state is unusable so the suggestion of adding the outline is great in my opinion but I would once again ask to add the option to completely disable this behavior as well. It could even be as an option, not default setting. As I mentioned few comments above, I believe the most versatile option would be adding a bool setting like state_color in each card, but I'm open to any setting that would lead to disabling the change of color of the icon (maybe some global setting in lovelace config, though I don't believe it's common practice in HA "config way").

TheFes commented 2 years ago

I would suggest adding a boolean for this, something like state_color_temp or something like that.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

deviantintegral commented 2 years ago

This is still a current issue:

image
joe-sydney commented 2 years ago

I agree this issue is still there. It does not make sense to leave things as they are so that the icon completely disappears (for me, it is when the color temp exceeds a certain threshold... becomes too cool). Every time there is a new release, I need to patch my workaround, which is to cap the color temp. The color reproduction on the icon is not accurate anymore, but I don't really need that. At least, I can see the light icon.

SergeyPomelov commented 2 years ago

The issue isn't stale, dear bot, you had to wait a bit more.

1920x1200 commented 1 year ago

I'm having the same issue: when a light is turned on with a white color temperature, the icon becomes white and can't be seen when my dashboard is in light mode during the day. Yet my non-RGB lights work fine as they show as yellow when on.

So far the only workaround I've come up with is adding these two attributes in the YAML configuration of the button on the dashboard:

show_state: true
state_color: null

This prevents the white color from showing but makes the icon always blue (so it look like it's always off) but the state will be shown below it as on or off. Not perfect, but better then not being able to see the icon at all.

Has anyone found a workaround to just force the standard yellow color when on and ignore the color of RGB bulbs?

broyuken commented 1 year ago

You can use the mushroom cards. They have an option to use the state as a color or not.

peregrinus commented 1 year ago

Same problem here with a dark orange theme. Off looks like on and vice versa. I thought it was the theme until i figured out it was based on colour temperature. This is impacting the 'buttons' on the header or footer of entity cards in my case.

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

1920x1200 commented 1 year ago

Issue not resolved.

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

deviantintegral commented 1 year ago

Still an issue.

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

wojtek14a commented 1 year ago

Still an issue

marcoisabella commented 1 year ago

Is this the issue in this topic? Cold temp become full white color and I can't see the icon anymore? image

broyuken commented 1 year ago

yes

issue-triage-workflows[bot] commented 10 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

wojtek14a commented 10 months ago

Not resolved

github-actions[bot] commented 7 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

SergeyPomelov commented 7 months ago

Go away pesky bot. Your GitHub policy of sending spam until users give up and allow the issues to be deleted is genius. Won't report any more bugs until it's resolved. Right now, I'm and other users are actively guarding the issues from the bot(around 60-70% of the issues I've subscribed in my case). I will simply skip their state to removed/nonexistent as this system forces them to be.

github-actions[bot] commented 4 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

1920x1200 commented 4 months ago

Still not fixed

github-actions[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

wojtek14a commented 1 month ago

Come on