Support for XBMC2 plugin (formerly XBMCRepeat)

Questions and comments specific to a particular plugin should go here.
jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Tue Jun 18, 2013 8:28 pm

Armymanbrad wrote:I would appreciate it so much if some one could walk me through or send me a detailed step by step link my heads spinning lol.
(Hope it's Sunday somewhere :oops: )
So I finally had a chance to look into how to get events from Cinema Experience.

First you need the Cinema Experience plugin installed in XBMC, and then configure it to send events.
Then you need a XBMC skin that supports Cinema Experience, then activate it in the skins settings.
Now you need to put the EventGhost specific "home_automation.py" from here in (XBMC profile dir)\userdata\addon_data\script.cinema.experience\ha_scripts\

Now Cinema Experience should be sending events.

To get the events in EventGhost:

You need to get this test version and put it in "(EventGhost install dir)\plugins\XBMCRepeat\", then (re)start EventGhost.
Then add it (If you haven't already) from EventGhosts "Add plugin" menu.
Then you need to configure it (Double clicking on XBMC2 in autostart), the IP and port need to be correct and then you need to activate "Broadcast events".

With "Log only assigned and activated events" unchecked you should see events like this:

Code: Select all

XBMC2.Broadcast.CE_Automatescript_start
Then you can drag the event to any macro(s) you have in EventGhost.

Hopefully this is detailed enough, there seems to be a lot of settings in Cinema Experience if you need help with those ask in the Cinema Experience thread.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

mwkurt
Posts: 4
Joined: Sun Jun 27, 2010 3:13 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by mwkurt » Fri Jun 21, 2013 10:57 pm

Hello Jonib,

Was wondering if your plugin can do the following: send an event when an XBMC script starts and when the same script stops? More specifically the PseudoTV script. Would be great to be able to send an event for a script start/stop.
I am using XBMC Frodo, Windows 7.

Thanks,
Mark

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Sat Jun 22, 2013 1:28 am

mwkurt wrote:Was wondering if your plugin can do the following: send an event when an XBMC script starts and when the same script stops? More specifically the PseudoTV script. Would be great to be able to send an event for a script start/stop.
If either XBMC or the PseudoTV plugin (or possibly a support plugin) creates an event when it's started or stopped, my XBMC2 plugin will show it in EventGhost. The XBMC2 plugin just shows the events as they come.

If there is no such events, I think the best place is to ask in the XBMC JSON-RPC forum or possibly the PseudoTV thread.

Just in case, you need the latest "test" version for JSON-RPC events support.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

blaher
Experienced User
Posts: 494
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher » Thu Jul 11, 2013 12:33 am

Just a little thing I ran into: the fullscreen toggle works well, but apart from adding this:

<fullscreen>true</fullscreen> to advancedsettings.xml

I can't seem to get xbmc.exe to boot fullscreen, if it was shut down in a windowed mode. A 'command line option' of '-fs', without quotes, used to do it, but seems ineffectual now...

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Thu Jul 11, 2013 2:46 am

blaher wrote:<fullscreen>true</fullscreen> to advancedsettings.xml
As far as I know it's the only way.
A 'command line option' of '-fs', without quotes, used to do it, but seems ineffectual now...
It was removed (don't know why) in XBMC 10 I believe and replaced with the option in advancedsettings.xml.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

blaher
Experienced User
Posts: 494
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher » Thu Jul 11, 2013 3:31 am

jonib wrote:
blaher wrote:<fullscreen>true</fullscreen> to advancedsettings.xml
As far as I know it's the only way.
A 'command line option' of '-fs', without quotes, used to do it, but seems ineffectual now...
It was removed (don't know why) in XBMC 10 I believe and replaced with the option in advancedsettings.xml.

jonib
Cheers for the information.

millsx2
Posts: 10
Joined: Thu Aug 15, 2013 5:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by millsx2 » Thu Aug 15, 2013 6:06 am

Hello jonib,

I have been using your latest test version (version = "0.6.9",) and everything works great when starting up. I have even been able to pull episode details and display them on the screen. The problem I run into is when loading a video playlist. The playlist will play alright, but once I try and fast forward or even stop the playlist I get a ton of JSON.playlist.OnAdd errors in the log. When I try and power down XBMC I get even more of these errors and eventghost will eventually freeze or it will end with "memory" error. The playlists are quite big so I am not sure if that is the issue, with trying to load 500 or so videos into a playlist.

I have attached a screenshot of the errors I get. This is only a couple of them because I wanted you to see everything works at first. But in actuality the errors will repeat over and over. Any ideas what could be causing this?

Any help would be appreciated. BTW - excellent work on the plugin!

-Mills
Attachments
eventghost_XBMC.jpg

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Thu Aug 15, 2013 11:29 am

millsx2 wrote:I have been using your latest test version (version = "0.6.9",) and everything works great when starting up.
Great.
I have even been able to pull episode details and display them on the screen.
Nice.
The problem I run into is when loading a video playlist. The playlist will play alright, but once I try and fast forward or even stop the playlist I get a ton of JSON.playlist.OnAdd errors in the log.
Hmm, that's bad, m'kay.
When I try and power down XBMC I get even more of these errors and eventghost will eventually freeze or it will end with "memory" error.
Hmm, that's worse. It kinda reminds me of a problem I thought I had fixed before, damn.
The playlists are quite big so I am not sure if that is the issue, with trying to load 500 or so videos into a playlist.
If XBMC can handle the playlist there shouldn't be a problem in the XBMC2 plugin. Possibly if you try to get a big list of items from XBMC.
I have attached a screenshot of the errors I get. This is only a couple of them because I wanted you to see everything works at first. But in actuality the errors will repeat over and over. Any ideas what could be causing this?
Unfortunately the log don't show the full errors (the lines in red) so don't help me much, if you can copy the lines and post or resize the window so I can see them fully, I should be able to fix the problem.
BTW - excellent work on the plugin!
Why thank you, and now I feel even more guilty not having finished it. :oops:

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

millsx2
Posts: 10
Joined: Thu Aug 15, 2013 5:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by millsx2 » Thu Aug 15, 2013 2:19 pm

Here is one error code(red item). Keep in mind the log is filled with hundreds of these lines. After looking at the text file and seeing how big the actual error code is, I think I can understand why eventghost is crashing.
Attachments
error_code.txt
(299.17 KiB) Downloaded 171 times

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Thu Aug 15, 2013 6:51 pm

millsx2 wrote:Here is one error code(red item).
Thanks.
Keep in mind the log is filled with hundreds of these lines. After looking at the text file and seeing how big the actual error code is, I think I can understand why eventghost is crashing.
Yikes :shock: Definitely not something I considered in the code, hopefully it's something I can handle.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Fri Aug 16, 2013 12:25 pm

@millsx2 test the attached test version (just put it in EventGhost install dir\plugins\XBMCRepeat)

It looks like I might have fixed the problem already in a debug version here. The attached file is mostly the same I just disabled it from writing a log when not in debug mode. Hopefully there is no new bugs/problems with it.

jonib
Attachments
__init__.py
XBMC2 Test version 0.6.10
(97.99 KiB) Downloaded 232 times
XBMC2 plugin to control XBMC. If you want to flatter me Image

millsx2
Posts: 10
Joined: Thu Aug 15, 2013 5:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by millsx2 » Sat Aug 17, 2013 6:41 pm

That worked great jonib!

Thanks for your help and keep up the great work on this plugin.

-Millsx2

millsx2
Posts: 10
Joined: Thu Aug 15, 2013 5:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by millsx2 » Wed Aug 21, 2013 4:32 pm

Does anyone know of a way to size the OSD display or perhaps add /n or returns into an {eg.results} phython script? I am trying to display the plot of a tv show using the JSON method when I press a button. The problem is the plot can be quite long and will go off the screen due to the length. So I either need a way to size the OSD display box or I need help in adding spaces to a eq.results script.

FYI - The script I am currently using is something like this.

Python Script:
PlayerID = eg.plugins.XBMC2.JSONRPC(u'Player.GetActivePlayers', u'', False)[0]['playerid']
eg.result = eg.plugins.XBMC2.JSONRPC(u'Player.GetItem', u"["+str(PlayerID)+",['plot','file']]", False)

OSD Display:
eg.result['item']['plot']

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Wed Aug 21, 2013 8:50 pm

millsx2 wrote:Does anyone know of a way to size the OSD display or perhaps add /n or returns into an {eg.results} phython script? I am trying to display the plot of a tv show using the JSON method when I press a button. The problem is the plot can be quite long and will go off the screen due to the length. So I either need a way to size the OSD display box or I need help in adding spaces to a eq.results script.
So it was not as simple as I thought, but this seems to work:

Put the below code last in your Python script and disable the "Show OSD" action you have now:

Code: Select all

import textwrap
eg.plugins.EventGhost.ShowOSD('\n'.join(textwrap.wrap(eg.result['item']['plot'],20)), u'0;-24;0;0;0;700;0;0;0;1;0;0;2;32;Arial', (255, 255, 255), (0, 0, 0), 4, (0, 0), 1, 3.0, False)
I couldn't figure out how to do the "import textwrap" in the Show OSD action so I moved the Show OSD action to the Python script. So you will probably need to change the other parameters, just check what your Show OSD has for settings.

You can change the "20" from '['plot'],20' to specify how many characters per line you want.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

blaher
Experienced User
Posts: 494
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher » Thu Aug 22, 2013 3:35 am

I'm using the 0.6.10 above and got this error:

Code: Select all

13:28:24   XBMC2.System.OnQuit 0
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications.
13:28:25   XBMC2: Connected to XBMC ( 127.0.0.1 : 9090 ), ready to recive JSON-RPC notifications.
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2.System.OnStart
13:28:25   XBMC2: JSON socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
13:28:25   XBMC2: Disconnected from XBMC, not receiving JSON-RPC notifications. 
Hope it helps.

Post Reply