[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Service Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=152) +---- Thread: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) (/showthread.php?tid=151011) |
RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - KenV99 - 2014-12-10 (2014-12-10, 17:52)spambus Wrote: @KenV99 on linux your script works fine, but under windows when I try to open url's (trigger url's on an arduino wich controls lights) I get several errors I assume that it is in a window when using the 'Test' button? I would need a log file and at least a copy of the script/command/url that you are using to even start to troubleshoot. RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - spambus - 2014-12-10 this the error from the kodi log: Code: 16:39:43 T:4664 NOTICE: $$$ xbmc.callbacks2 - Starting tester.py from cwd: C:\Users\HTPC\AppData\Roaming\Kodi\addons\service.xbmc.callbacks2-master url I trigger is : http://192.168.2.14/kca_start but you can see that also in the log above all url's I try to trigger give the exact same error RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - KenV99 - 2014-12-10 Can you please try testing with the following: 1) Go to Settings->Services->Webserver and enable it and set the port to 9091 (or something else and then edit the url below)(you may need to turn on expert settings). 2) Copy/paste the following url into whatever event you are trying to setup: Code: http://localhost:9091/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22id%22:1,%22method%22:%22Application.Setmute%22,%22params%22:{%22mute%22:%22toggle%22}} Thanks. RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - spambus - 2014-12-10 the json url worked RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - KenV99 - 2014-12-10 (2014-12-10, 19:11)spambus Wrote: the json url worked Ok. Then I am not sure exactly what might be going on with your url. What do you see when you just browse to that url? RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - spambus - 2014-12-10 when I browse to that url, I see nothing, that's the way I created it, it runs code from my own home automation system I created on an arduino mega 2560, basicly what it does on the arduino side, when I trigger the url: http://192.168.2.14/kca_start on the arduino there runs code, wich turns limitlessled lightbulbs on and off, and a pushover message is send to my phone/watch/tablet that kodi has started, I can also code that when the url is triggered though a browser, the browser displays: hello in html, or whatever, but that is not needed The pushover message being send confirms that the code on the arduino has been executed RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - KenV99 - 2014-12-10 I uploaded a version with a little more debugging info to github: https://github.com/KenV99/service.xbmc.callbacks2/archive/master.zip If you want to try that and look at the logs, that might be helpful. RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - spambus - 2014-12-10 it gives the same error, not more details then before :S Code: 19:01:00 T:5320 NOTICE: $$$ [xbmc.callbacks2] - Executing command: [http://192.168.2.14/kca_pauze] for event: onPlaybackStopped RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - KenV99 - 2014-12-10 I uploaded another version. Same link as above. It seems that BadStatusLine is raised when the received response is not understandable by the standard python httplib: https://docs.python.org/2/library/httplib.html#httplib.BadStatusLine So I am just catching and passing it as not an error. So the question is are the lights responding as you want? RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - spambus - 2014-12-10 There is no error now, but the url is not triggered somehow, nothing happens also I noticed now, I had the notifications turned off, turned them on, but there are no notifications being shown now, maybe related to url's also not triggering? RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - KenV99 - 2014-12-10 I updated one last time, so please download and try again. If that doesn't work, you may need to look at how you have the 'server' setup to respond, since, as mentioned above, it is receiving an unknown status code in the header and that is causing the exception. Why only on Windows, I have no idea. Otherwise I am at a loss. RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - spambus - 2014-12-10 Now less works, before you would get a confirmation or error window when trying test command, now there is no window, and no notifications and url's still don't work... :S RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - KenV99 - 2014-12-10 Really, each time I need the log. RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - KenV99 - 2014-12-11 If you get around to it, I created a branch that uses requests2 instead of urllib2. If you are not using 'install from zip' you may need to download and install script.module.requests2, although it should do it automatically. If you try it out, please post back a log with either success or failure. https://github.com/KenV99/service.xbmc.callbacks2/archive/requests.zip RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - wrxtasy - 2014-12-16 Script Newbie here.... Is it possible with this Add-On - service to automatically Disable Hardware acceleration when entering the PVR / Live TV section of XBMC and turn it back on when exiting ? It would work around a long standing issue of XBMC crashes on ATV1/Crystalbuntu when viewing mpeg2 Live TV with Hardware Acceleration enabled if this can be implemented. a bit more playing around gives me this to work with: CHD Acceleration: Code: On: ------------------------------------------------------------------------------------------------------ Great Success ! I've finally coded a worked around for this annoying issue, follow below: http://forum.osmc.tv/showthread.php?tid=16534 |