Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Support for XBMC2 plugin (formerly XBMCRepeat)

Questions and comments specific to a particular plugin should go here.
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher »

blaher wrote:I'm using version 0.6.3e, which as far as I can tell is the latest beta, and I just got the following error:

Error: JSON-RPC event (<type 'exceptions.KeyError'>, KeyError('item',), <traceback object at 0x04699058>)
I turned on raw events, like you suggested, jonib, so hopefully this helps more:

20:29:01 Error: JSON-RPC event (<type 'exceptions.KeyError'>, KeyError('item',), <traceback object at 0x0461C3F0>)

20:29:01 Raw event: {u'params': {u'data': {u'type': u'movie', u'id': 1878}, u'sender': u'xbmc'}, u'jsonrpc': u'2.0', u'method': u'VideoLibrary.OnRemove'}

http://i.imgur.com/xKEV5.png
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

blaher wrote:I turned on raw events, like you suggested, jonib, so hopefully this helps more:
Thanks, now I can see the problem. Looks like I assumed some stuff wrong about the events, I'll try to make it more robust and to show better error message when there is an unsupported event.

You can disable the "Show raw events" if you like I don't think it's needed anymore.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
User avatar
FCB38
Experienced User
Posts: 50
Joined: Mon Nov 28, 2011 10:28 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by FCB38 »

Hello,

I find the function XBMC2: Minimize in the plugin XBMC2. Very cool! But where is the function XBMC2: Maximise ? How can I maximize XBMC (Restore XBMC in full screen mode) without using this:
Find Window: XBMC.exe
Maximize
Thanks.
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher »

Try find window: xbmc.exe
Bring to front

Minimise didn't work for me, (presumably because I use fullscreen), so I use {alt+tab} instead.
User avatar
FCB38
Experienced User
Posts: 50
Joined: Mon Nov 28, 2011 10:28 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by FCB38 »

I use for the moment "find window:XBMC.exe" and "Maximize". It's working almost always but is somes cases not.
That's why I would like that a command "XBMC2:maximize" exists. But for the moment that's not the case.

Perhapps a new command in the next version of the plugin XBMC2? Who can create this?

For blaher:
To minimize I use a script from Pako : viewtopic.php?f=2&t=3578
And it's working very well.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

To anybody waiting for a response from me, sorry for not responding earlier. I have been dealing with some health stuff that make me rather unproductive, and any response that required me to do any research, I had to wait until I was up to it.
FCB38 wrote:I find the function XBMC2: Minimize in the plugin XBMC2. Very cool! But where is the function XBMC2: Maximise ? How can I maximize XBMC (Restore XBMC in full screen mode) without using this:
Well for some reason I haven't been able to find, there is no maximize/restore function in XBMC. Here is a list of functions in XBMC. Some might be missing so here should be a complete list.
I did find some requests for a maximize function here and here, but they did not get any responses and was closed.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

FCB38 wrote:I use for the moment "find window:XBMC.exe" and "Maximize". It's working almost always but is somes cases not.
"Find Window: XBMC.exe" and "Bring to front" works fine for me. Have you tried that?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

Lunatixz wrote:No firewall or AV, XBMC is on the same system as eventghost; i'm running 11.01 final (EDEN) System receives json and broadcast events but won't build the dat for jsonrpc... I checked my appdata folders but no file, I have no problem building the httpapi dat...
Can you use the normal actions from XBMC2\Buttons, XBMC2\Actions and XBMC2\Windows?
Can you use the HTTPAPI action?

Only thing I can think of is that the first port in the XBMC2 config doesn't match what you have set in XBMC, or you haven't configured XBMC to accept external control. I'll add more debug stuff and better error messages in the next (test) version.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher »

FCB38 wrote: For blaher:
To minimize I use a script from Pako : viewtopic.php?f=2&t=3578
And it's working very well.
As far as I can tell, that script is for determining whether an application is running full-screen or not, but that is not necessary for me, because XBMC is always running full-screen.

For some reason the minimise function in XBMC doesn't work all the time, so I use {alt + tab} instead. Just to clarify, I don't use fullscreen window, but rather a true fullscreen.

