Actually this should be fairly simple to do(after getting XBMC Event Receiver up and running)
Even though I personally have not used EventGhost(at the moment, I don't have a reason to) I barely knew of it's existence in fact(I know, shame on me..)
But i have a solution for you that use Cinema Experience and want to integrate what I have provided with your Home Automation....
So here we go...
We will use HTTP-API(It is depreciated, but it should be around even for Eden still, if not, we'll conquer that when it happens)
When the script runs for the first time(I think since about version 1.0.40) the script will copy a folder and it's contents to your userdata\addon_data\script.cinema.experience folder. Inside the folder is a file called "home_automation.py". This file is the bread and butter of the integration. This file is a python script that Cinema Experience will trigger, for those who know programming, it is run as a Thread, so it does not interfere with Cinema Experiences timing, nor should it really affect CPU load. Here is were the fun coding begins(it's fairly simple)
Code:
def activate_on( trigger = "None" ):
"""
Scripting to trigger almost anything(HA, other scripts, etc...) when videos start.
Usage:
activate_on( "Movie" )
will trigger code that is set under the Movie heading.
"""
if trigger == "None":
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - No Trigger Sent, Returning", level=xbmc.LOGNOTICE )
return
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - activate_on( %s ) Triggered" % trigger, level=xbmc.LOGNOTICE )
# Script Start
if trigger == _L_( 32613 ) and _S_( "ha_script_start" ) == "true":
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - %s Triggered" % _L_( 32613 ), level=xbmc.LOGNOTICE )
# place code below this line
# Trivia Intro
This is a clip from the file. So we will start where it says "# place code below this line" - for those not familiar with python, '#' are comment lines
To get the information to EventGhost(EG from now on), we need the script to send a broadcast. The HTTP API is perfect for this. We will use the command xbmc.executeHTTPAPI() to create our broadcasts.
The broadcast we need to send from CE is something that we can easily identify and distinguish in EG. For this example we will use "CE_Automate".
We will also use <b> to start the broadcast and </b> to end the broadcast, as well as <li> to separate the trigger.
So each of the Event triggers will start with "CE_Automate", ie "<b>CE_Automate<li>script_start</b>", "<b>CE_Automate<li>trivia_start</b>"
Let's put it into the code.. But first a little tip about the indentation. Python really likes indentation, in fact it will not work and through a fit if the indentation is not correct. The script uses 4 spaces per indentation, these are also not tabs. The code we insert will need to line up with the other indented lines.
Here we really go...
Code:
# Script Start
if trigger == _L_( 32613 ) and _S_( "ha_script_start" ) == "true":
xbmc.output( "[script.cinema.experience] - [ home_automation.py ] - %s Triggered" % _L_( 32613 ), level=xbmc.LOGNOTICE )
# place code below this line
xbmc.executehttpapi( "Broadcast(<b>CE_Automate<li>script_start</b>)" )
Now when ever the script starts, it broadcasts "<b>CE_Automate<li>script_start</b>".
Continue on, adding the triggers... or download this file -
http://www.mediafire.com/file/zpx33v60ii...omation.py
Now we need to turn our attention to EG...
Install the XBMC Event Receiver plugin -
http://www.eventghost.net/forum/viewtopi...=30#p18203 - follow aptalca's instructions if you don't have it working yet.
The triggers we need to look for are the messages that we have broadcasted from CE. The XBMC Event Receiver prefixes the broadcast with XBMC-Event. so the event we will be looking for looks like this: "XBMC-Event.<b>CE_Automate<li>script_start</b>"
So now create a Macro, use the "XBMC-Event.<b>CE_Automate<li>script_start</b>" as the Event, then add what you want EG to do when this Event happens.
That's it.... Not too painful
If the script sensed that the script has stopped playing(ie by pressing stop, video crash, etc) it will trigger the script_end trigger
The triggers in the file are the following:
Script Start - XBMC-Event.<b>CE_Automate<li>script_start</b>
Script End - XBMC-Event.<b>CE_Automate<li>script_end</b>
Trivia Intro - XBMC-Event.<b>CE_Automate<li>trivia_intro</b>
Trivia Start - XBMC-Event.<b>CE_Automate<li>trivia_start</b>
Trivia Outro - XBMC-Event.<b>CE_Automate<li>trivia_outro</b>
Movie Theatre Intro - XBMC-Event.<b>CE_Automate<li>movie_theatre_intro</b>
Coming Attraction Intro - XBMC-Event.<b>CE_Automate<li>coming_attractions_intro</b>
Trailer - XBMC-Event.<b>CE_Automate<li>trailer</b>
Coming Attraction Outro - XBMC-Event.<b>CE_Automate<li>coming_attractions_outro</b>
Feature Presentation Intro - XBMC-Event.<b>CE_Automate<li>feature_intro</b>
Countdown Video - XBMC-Event.<b>CE_Automate<li>countdown_video</b>
Audio Format Video - XBMC-Event.<b>CE_Automate<li>audio_video</b>
MPAA Rating Video - XBMC-Event.<b>CE_Automate<li>mpaa_rating</b>
Movie - XBMC-Event.<b>CE_Automate<li>movie_start</b>
Intermission - XBMC-Event.<b>CE_Automate<li>intermission</b>
Feature Presentation Outro - XBMC-Event.<b>CE_Automate<li>feature_outro</b>
Movie Theatre Outro - XBMC-Event.<b>CE_Automate<li>movie_theatre_outro</b>
Paused - XBMC-Event.<b>CE_Automate<li>paused</b>
Resumed - XBMC-Event.<b>CE_Automate<li>resumed</b>