script.kodi.hue.ambilight
script.kodi.hue.ambilight copied to clipboard
cannot setup groups
Installing and discovering the bridge worked just fine. I cannot setup groups, the UI just does nothing. I am running LibreELEC 8.0.1 on an Intel NUC. Kodi.log:
23:22:52.819 T:139869871388416 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.KeyError'> Error Contents: ('bri',) Traceback (most recent call last): File "/storage/.kodi/addons/script.kodi.hue.ambilight/default.py", line 80, in onNotification self.settings.ambilight_group File "/storage/.kodi/addons/script.kodi.hue.ambilight/resources/lib/ui.py", line 13, in multiselect_lights lights = bridge.get_lights_by_ids(bridge_ip, bridge_user) File "/storage/.kodi/addons/script.kodi.hue.ambilight/resources/lib/bridge.py", line 78, in get_lights_by_ids res[light_id]) File "/storage/.kodi/addons/script.kodi.hue.ambilight/resources/lib/lights.py", line 35, in init self.init_bri = spec['state']['bri'] KeyError: ('bri',) -->End of Python script error report<--
same here :(
Hi! Are you using the official skin? there are some problems with some skins like eminence... Try to setup the addon with the estuary skin. Select the lights and press ok.
I am using the official skin.
Ok, next common issue: Non ascii characters in the name of the lights?
I Run it in the nvidia shield and I am using the aeon nox skin on Kodi 17.1
So it only work with the official skin? :(
Nope, but some users reports that part of the ui (ok button) is not visible with eminence skin... I use nvidia shield and qnap nas with estuarymod... Just try to setup with the official skin...
Only ASCII chars. Version 0.7.2 was working fine on older Kodi/LibreELEC
are you using Kodi 16 by changes?
@hstamas do you asked, if I have update my Kodi from previous release instead of fresh install? Yes, I do.
Kodi 16 doesn't work with the master branch of this plugin. I didn't realize this awhile back and was experiencing settings that wouldn't stick. By using Kodi 17 my issues were fixed.
LibreELEC 8.0.1 ist based on Kodi 17.1
i´m using Kodi 17.1 on a Nvidia Shield 2017.
Here´s my logfile.
21:46:40.078 T:138315596880 WARNING: RunScript called for a non-script addon 'script.kodi.hue.ambilight'. This behaviour is deprecated. 21:46:40.620 T:138970907728 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.KeyError'> Error Contents: ('bri',) Traceback (most recent call last): File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/default.py", line 80, in onNotification self.settings.ambilight_group File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/resources/lib/ui.py", line 13, in multiselect_lights lights = bridge.get_lights_by_ids(bridge_ip, bridge_user) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/resources/lib/bridge.py", line 78, in get_lights_by_ids res[light_id]) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/resources/lib/lights.py", line 35, in init self.init_bri = spec['state']['bri'] KeyError: ('bri',) -->End of Python script error report<-- 21:46:41.437 T:138315596880 WARNING: RunScript called for a non-script addon 'script.kodi.hue.ambilight'. This behaviour is deprecated. 21:46:41.975 T:138970907728 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.KeyError'> Error Contents: ('bri',) Traceback (most recent call last): File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/default.py", line 58, in onNotification self.settings.theater_group File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/resources/lib/ui.py", line 13, in multiselect_lights lights = bridge.get_lights_by_ids(bridge_ip, bridge_user) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/resources/lib/bridge.py", line 78, in get_lights_by_ids res[light_id]) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/resources/lib/lights.py", line 35, in init self.init_bri = spec['state']['bri'] KeyError: ('bri',) -->End of Python script error report<--
Can´t click on any option "setup ambilight group" for example. The connection to my Bridge is fine.
any suggestions?
What kind of hue lights are you using?
I´m using the second gen Hue Bulbs and the Bridge
- gen bridge, Lightstripe, Iris, Bloom, Lightify plug
So i guess i won´t be able to use this script :-/
I'm having the exact same problem. When I select 'Setup theather lights' nothing happens. Pairing with the Bridge works just fine. Running Kodi 17.3 on Nvidia Shield TV with Estuary. Gen 2 bridge with white Hue lights.
Same issue for me as well. Pairing is good. Can't setup any groups. UI does nothing. Kodi 17.3 on Esturary.
Log: https://pastebin.com/Tfn9Gsra
i'm using Kodi 16 and have the exact same issue everything is configurable - except the ambilight/theater/static groups. i'm running my kodi on my qnap nas
edit: alright, under kodi 17 it works fine. finally a reason to upgrade ;)
Still no one with shield 2017 and Kodi 17.4 who's struggeling with that kind of problem ?
Same problem since update to Kodi 17.3
I also had the problem but after a factory reset of the hue bridge everything works fine.
Damn it. So i have to reconfigure all my bulbs/scences in the hue app and my harmony and its not guaranteed that this will help? :-/
Dito.
Everything else is working fine (Hue App iOS, Android, ifttt, openHAB).
It's disappointing that there is no logentry and no error message.
From the time when I connect the Logitech Hub with the Hue Bridge the error is present again.
I had the same error.
In my case the problem was with the osram plug, these don't have a value for sat and bri (saturation and brightness).
The script lights.py has a check if there is no value for sat but not for bri.
If you replace the code on line 35 in C:\Users_username_\AppData\Roaming\Kodi\addons\script.kodi.hue.ambilight\resources\lib\lights.py from:
self.init_bri = spec['state']['bri']
to:
try: self.init_bri = spec['state']['bri'] self.bri = self.init_bri except KeyError: self.livingwhite = True
the configuration works.
Just copied the try except from the check for the sat value.
A second workaround:
Go to the webserver of the bridge http://*bridge_ip*/api/*bridge_user*/lights.
Find the number of the light(s) you want to use with kodi and put them directly in the config file.
C:\Users_username_\AppData\Roaming\Kodi\userdata\addon_data\script.kodi.hue.ambilight\settings.xml.
Edit the line:
There is another problem with the code if you select lights without the colours for ambilight.
I have 2 white ambiance lights and wanted to use them with the ambilight function just adjusting the brightness with the rest of the colour lights is good enough for me.
When you select these lights and start playing a movie the add-on crashes and you find this in the log files:
15:35:28.558 T:10616 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: unsupported operand type(s) for -: 'int' and 'NoneType'
Traceback (most recent call last):
File "C:\Users\Username\AppData\Roaming\Kodi\addons\script.kodi.hue.ambilight\default.py", line 316, in
def transition_colorspace(hue, light, hsvratio): fullspectrum = light.fullspectrum h, s, v = hsvratio.hue( fullspectrum, hue.settings.ambilight_min, hue.settings.ambilight_max ) hvec = abs(h - light.hue) % int(65535/2) hvec = float(hvec/128.0) svec = s - light.sat vvec = v - light.bri # changed to squares for performance distance = math.sqrt(hvec2 + svec2 + vvec**2) if distance > 0: duration = int(10 - 2.5 * distance/255) light.set_state(hue=h, sat=s, bri=v, transition_time=duration) ` to
` import math
def transition_colorspace(hue, light, hsvratio): fullspectrum = light.fullspectrum h, s, v = hsvratio.hue( fullspectrum, hue.settings.ambilight_min, hue.settings.ambilight_max ) if light.hue is None: light.hue = 1 hvec = abs(h - light.hue) % int(65535/2) hvec = float(hvec/128.0) if light.sat is None: light.sat = 1 svec = s - light.sat vvec = v - light.bri # changed to squares for performance distance = math.sqrt(hvec2 + svec2 + vvec**2) if distance > 0: duration = int(10 - 2.5 * distance/255) light.set_state(hue=h, sat=s, bri=v, transition_time=duration) ` If the value does is not there i just set it to 1, it works for me.
The changed scripts are in the attached zip file.
No idea what it is for me. Maybe my Osram ON / OFF plug? Only after a reset of the bridge, I can once select the bulbs and then it does not work anymore. But after I inserted both scripts, everything works as it should! Good job! Thank you!
Thx @hvf81!
I have an Osram Lightify Plug. What about the others, do you have a Osram Plug or anything similar as described by hvf81?
Yes I also have Osram Lightify Plug, and I also have a same problem. Once I'm back home I'll try the script.