Hue/sat gamma correction results in off primary colors
See original GitHub issueAs #2017 got rather messy as I was figuring stuff out, one of the discovery will be documented here.
Intro
When messing around with hue/sat, mostly when testing enhancedHue vs Hue I noticed colors when set where off, for the primary colors. They seem to be more washed out.
Problem
Skipping https://github.com/Koenkk/zigbee-herdsman-converters/blob/cf864be3828ad542cbfcbee2c73d4687e4e43cad/converters/toZigbee.js#L897 seems to help for somewhat, but they still look a bit washed out. (Both with Innr and Tint, so I think it’s a general thing and not a brand specific issue)
So I’m not convinced that is the issue, aside from that there are also some odd out of range values send from time to time.
But the later is fixed by switching to value.saturation = Math.min(255, hsv.s * (2.54));
as mentioned here https://github.com/Koenkk/zigbee-herdsman-converters/issues/2017#issuecomment-753666345
I wonder if we should only apply the gammeCorrection for enhancedHue and not Hue? I couldn’t find much info on why we are doing this correction. Not that it will fix the washed out colors though.
It might be a brightness issue? as lowering the brightness to around 250 instead of 255 gives close to the same result with xy vs hs… which is interesting.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (16 by maintainers)
Innr E14 and Tint GU10 both need enhancedHue to be false for them to take a moveToHueSat command.
I was going over my code and noticed I had the ugly hack in there for Tint GU10 from testing because it has the same model as the Tint E27… which does support enhancedHue and I havent figured out a proper figure print for it. (I had a check against IEEE adress to toggle it off for my Gu10)
So the pattern is clear ish I think, we need to apply gammaCorrection for bulbs that do enhanchedHue and skip it for those that don’t!
I managed to get the GU10 split of and did a bunch of more testing.
The Innr RB 250 C and the ML Tint GU10 look a bit off with and without gammaCorrection, neither looking objectively better than the other. To keep thing consistent, I think it’s best to just leave gammaCorrection in place.
For now my strategy is to use XY for both of these bulbs and use Hue/Sat for my others, as Hue/Sat does give better results on my Osram/Hue/Innr RB 285 C/Tiny E27… ¯_(ツ)_/¯