Catching XBMC events
#1
Is there a way of catching XBMC events in Eventghost, or something similar that in turn might notify eventghost? A way that will not be deprecated in the near future?

I want to catch events like play, pause, screensaver on, screen saver off, etc...

Thanks.
Reply
#2
XBMC broadcasts events via the JSON-RPC interface.
Telnet to your XBMC box on port 9090 and you'll see JSON objects when XBMC does something.
You have to have enable external control enabled in the system settings.
Example announcements from XBMC:
Code:
{
    "jsonrpc" : "2.0",
    "method" : "Announcement",
    "params" : {
        "message" : "PlaybackStarted",
        "sender" : "xbmc"
    }
}
{
    "jsonrpc" : "2.0",
    "method" : "Announcement",
    "params" : {
        "message" : "PlaybackSpeedChanged",
        "sender" : "xbmc"
    }
} {
    "jsonrpc" : "2.0",
    "method" : "Announcement",
    "params" : {
        "message" : "PlaybackStopped",
        "sender" : "xbmc"
    }
}
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#3
No, or at least no easy way. What are you trying to do?

1 minute later: apart from JSON of course :-)

JR
Reply
#4
I want to turn off my tv when screen saver gets activated, and turn on my tv when screen saver gets deactivated.

I have the actions to switch TV off and on in Eventghost, but no events to pair them with.

Thanks.
Reply
#5
Doesn't sound like your a coder, but you'd have to write a listener that listens for that event and sends it to eventghost.

Can you possible just bind the tv on/off to the System.Idle event? You can customize the idle time if you need.
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#6
Just been a coder in c/c++ console apps for the last 15 years. So what you are saying might be a tad difficult. I don't want system idle because I have my system wide screen saver off, and only xbmc screen saver on. I am usually working on my primary display. I want only the tv switching off when xbmc screen saver gets activated.
Reply
#7
Is there a working sample listener example somewhere?
Reply
#8
Anyways does XBMC broadcast screen saver notifications?

I though I could add python calls to the slideshow screensaver addon, but sadly it seems all the functionality is inbuilt and not an addon.

I can turn my tv on and off using rs232. So it should be doable using pyserial or something like that. Only problem is where to make those calls from.
Reply
#9
bradvido88 Wrote:XBMC broadcasts events via the JSON-RPC interface.
Telnet to your XBMC box on port 9090 and you'll see JSON objects when XBMC does something.
You have to have enable external control enabled in the system settings.
Example announcements from XBMC:
Code:
{
    "jsonrpc" : "2.0",
    "method" : "Announcement",
    "params" : {
        "message" : "PlaybackStarted",
        "sender" : "xbmc"
    }
}
{
    "jsonrpc" : "2.0",
    "method" : "Announcement",
    "params" : {
        "message" : "PlaybackSpeedChanged",
        "sender" : "xbmc"
    }
} {
    "jsonrpc" : "2.0",
    "method" : "Announcement",
    "params" : {
        "message" : "PlaybackStopped",
        "sender" : "xbmc"
    }
}
Yes I can see those announcements on that port. Unfortunately when the screen saver kicks in there is no announcement.
Reply
#10
Does the skin get notified when the screen saver gets activated/deactivated?
Reply
#11
ndeshmukh Wrote:Yes I can see those announcements on that port. Unfortunately when the screen saver kicks in there is no announcement.
You'll have to ask a dev to add that announcement in then. Or save them the work and submit a patch yourself.
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply

Logout Mark Read Team Forum Stats Members Help
Catching XBMC events0