v17 help with script.kodi.hue.ambilight
#1
Hello,

I am very new to Kodi and I am trying to solve a problem with a script developed by someone else.
Please go easy on me, this is my first post here Angel

The script.kodi.hue.ambilight https://github.com/koying/script.kodi.hue.ambilight. I tried develop, master and release 0.8.b2 with the same problem.
The script is supposed to control philips hue lights based on the content of the video stream.
The pairing with the philips hue hub works very well, and it recognizes my hub and lamps.
But whenever I start a movie, the add-on report "an error has occured". I have 3 complete logs i can make available. In all three I can see the exact same error:
PHP Code:
20:59:41 T:1598018464   ERROREXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - 
NOTEIGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            
Error Type: <type 'exceptions.AttributeError'>
                                            
Error Contents'module' object has no attribute 'CAPTURE_FLAG_CONTINUOUS'
                                            
Traceback (most recent call last):
                                              
File "/root/.kodi/addons/script.kodi.hue.ambilight-develop/default.py"line 104in onPlayBackStarted
                                                state_changed
("started"self.duration)
                                              
File "/root/.kodi/addons/script.kodi.hue.ambilight-develop/default.py"line 425in state_changed
                                                capture
.capture(int(capture_width), int(capture_height), xbmc.CAPTURE_FLAG_CONTINUOUS)
                                            
AttributeError'module' object has no attribute 'CAPTURE_FLAG_CONTINUOUS'
                                            
-->End of Python script error report<--
20:59:41 T:1598018464   DEBUGKodi HueDEBUG run loop delta0.197952 (5.051729/sec)
20:59:41 T:1598018464   ERROREXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - 
NOTEIGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            
Error Type: <type 'exceptions.AttributeError'>
                                            
Error Contents'xbmc.RenderCapture' object has no attribute 'waitForCaptureStateChangeEvent'
                                            
Traceback (most recent call last):
                                              
File "/root/.kodi/addons/script.kodi.hue.ambilight-develop/default.py"line 467in <module>
                                                
run()
                                              
File "/root/.kodi/addons/script.kodi.hue.ambilight-develop/default.py"line 320in run
                                                
if capture.waitForCaptureStateChangeEvent(200):
                                            
AttributeError'xbmc.RenderCapture' object has no attribute 'waitForCaptureStateChangeEvent'
                                            
-->End of Python script error report<-- 
I have zero knowledge of python, and I would appriciate some hints.
The source code lines referred by the log are for the first error:

PHP Code:
...
      
capture_width 32 #100
      
capture_height capture_width capture.getAspectRatio()
      if 
capture_height == 0:
        
capture_height capture_width #fix for divide by zero.
      
logger.[url=https://kodi.wiki/index.php?title=Log_file]Debug Log[/url]("capture %s x %s" % (capture_width, capture_height))
      
capture.capture(int(capture_width), int(capture_height), xbmc.CAPTURE_FLAG_CONTINUOUS)
... 

And for the second error:

PHP Code:
...
  if 
player.playingvideo# only if there's actually video
        
try:
          if 
capture.waitForCaptureStateChangeEvent(200):
            
#we've got a capture event
            
if capture.getCaptureState() == xbmc.CAPTURE_STATE_DONE:
              
screen Screenshot(capture.getImage(), capture.getWidth(), capture.getHeight())
              
hsvRatios screen.spectrum_hsv(screen.pixelsscreen.capture_widthscreen.capture_height)
              if 
hue.settings.light == 0:
                
fade_light_hsv(hue.lighthsvRatios[0])
              else:
                
fade_light_hsv(hue.light[0], hsvRatios[0])
                if 
hue.settings.light 1:
                  
#xbmc.sleep(4) #why?
                  
fade_light_hsv(hue.light[1], hsvRatios[1])
                if 
hue.settings.light 2:
                  
#xbmc.sleep(4) #why?
                  
fade_light_hsv(hue.light[2], hsvRatios[2])
... 

I hope some one can point me in the right direction
Thanks
Reply
#2
This would be better in the add-on development section. Moving...
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#3
http://forum.kodi.tv/showthread.php?tid=...pid2191068

https://github.com/fritsch/script.kodi.h...be5bc88faa
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
(2016-09-21, 23:33)ronie Wrote: http://forum.kodi.tv/showthread.php?tid=...pid2191068

https://github.com/fritsch/script.kodi.h...be5bc88faa

Thanks!!!!
Reply
#5
Hi all!
i can't get this addon to work...

It works perfectly in kodi v16, but fails in v17 beta 3.
I try the fork suggested in the previous post, but hue crashes whern the movie start.
Here is the error:
Code:
10:49:36 T:139821468374784   ERROR: EXCEPTION Thrown (PythonToCppException) :
-->Python callback/script returned the following error<--
    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
      Error Type: <type 'exceptions.UnboundLocalError'>
      Error Contents: local variable 'i' referenced before assignment
      Traceback (most recent call last):
      File "/share/CACHEDEV1_DATA/.qpkg/mykodi17/homes/newkodi17/.kodi/addons/script.kodi.hue.ambilight-master/default.py", line 748,
            in <module>  run()
      File "/share/CACHEDEV1_DATA/.qpkg/mykodi17/homes/newkodi17/.kodi/addons/script.kodi.hue.ambilight-master/default.py", line 594,
           in run
               hsvRatios = screen.spectrum_hsv(screen.pixels, screen.capture_width, screen.capture_height)
      File "/share/CACHEDEV1_DATA/.qpkg/mykodi17/homes/newkodi17/.kodi/addons/script.kodi.hue.ambilight-master/default.py", line 541,
           in spectrum_hsv
               if int(i) != 0:
      UnboundLocalError: local variable 'i' referenced before assignment
-->End of Python script error report<--

i'm running kodi in a QNAP Nas, throught the HDMI out...
Any Clue?
Reply
#6
Hi mrS4T4n,

I had the same problem (on a Win 10 Pc, though.) I tried this version

https://github.com/koying/script.kodi.hue.ambilight

- it's working perfectly. Hope that helps!

-Erik
Reply
#7
Thanks
i'll give it a try tonight!
Reply

Logout Mark Read Team Forum Stats Members Help
help with script.kodi.hue.ambilight0