sbidy / wiz_light

A WiZ Light integration for Home Assistant
MIT License
341 stars 68 forks source link

Pastel colors after 0.4.3 #200

Closed martroy closed 2 years ago

martroy commented 2 years ago

Hi,

After updating to 0.4.3, some colors seem to be limited to pastel hues, i.e., much less saturated than with the previous release. Rolling back to 0.4.2 fixes the problem. Note that some colors have the right saturation.

All of my lights are Wiz downlights (model 23009) with the latest firmware (1.24.0).

Here is a scene I am using to test this:

The bulb should be orange-red but, with 0.4.3, it is more like a pale salmon color.

Let me know if you need more information.

dfayne commented 2 years ago

I am seeing a similar issue. I have my bulbs bridged to HomeKit via HASS Bridge. When setting the color to Red for example in Apple's Home App, the bulb changes to a pink-ish color. Blue comes us as a very pale blue. However, if I ask Siri to change the color to red it's fully saturated. I am no programmer so I have no clue if this is an issue with this integration or the HASS bridge but it did pop up after installed 0.4.3.

martroy commented 2 years ago

I did a bit more testing today. I've tried deleting all the bulbs and re-adding them using the integration UI but I am still getting the same behavior. What appears to happen is that for some colors, the picker will not let me select the full color that is on the outside ring. When setting it, it will always go back to a less saturated tone.

As an example, selecting the orange-red color shows the problem: wrong

The red doesn't have the problem: right

I am not sure but it looks like "pure" colors are fine but not the in between ones. Sometimes, when changing to one of the problematic hues, the light has the right color but slowly fades to a pastel tone.

sbidy commented 2 years ago

Yes, between these two releases, the library behind was changed. I have to check if there are values not correct set. Because the color was calculated with the RGB (color) and CW (cold warm led) this can cause in a less saturated color.

sbidy commented 2 years ago

It seems to be an issue with the red channel only.

martroy commented 2 years ago

It seems to be an issue with the red channel only.

Are you sure about that? I've just tested all of the colors and I am experiencing this with most of the colors except those that are "pure". Those with the green lines are ok. The red ones won't let me select the most saturated color. Screenshot 2021-12-12 151616

sbidy commented 2 years ago

Yes, this "issue" comes from the computation of the saturation value. The library will add for these colors the white LED as saturation value. In the Wiz App you can switch between these two modes via Scenes, HASS doesn't have the possibility to add a kind of saturation slider.

martroy commented 2 years ago

Hi,

For HASS, I thought that the saturation was controlled by the color wheel, the outside ring being the most saturated? Isn't there a way to mimic 0.4.2 (pywizlight 0.4.12) behavior?

Here is a video to better illustrate what I mean: https://user-images.githubusercontent.com/59968986/146394444-fbd9573b-10f8-44b5-a0a8-3a119ca8b392.mp4

You can see that, when clicking near the white circle for some of the colors, it drops back the saturation. The same behavior occurs with the bulb itself: the color is fully saturated for a fraction of a second then drops to the less saturated color. Unfortunately, it is hard to show that in a video.

One thing I've noticed is that the amount it drops back seems to follow a certain curve depending on how close the color is from one of the color that works. This would lead me to think that there is a problem when calculating one of the values. But, then again, I haven't looked at the code so I might be completely wrong on this...

Thanks for you hard work btw!

sbidy commented 2 years ago

Fixed (hopefully) in Version 0.4.5 - please update

martroy commented 2 years ago

Yes, it works perfectly now. Thank you so much!