Page 91 of 94
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Sun Aug 06, 2017 9:08 pm
by egbaud
How do I translate this: xbmc.VideoLibrary.RemoveMovie(movieid=1234) into XBMC2 form.
I know the first part is eg.plugins.XBMC2.JSONRPC(u'VideoLibrary.RemoveMovie', ????), but how do I encode the "movieid=1234" part?
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Sun Aug 06, 2017 9:59 pm
by jonib
egbaud wrote:How do I translate this: xbmc.VideoLibrary.RemoveMovie(movieid=1234) into XBMC2 form.
I know the first part is eg.plugins.XBMC2.JSONRPC(u'VideoLibrary.RemoveMovie', ????), but how do I encode the "movieid=1234" part?
Code: Select all
eg.plugins.XBMC2.JSONRPC(u'VideoLibrary.RemoveMovie', [1234] )
or
Code: Select all
eg.plugins.XBMC2.JSONRPC(u'VideoLibrary.RemoveMovie', {"movieid": 1234} )
I did not test but should work, post again if not.
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Mon Aug 07, 2017 5:32 pm
by egbaud
Thank you! Worked perfectly.
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Mon Aug 14, 2017 10:25 am
by MaxMan23
Hello. Can someone help me with a python script. I want to send clear signals for play pause (not toggle). If an Event comes for Pause a script should be executed. And if an Event comes for Play another script should be executed.
Someone wrote this as an example:
def getVideoPlaying():
videoPlaying = 0
activePlayer = eg.plugins.XBMC2.JSONRPC(u'Player.GetActivePlayers', u'', False)
if activePlayer:
if activePlayer[0]["type"] == "video":
mediaSpeed = eg.plugins.XBMC2.JSONRPC(u'Player.GetProperties', u'1,["speed"]', False)["speed"]
if mediaSpeed > 0:
videoPlaying = 1
return videoPlaying
I need something like this (for Pause):
def getVideoPlaying():
videoPlaying = 0
activePlayer = eg.plugins.XBMC2.JSONRPC(u'Player.GetActivePlayers', u'', False)
if activePlayer:
if activePlayer[0]["type"] == "video":
mediaSpeed = eg.plugins.XBMC2.JSONRPC(u'Player.GetProperties', u'1,["speed"]', False)["speed"]
if mediaSpeed > 1:
eg.plugins.XBMC2.JSONRPC(u'Player.PlayPause.....
Here is an Json Example:
{"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 0 }, "id": 1}
Can someone help me with the right format for the script, please. And can anyone tell me if this could work?
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Mon Aug 14, 2017 3:16 pm
by jonib
MaxMan23 wrote:Hello. Can someone help me with a python script. I want to send clear signals for play pause (not toggle). If an Event comes for Pause a script should be executed. And if an Event comes for Play another script should be executed.
Code: Select all
Can someone help me with the right format for the script, please. And can anyone tell me if this could work?[/quote]I would start with these actions:
[code]XBMC2->Actions->Media playing->Play
XBMC2->Actions->Media playing->Pause
"Play" will only start playback and resume playback if paused, "Pause" will pause and resume playback if paused but not start.
As "Pause" works as a semi toggle, try this for a pure pause, something must be playing for it to work:
Code: Select all
{"jsonrpc": "2.0", "method": "Player.PlayPause", "params": {"playerid": 1, "play": False}, "id": 1}
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Tue Aug 15, 2017 10:31 am
by MaxMan23
"Pause" will pause and resume playback if paused but not start.
If i press Pause two times, playback should not start again.
Can you help me with the right format:
eg.plugins.XBMC2.JSONRPC(u'Player.PlayPause
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Tue Aug 15, 2017 2:59 pm
by jonib
MaxMan23 wrote:Can you help me with the right format:
Put this in a "Python script" action:
Code: Select all
activePlayer = eg.plugins.XBMC2.JSONRPC(u'Player.GetActivePlayers', u'', False)
if activePlayer:
eg.plugins.XBMC2.JSONRPC(u'Player.PlayPause', u'{0},False'.format(activePlayer[0]['playerid']), False)
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Aug 30, 2017 2:49 pm
by Foune
jonib wrote:Plugin updated to 0.6.35, get it on
Github, only the
Thank you for your work. I stopped using this xbmc plugin some years ago because of compatibility problems. I'll try your code ASAP.
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Sep 13, 2017 9:36 pm
by enobhsiw
Hi,
I am very new to EG. Im trying to launch Kodi on my 'Always On' Windows 10 Enterprise x64 laptop, using the 'Wake on LAN' feature on Official Kodi Remote on my Iphone.
I tried using Broadcaster and XBMC Event Receiver aswell, and configured the UDP port to 9, but I recieve the following error:
Code: Select all
error: uncaptured python exception, closing channel <eg.CorePluginModule.XBMCEventReceiver.Server connected :9 at 0x4a1ccb0> (<type 'exceptions.UnicodeDecodeError'>:'utf8' codec can't decode byte 0xff in position 0: unexpected code byte [asyncore.pyc|read|76] [asyncore.pyc|handle_read_event|414] [C:\Program Files (x86)\EventGhost\plugins\XBMCEventReceiver\__init__.py|handle_read|110] [encodings\utf_8.pyc|decode|16])
Please help, and guide me on what I could do to achieve what I am trying to do.
Thanks in advance.
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Thu Sep 14, 2017 5:43 am
by jonib
enobhsiw wrote:Hi,
I am very new to EG. Im trying to launch Kodi on my 'Always On' Windows 10 Enterprise x64 laptop, using the 'Wake on LAN' feature on Official Kodi Remote on my Iphone.
I tried using Broadcaster and XBMC Event Receiver aswell, and configured the UDP port to 9, but I recieve the following error:
Code: Select all
error: uncaptured python exception, closing channel <eg.CorePluginModule.XBMCEventReceiver.Server connected :9 at 0x4a1ccb0> (<type 'exceptions.UnicodeDecodeError'>:'utf8' codec can't decode byte 0xff in position 0: unexpected code byte [asyncore.pyc|read|76] [asyncore.pyc|handle_read_event|414] [C:\Program Files (x86)\EventGhost\plugins\XBMCEventReceiver\__init__.py|handle_read|110] [encodings\utf_8.pyc|decode|16])
Please help, and guide me on what I could do to achieve what I am trying to do.
Thanks in advance.
There is no "Wake on LAN" specific functionality in the XBMC2 plugin and I don't support the Official Kodi remote or IPhone so can't help with any of it.
Also I don't support the "XBMC Event Receiver" plugin (Support for it is
here), I do support the XBMC broadcast events in the XBMC2 plugin but it probably is NOT supported in the version of Kodi/XBMC you are using.
I see that kgschlosser pointed you here, So start by removing the "XBMC Event Receiver" plugin and if you are using a very old version of XBMC (11 or older) activate broadcast events in the XBMC2 options. But I don't think WakeOnLAN is related to this.
So what is not working except for the error you are receiving?
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Thu Sep 14, 2017 9:11 pm
by enobhsiw
jonib wrote:
There is no "Wake on LAN" specific functionality in the XBMC2 plugin and I don't support the Official Kodi remote or IPhone so can't help with any of it.
Also I don't support the "XBMC Event Receiver" plugin (Support for it is
here), I do support the XBMC broadcast events in the XBMC2 plugin but it probably is NOT supported in the version of Kodi/XBMC you are using.
I see that kgschlosser pointed you here, So start by removing the "XBMC Event Receiver" plugin and if you are using a very old version of XBMC (11 or older) activate broadcast events in the XBMC2 options. But I don't think WakeOnLAN is related to this.
So what is not working except for the error you are receiving?
jonib
Hi Jonib,
I am using the Kodi Kryptop 17.4 version. So far I stopped with the launching of the application(Kodi) using the 'Wake on LAN' feature of the remote of the app.
Will ask for help for the rest if I run into any trouble.
Thanks for the help

Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Fri Sep 15, 2017 6:37 am
by jonib
enobhsiw wrote:Will ask for help for the rest if I run into any trouble.
Good
Thanks to you I finally looked into using WakeOnLan for my HTPC, and got it working when in sleep mode. Now I can have it go to sleep and be able to wake it up when I need to do some testing when I'm developing the XBMC2 plugin, cool
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Sun Dec 17, 2017 3:50 am
by dennyhle
I've had this working before but it's been a while since the last time I had to reconfigure it on a fresh install of Kodi but I cannot get any events to show up on the event log on the left side of EG. Particularly I want to be able to detect when Kodi is playing or pausing a video. I downloaded the latest version of EG. I believe I set up the connections correctly. It does not spit out any errors upon initializing or anything like that.
Any ideas?
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Mon Dec 18, 2017 9:05 am
by jonib
dennyhle wrote: Sun Dec 17, 2017 3:50 amAny ideas?
To get events from Kodi/XBMC you need to activate "JSON-RPC notifications" in the XBMC2 plugins settings.
You also need to activate some stuff in Kodi settings, "Services->UPnP->Allow control of Kodi via UPnP" needs to be activated so the XBMC2 plugin detects when Kodi is starting.
You might need to activate "Services->Remote control->Allow programs on other systems to control Kodi".
What do you get when pressing the "Test" button in the XBMC2 config?
edit: Also what version EventGhost/XBMC2 plugin/Kodi are you using?
jonib
xbmc2 jsonrpc TypeError: __call__() takes at most 4 arguments (5 given)
Posted: Fri Dec 22, 2017 8:17 pm
by dave305
I have been using version 0.4.r1700 for years with no problems, but wanted to get mqtt going and thought I would upgrade eventghost. I installed 0.5.0-rc4, big mistake I had errors everywhere so I uninstalled it and went to version 0.4.1.r1710 and that is when the errors below started. I then decided to go back to my org version 0.4.1.r1700, but the errors still continue.
Error in Action: "XBMC2: JSONRPC: Input.ExecuteAction: Live TV"
Traceback (most recent call last) (1700):
File "E:\Root\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
return self(*args)
TypeError: __call__() takes at most 4 arguments (5 given)
If I try to edit the action EG freezes solid. I am at my wits end with this one. I searched google, but couldn't find really anything that helped much. Any insight will be helpful.