-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong color calucation in HS mode #1128
Comments
@bwssytems: |
I'll look into it |
ok, thank you. What I did was changing color via Echo Plus Alexa and via Alexa app. What I'm going to try is checking out how the Philips App behaves. From what I got from the internet it seems hue (on Philips Hue) is a value between 0 - 65535. Division by 182.04 results in 'regular' hue values. As you can see the value is send from the Alexa to the HA-Bridge. I'm using a ioBroker and (Simple API, deCONZ adapter) with deCONZ, last one requires Hue |
Will be writing a test case for this and will validate the calculation |
Having a very hard time with this conversion as Philips does not publish their calculation. |
Dev branch 5.3.x to create v5.4.0 #1044 Alexa app, error "Device doesn't support requested value" bug question #1118 Device status update in Alexa App is not working correctly for ha-bridge devices bug duplicate question #1126 Can't get XY ColorData into URL enhancement question #1127 Can't get separate hue, saturation and brightness enhancement question #1128 Wrong color calucation in HS mode bug question #1131 Changing color temperatur is not working correctly bug question #1132 Conversion from CIE to RGB incorrect bug question #1139 Device ID creation fails bug question #1150 Home Assistant gets null exception during initialization bug question #1170 Alexa not sending the correct color codes duplicate #1171 Please add option: If bright request present with on, only send dim enhancement #1184 Alexa will not discover HABridge question #1191 When "Use UPNP Address Interface Only" is selected, echo cannot find ha-bridge bug #1210 [Enahnacement] Have link button timeout be configurable enhancement #1215 Alexa unable to discover recently added devices to ha-bridge duplicate question #1227 Feature request: ${intensity.previous} value passing control enhancement #1239 HA-Bridge has suddenly given up itself - Exception in thread "main" java.lang.NullPointerException bug question #1243 Alexa device discovery now broke question #1253 HABridge hue ColorDecode 0 0 0 bug question #1256 Homeassistant devices not appearing bug question
I am using Echo Plus to connect to HA-Bridge directly. When I change the colors the HUE comes in values 0-65535. So the whole RGB calculation failes. This was already discussed in #1060:
This is what I got from the logs:
hue/sat request - Hue: 21845, Sat: 254, Bri: 0
09-09-2019 22:04:58.147 | DEBUG | hue/sat request - Hue: 21845, Sat: 254, Bri: 0
09-09-2019 22:04:58.183 | DEBUG | calculate HSL vars - var1: 0.0, var_2: 0.0, h2: 0.8333334, h2 + 1/3: 1.1666634, h2 - 1/3: 0.50000334 | com.bwssystems.HABridge.hue.ColorDecode
09-09-2019 22:04:58.184 | DEBUG | hue_2_rgb vh: 1.1666634 | com.bwssystems.HABridge.hue.ColorDecode
09-09-2019 22:04:58.185 | DEBUG | hue_2_rgb vh: 0.8333334 | com.bwssystems.HABridge.hue.ColorDecode
09-09-2019 22:04:58.185 | DEBUG | hue_2_rgb vh: 0.50000334 | com.bwssystems.HABridge.hue.ColorDecode
09-09-2019 22:04:58.186 | DEBUG | Color change with HSL: Hue: 21845, Sat: 254, Bri: 0. Resulting RGB Values: 0 0 0
or
09-10-2019 00:06:52.812 | DEBUG | hue/sat request - Hue: 43690, Sat: 254, Bri: 77
09-10-2019 00:06:52.830 | DEBUG | calculate HSL vars - var1: 0.0, var_2: 0.6039216, h2: 0.16666675, h2 + 1/3: 0.49999675, h2 - 1/3: -0.16666326 | com.bwssystems.HABridge.hue.ColorDecode
09-10-2019 00:06:52.831 | DEBUG | hue_2_rgb vh: 0.49999675 | com.bwssystems.HABridge.hue.ColorDecode
09-10-2019 00:06:52.832 | DEBUG | hue_2_rgb vh: 0.16666675 | com.bwssystems.HABridge.hue.ColorDecode
09-10-2019 00:06:52.832 | DEBUG | hue_2_rgb vh: -0.16666326 | com.bwssystems.HABridge.hue.ColorDecode
09-10-2019 00:06:52.833 | DEBUG | Color change with HSL: Hue: 43690, Sat: 254, Bri: 77. Resulting RGB Values: 154 154 0
since convertHSLtoRGB() calculates wrong RGB values the conversion RGBtoHSB() also produces wrong values.
The text was updated successfully, but these errors were encountered: