XBMC Event Receiver

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
vortexrotor
Posts: 8
Joined: Thu Dec 24, 2009 1:30 am

XBMC Event Receiver

Post by vortexrotor » Sat Dec 26, 2009 5:33 pm

This is a plugin that is based on the good work that Bitmonster and KingD did regarding Broadcast Receiver / Listener but has many enhancements specific to XBMC.

Code Status: GA/Mature

This plugin enables the UDP Event Broadcast functionality of the user defined XBMC Host (configurable within the plugin) and listen's for events generated over UDP by the XBMC Host and parses and logs an event(s) to eventghost so the user can do just about anything with that to generate another event to act upon within EG.

A readme is included in the attached zip file.

As time permits I will update the link below with up to date versions.

For added future benefit, I am working on an HTTP.API integration functionality plugin and will incorporate/consolidate this into the plugin in a subsequent up-coming release for full two-way XBMC capability.

Feel free to use, modify and suggest mods as you see fit.

As far as installation... you know the drill! Enjoy! :D
Attachments
XBMCEventReceiver_v2.0.zip
(8.73 KiB) Downloaded 2590 times

rickardk
Posts: 14
Joined: Thu Dec 31, 2009 3:16 pm

Re: XBMC Event Receiver

Post by rickardk » Thu Dec 31, 2009 4:46 pm

Great plugin!!!

Do you know if there is a way in EventGhost to match partial event name?
I would like to trigger a macro just on movie playback.

XBMC-Event.<b>MediaChanged:<li>MovieTitle:The Pony Remark;192.168.0.3;1</b>

The event contains the title (wich of course is variable). So I would like to use an asterix or something like partial event matching. Any ideas?

Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: XBMC Event Receiver

Post by Bartman » Thu Dec 31, 2009 5:32 pm

Normaly the different sections should be separated with points and highly variable data should be put in the payload of the event.

rickardk
Posts: 14
Joined: Thu Dec 31, 2009 3:16 pm

Re: XBMC Event Receiver

Post by rickardk » Fri Jan 01, 2010 12:06 pm

Thanks!
So "XBMC-Event.<b>MediaChanged:<li>MovieTitle:The Pony Remark;192.168.0.3;1</b>" should be formated like this:
"XBMC-Event.MediaChanged.MovieTitle ['The Pony Remark', '192.168.0.3']" to be more useful??

What I'm looking for is "MovieTitle" as this indicates that a video file is played and trigger a macro on this.
For audio I should be looking for "AudioTitle" to trigger macros on audio playback.

Is there anyway to parse the event name and create a new event with proper formating?

Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: XBMC Event Receiver

Post by Bartman » Fri Jan 01, 2010 12:09 pm

make a python script and access the prefix and suffix of the eg.event variable.

rickardk
Posts: 14
Joined: Thu Dec 31, 2009 3:16 pm

Re: XBMC Event Receiver

Post by rickardk » Fri Jan 01, 2010 5:39 pm

Thanks!

I now parse the event created by XBMC Event Receiver and create (for me) more usable events.
A little problem remains though. The "XBMC.<b>MediaChanged:<li>MovieTitle:Whatever;1</b>" shows when starting a new video file. But if you start and resume the same file this is never shown.
Is there anything else that is broadcasted by XBMC that a future version of the XBMC Event Receiver plugin can make use of to tell what kind (video or audio) of media that is played/started/resumed?

rickardk
Posts: 14
Joined: Thu Dec 31, 2009 3:16 pm

Re: XBMC Event Receiver

Post by rickardk » Sat Jan 02, 2010 3:22 am

The above should be solved if the plugin could retrieve media type ("Type:Audio" or "Type:Video") from /xbmcCmds/xbmcHttp?command=getcurrentlyplaying on every "OnPlaybackStarted" and "OnPlaybackResumed" instead of just on "OnMediaChange" I think.

