Open Ghawken opened 2 years ago
Note that Karl's contributions aren't in the repo yet, but there are releases (many releases) from him. I have to sort it all out after we get 2022.1 out, but if you find the issue in the current source, just make sure that you keep careful track of what your changes are so we can try to patch Karl's version.
Which hue plugin version are you using?
And From the dump I don’t see which value is out of limit?
Karl
On 01.04.2022, at 03:52, Jay Martin @.***> wrote:
Note that Karl's contributions aren't in the repo yet, but there are releases (many releases) from him. I have to sort it all out after we get 2022.1 out, but if you find the issue in the current source, just make sure that you keep careful track of what your changes are so we can try to patch Karl's version.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.
1.8.7
Its the hue device.state Hue is 0-360 Hue.Plugin comments discuss conversion of hue 0-65565 to 0-360 but obviously not happening somewhere before deviceStateUpdated in indigo.
Here:
hue : 54600 (integer)
hue.ui : 54600 (string)
Happy to update and keep current - just point me in the right direction!
I will check after Bf
Karl
On Apr 1, 2022, at 06:22, Ghawken @.***> wrote:
1.8.7
Its the hue device.state Hue is 0-360 Hue.Plugin comments discuss conversion of hue 0-65565 to 0-360 but obviously not happening somewhere before deviceStateUpdated in indigo.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
code section:
# Convert from HSB to RGB, scaling the hue and saturation values appropriately.
if(hue == 0 and saturation == 0 and (colorX > 0 or colorY > 0)) or colorMode == "xy":
xyY = xyYColor(colorX, colorY, brightness / 255.0)
rgb = xyY.convert_to('rgb')
# Let's also convert the xyY color to HSB so that related device states in Indigo are updated correctly.
hsb = xyY.convert_to('hsv')
hue = int(round(hsb.hsv_h * 182.0))
saturation = int(round(hsb.hsv_s * 255.0))
else:
hsb = HSVColor(hue / 182.0416666668, saturation / 255.0, brightness / 255.0)
rgb = hsb.convert_to('rgb')
it was hue = int(round(hsb.hsv_h * 182.0)) ….
hue =(int(round(hue / 182.0)))
it should be:
hue = min(360,(int(round(hue / 182.0416666668)))
guess that is a int/ float rounding issue.
I am also adding a logging statement to /Library/Application Support/Perceptive Automation/Indigo 2022.1/Logs/com.nathansheldon.indigoplugin.HueLights/plugin.log in case hue is >= 65535
will change the code in the next release
Karl
On Apr 1, 2022, at 06:22, Ghawken @.***> wrote:
1.8.7
Its the hue device.state Hue is 0-360 Hue.Plugin comments discuss conversion of hue 0-65565 to 0-360 but obviously not happening somewhere before deviceStateUpdated in indigo.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
that statement is actually in many places, I need to go through each.
And unfortunately the variable name hue is used for the hue system value as well as the hue indigo dev state
one is 0-65k (2**32-1) — hue system the other is 0-360 (or may be it should be 0-359?) — indigo dev states
both integer values
Karl
On Apr 1, 2022, at 06:22, Ghawken @.***> wrote:
1.8.7
Its the hue device.state Hue is 0-360 Hue.Plugin comments discuss conversion of hue 0-65565 to 0-360 but obviously not happening somewhere before deviceStateUpdated in indigo.
— Reply to this email directly, view it on GitHub https://github.com/IndigoDomotics/Hue-Lights-Indigo-plugin/issues/9#issuecomment-1085406055, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2SNAQLNKHXXHO6FQH3TDVCZ2ZLANCNFSM5SHDNJSQ. You are receiving this because you commented.
Thanks. hue ends up being divided by 360 in colorsys conversion - so would guess is 0-360
if you could try this one:
https://github.com/IndigoDomotics/Hue-Lights-Indigo-plugin/releases/tag/v1.10.16
it should fix the hue >360 and also colorX or ColorY ==0
Compared to your version it has several changes:
Karl
On Apr 1, 2022, at 03:52, Jay Martin @.***> wrote:
Note that Karl's contributions aren't in the repo yet, but there are releases (many releases) from him. I have to sort it all out after we get 2022.1 out, but if you find the issue in the current source, just make sure that you keep careful track of what your changes are so we can try to patch Karl's version.
— Reply to this email directly, view it on GitHub https://github.com/IndigoDomotics/Hue-Lights-Indigo-plugin/issues/9#issuecomment-1085308673, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2SNABPOWCRE5QOWQPB23VCZJFXANCNFSM5SHDNJSQ. You are receiving this because you are subscribed to this thread.
Thanks - have updated. No update issues. All seems good. Thanks
Morning, Karl.. On 1.10.20 Unfortunately seems something is still up with Hue state in Hue plugin. Getting very high readings saved as display state - currently Hue = 56984.. Was debugging homekit integration trying to find issue - because was fixed…. ?something not merged…
Sorry I am out of town until May 10. No access to indigo. Will check when I am back.
If you could some more info ie compare the values on the app w what indigo shows etc.
Karl
On Apr 23, 2022, at 18:25, Ghawken @.***> wrote:
Morning, Karl.. Unfortunately seems something is still up with Hue state in Hue plugin. Getting very high readings saved as display state - currently Hue = 56984.. Was debugging homekit integration trying to find issue - because was fixed…. On 1.10.20
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
Thanks - Sorry to bother. I also spammed you with another issue - obviously can wait.
Hue values in Indigo are thousands on 1.10.20 -- does seem like something not merged?
I have worked around, by simply ignoring the hue values - probably best anyway and more indigo.dimmer compatible - same for everything. But does seem like hopefully an easy merge to update?
.. along those lines:
if colorX ==0 or ColorY ==0 the library used throws an error
if(hue == 0 and saturation == 0 and (colorX > 0 or colorY > 0)) or colorMode == "xy”:
## adding:
colorX = max(0.00001, colorX)
colorY = max(0.00001, colorY)
xyY = xyYColor(colorX, colorY, brightness / 255.0) ## this one does not like ==0 values
rgb = xyY.convert_to('rgb')
Karl
That lib (color math included in the plugin distribution) has no check for div by 0 eg: xyzcolor.xyz_x = (cobj.xyy_x * cobj.xyy_Y) / (cobj.xyy_y)
On Apr 1, 2022, at 09:07, Ghawken @.***> wrote:
Thanks. hue ends up being divided by 360 in colorsys conversion - so would guess is 0-360
— Reply to this email directly, view it on GitHub https://github.com/IndigoDomotics/Hue-Lights-Indigo-plugin/issues/9#issuecomment-1085514450, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2SNGXNMR7ETY7YMDY2KDVC2OB5ANCNFSM5SHDNJSQ. You are receiving this because you commented.
Trying to sort out compatibility with HomeKit and not getting very far. Hue value heres jumps to well over allowed 360 - and crashes everything my end.
Seems not being coverted to 0-360, from 0-65536 prior to update IndigoDevice State. Leading to multiple state updates and eventually the right Hue setting. But jumping through these large values first which are unneeded..
Tracked down - here is device dump during such.
I'll see if can find where issue is in Hue code...