SV: Named parameters and XBMC

Skip to first unread message

Daniel Rydström

Nov 9, 2013, 4:42:58 PM11/9/13
Hello. I am sorry to say that I never saw this through. I hope you succeed in your efforts!

Best regards /Daniel

Från: Clément Cloom
Skickat: ‎2013-‎11-‎08 10:05
Ämne: Re: Named parameters and XBMC

Hello Daniel,

Did you figure this out? I want to do the same, I succeeded with another piece of code I have found there:

but I would like to use jsonrpclib to make the code easier to read and less complicated. I also want to use jsonrpclib to have a server running on my pi to switch on and off the light in my living room. Long story short I want a cinema button on my XBMC remote control to switch off the big lights and put the small ones when I run a movie :) I don't want to use different jsonrpc lib/scripts and jsonrpclib looks perfect for what I have to do.

So Daniel if you can help me here that would be much appreciated!

Here is the simple piece of code I tried:
>>> import jsonrpclib
>>> server = jsonrpclib.Server('')
>>> print server.Player.GetActivePlayers()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/", line 276, in __call__
    return self.__send(self.__name, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/", line 224, in _request
    response = self._run_request(request)
  File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/", line 254, in _run_request
    return_obj = loads(response)
  File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/", line 507, in loads
    result = jloads(data)
  File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/", line 105, in jloads
    return json.loads(json_string)
  File "/usr/lib/python2.7/json/", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/", line 383, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

On Wednesday, January 30, 2013 10:28:19 PM UTC+1, wrote:
Hello I'm trying to figure out how to use JSONRPClib with XBMC 12 Frodo (RC3). What I want to do is basically check what is happening in XBMC; if something is playing or if sleep mode is activated. I found on the XBMC forum that the following call should be correct to use for XBMC Frodo

{"params": { "booleans": ["library.isscanning"] }, "jsonrpc": "2.0", "method": "XBMC.GetInfoBooleans", "id": 1},

if I wish to check if the library scan function is active. My question to you is, how to translate this into a JSONRPClib call. I ran Introspect that gave me the following print out for 

>> intr = server.JSONRPC.Introspect()
>> print intr['methods']['XBMC.GetInfoBooleans']:

{u'params': [{u'minItems': 1, u'items': {u'type': u'string'}, u'required': True, u'type': u'array', u'name': u'booleans'}], u'returns': {u'additionalProperties': {u'default': u'', u'type': u'string'}, u'type': u'object', u'description': u'Object containing key-value pairs of the retrieved info booleans'}, u'type': u'method', u'description': u'Retrieve info booleans about XBMC and the system'}

I guess the start should be something along the lines of "server.XBMC.GetInfoBooleans", but I have no idea how to use the params...

Regards /Daniel

You received this message because you are subscribed to a topic in the Google Groups "JSONRPClib (Python)" group.
To unsubscribe from this topic, visit
To unsubscribe from this group and all its topics, send an email to
For more options, visit
Reply all
Reply to author
0 new messages