Thanks anyway, it might be handy to know in the future. :-)
User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Livin »

Joni,
I have not been using the JSON API art of your plugin for a while but decided to use it again... but now I'm getting an error connecting....
22:34:40 XBMC - enable JSON
22:34:40 XBMC2.JSONRPCEventsConnect()
22:34:40 Error in Action: "XBMC2.JSONRPCEventsConnect()"
22:34:40 Traceback (most recent call last) (1572):
22:34:40 File "<string>", line 1, in <module>
22:34:40 NameError: name 'XBMC2' is not defined
... using EG version 0.4.1 r1572 and XBMC2 latest version 'e' and XBMC Frodo Alpha 6.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

Livin wrote:Joni,
I have not been using the JSON API art of your plugin for a while but decided to use it again... but now I'm getting an error connecting....

... using EG version 0.4.1 r1572 and XBMC2 latest version 'e' and XBMC Frodo Alpha 6.
I'm not sure from your error if this is the only problem.
But I haven't made the plugin compatible with Frodo yet, look here for a temporary fix.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Livin »

The error occurs when running "XBMC2.JSONRPCEventsConnect()" ... I thought we had to run this when XBMC starts up in order for EG (your plugin) to connect?
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

Livin wrote:The error occurs when running "XBMC2.JSONRPCEventsConnect()" ... I thought we had to run this when XBMC starts up in order for EG (your plugin) to connect?
You need to run it to activate JSON-RPC events only. I don't think any JSON-RPC actions work with Frodo unless you use the fix I linked or I actually get a new version out. :cry:

I'll try to make a new version this week, that supports Frodo and fixes any bugs reported.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Livin »

Ignore the 'error' I've been talking about... if all else fails, delete and recreate the action. Something happened to the action, in EG that corrupted it. Once I deleted that action and created it again, it started working.

BUT when I'm trying to create custom Actions it seems that the "Update" button is throwing an error...

Code: Select all

11:25:30   XBMC2: JSONRPC: .
11:25:30      Error in Action: "XBMC2: JSONRPC: ."
11:25:30      Traceback (most recent call last) (1572):
11:25:30        File "C:\Users\ha\Documents\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
11:25:30          return self(*args)
11:25:30        File "C:\Users\ha\Documents\EventGhost\plugins\XBMC2\__init__.py", line 895, in __call__
11:25:30          responce = self.plugin.JSON_RPC.send(method, ast.literal_eval(ParseString2(param)))
11:25:30        File "C:\Users\ha\Documents\EventGhost\plugins\XBMC2\__init__.py", line 553, in ParseString2
11:25:30          res = eval(word, {}, eg.globals.__dict__)
11:25:30        File "<string>", line 1, in <module>
11:25:30      TypeError: 'NoneType' object is unsubscriptable
11:26:02   JSON-RPC connection error: http://127.0.0.1:8080
11:26:02   {"jsonrpc": "2.0", "id": 1, "method": "JSONRPC.Version"}
11:26:02   Error opening: jsonrpc.dat

One thought/suggestion... since JSON is a PITA, it might be good to create/share EG macros that expose (capture/log/variablize) a standard set of info people will use the most... filename, moviename, songname, episode title, etc. Can you package these in the plugin itself?
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

Livin wrote:Ignore the 'error' I've been talking about... if all else fails, delete and recreate the action. Something happened to the action, in EG that corrupted it. Once I deleted that action and created it again, it started working.
OK
BUT when I'm trying to create custom Actions it seems that the "Update" button is throwing an error...
Did you do the fix from here? Or else it can't work as Frodo is more strict when sending commands to XBMC.
One thought/suggestion... since JSON is a PITA, it might be good to create/share EG macros that expose (capture/log/variablize) a standard set of info people will use the most... filename, moviename, songname, episode title, etc. Can you package these in the plugin itself?
I don't think I can add any macros to the plugin directly, I would need to create specific actions in that case. When I'm finished with the JSON-RPC part I'll see what can be made easier. I could link to ready made macros from the plugin and this thread, but that will have to be after I finish the next proper release.

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