Events like this:
XBMCEvent.OnPlaybackResumed.Video.[Title of movie][IP]
XBMCEvent.OnPlaybackStarted.Audio.[Artist, Album, Song][IP]

or something like that...

Would also be great to get an event with playback status (and details) on request. An action that uses http://xbox/xbmcCmds/xbmcHttp?command=g ... tlyplaying
on demand?

vortexrotor
Posts: 8
Joined: Thu Dec 24, 2009 1:30 am

Re: XBMC Event Receiver

Post by vortexrotor » Tue Jan 05, 2010 1:57 am

Hello Everyone,

I am currently working on "all the above" with the integration of the HTTP.API capability of XBMC within the plugin itself which should solve alot of those issues.

Regarding the parsing script you put together "MOD". If you can share that with me, I can include/integrate it into the plugin so everyone can benefit. ;-)

Thanks for everyone's comments!

JustGav
Posts: 9
Joined: Mon Apr 27, 2009 2:39 pm

Re: XBMC Event Receiver

Post by JustGav » Tue Mar 02, 2010 12:25 am

Just spotted your post your post in the XBMC thread.

Grabbed your plugin, having some minor hassles because I use authentication on my system. Going to see what I can do.

Looks interesting though :)

EDIT : Eventghost under win7 issue (needed to run as administrator, doh!) :)

giantpopples
Posts: 13
Joined: Fri Mar 26, 2010 7:34 pm

Re: XBMC Event Receiver

Post by giantpopples » Sun May 23, 2010 5:04 pm

Hi !

I just installed your plugin and it's working great !

How is the development going ? I see that you try to implement the httpAPI to get more information on what's playing etc.. This is the only feature missing !

There is also a JSON-RPC API that is in development, maybe you could also have a look on it ? I don't know if it would be harder to implement but it seems to replace the older HTTPApi in the future.

Thanks again !!

jesterod
Posts: 44
Joined: Mon Sep 13, 2010 11:09 am

Re: XBMC Event Receiver

Post by jesterod » Wed Sep 15, 2010 4:29 pm

so how do i use this?

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

Re: XBMC Event Receiver

Post by jonib » Wed Sep 15, 2010 9:49 pm

jesterod wrote:so how do i use this?
Did you read the Readme.txt in the .Zip achieve?

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

jesterod
Posts: 44
Joined: Mon Sep 13, 2010 11:09 am

Re: XBMC Event Receiver

Post by jesterod » Wed Sep 15, 2010 9:52 pm

:oops: no....

vortexrotor
Posts: 8
Joined: Thu Dec 24, 2009 1:30 am

Re: XBMC Event Receiver

Post by vortexrotor » Sat Sep 18, 2010 1:05 pm

giantpopples wrote:Hi !

I just installed your plugin and it's working great !

How is the development going ? I see that you try to implement the httpAPI to get more information on what's playing etc.. This is the only feature missing !

There is also a JSON-RPC API that is in development, maybe you could also have a look on it ? I don't know if it would be harder to implement but it seems to replace the older HTTPApi in the future.

Thanks again !!
Hello BBCode, It's been awhile but been out of the country "working" my real job.

Anyhow.. I am waiting until the XBMC JSON-RPC stuff is cooked before I finish the new plugin. I am testing Dharma at the moment and I just released a Multiroom streaming plugin and its at is early stages but looks real promising so check it out. ;-)

VortexRotor

User avatar
Livin
Experienced User
Posts: 790
Joined: Wed Oct 08, 2008 4:56 am

Re: XBMC Event Receiver

Post by Livin » Wed Sep 22, 2010 7:05 am

vortexrotor wrote: Anyhow.. I am waiting until the XBMC JSON-RPC stuff is cooked before I finish the new plugin. I am testing Dharma at the moment and I just released a Multiroom streaming plugin and its at is early stages but looks real promising so check it out. ;-)

VortexRotor

Since XBMC is in B2 now I'd think the JSON interface is pretty well baked?
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

Post Reply