Premise Premise and EventGhost?!?

Motorola Premise

etc6849

Senior Member
Is anyone using EventGhost with Premise?

I was thinking it would be neat if EventGhost could have two way communications with Premise. In this manner an event in Premise could trigger an action in EventGhost, and an event in EventGhost could trigger an action in Premise.

Examples:
1. You want Media Center to start, if it fails to respond to a vmccontroller request, as Media Center is likely closed. Premise could send a specially formatted packet to event ghost to start Media Center on the affected PC.

2. You open Arcsoft TotalMediaTheater to play a blu-ray on your PC. Premise could know that Arcsoft TMT is open in the particular room and dim the lights for you.

3. You arm Away mode in Premise. All computer(s) besides the one running Premise could automatically go to stand-by. Further, your office PC could come out of standby when you walk into the room.

The idea is you'd install a module in Premise, but also install a matched plug-in EventGhost. I have two way communications between Premise and EventGhost working over a generic TCP socket (not UDP as the virtual Lantronix UDS10 trick does not support it).

I was hoping someone had developed something similar already, as it may be a lot of work creating a versatile custom protocol for EventGhost->Premise packets. I think I can steal existing methods and protocols from other EventGhost plug-ins for Premise->EventGhost packets (there's a CQC and a Homeseer example).
 
This is working really well so far! I'm surprised no one else is using EventGhost with Premise. So far I have speech working...

The end result of the project will be:
  1. A plug-in for Premise that is installed under EventGhost's Plug-in directory
  2. A Premise EventGhost module that supports full two-way tcp communications with EG. This part is imported into Premise.
The Premise EventGhost module will:
  1. Have full two way tcp communications with EventGhost. This will allow events to be triggered in both Premise and EventGhost.
  2. Generically pass python scripts to EG for processing. These scripts can do things like trigger EG actions such as turning off a computer display. The end user will have several device objects with properties that automatically send the python scripts.
  3. Allow for multiple Device class instances. In other words, you can have several EventGhost installs throughout the home. There will be an EventGhost Premise device object under Custom Devices for each install.
The EventGhost Premise plug-in will:
  1. Allow you to generically trigger things in Premise from within EventGhost. For example, when you start XBMC, you can now configure a macro containing an action to dim a light attached to your Premise server. This will be implemented by passing parameters from EG to Premise and then using the SetValue method in Premise. This will use a custom protocol I'm developing. Probably a packet starting with <setval> and ending with a CR.
 
OK. This is really quite awesome, ETC. I use EG on my HTPC to control SageTV and TMT. This means that I can now have a scene executed from a remote button press. Or have EG know that when I hit pause it show bring the lights up and back down when I hit play again. There are tons of possibilities.

Can't wait.
 
The possibilities really are endless given the vast number of EventGhost plug-ins. I'll have to check out the TMT plug-in. I saw that SageTV and XBMC both had EG plug-ins.

PS: If you think of any cool ideas, please post!
 
It's getting there. I want to add onscreen display (so Premise can send msgs via OSD to a PC's display). Then I need to write some instructions.
 
I'm done! However, I'm hesitant to upload it without full documentation and beta testing for fear that EventGhost users who aren't familiar with Premise will run into some issue and be frustrated. I definitely want to ensure no bugs exist before posting in the downloads section.

If any of you Premise experts want to PM me your email, I'll throw together some documentation (lots of pictures, so it's a big file) along with all files for your testing (and hopefully enjoyment). It'll take me a day or two to get the documentation completed (I'm on page three now), but I really need folks to read through it and follow the directions to make sure they are clear, so PLEASE HELP!

I've been through the module several times and it works great! The only caveat is WMC's full-screen mode blocks the on-screen display and on-screen menu's. Overall, I'm very pleased with how the module turned out. There XDO file is close to 2000 lines, so it was big effort!

An overview is described below (minus pictures)


Overview
This Premise Home Control module has four main features.

1. It allows Premise Home Control to send events to EventGhost. This allows Macros from within EventGhost to be triggered based on home automation events such as motion detection, temperature, lighting states, etc... These Events are sent over TCP by an EG_SendEvent Device object and show up in EventGhost just like any other Event.

2. It allows Premise Home Control to send Actions to EventGhost for processing. These Actions are in the form of Python code sent over TCP. EventGhost then processes these actions and performs some action on the EventGhost PC. It should be noted that most common python commands are already written into the module, so the Premise end user does not need to learn Python.

All the Premise user needs to know is how to create a Home object that will bind to the respective properties of the Device object, and how to write code under PropertyChange scripts to perform some actions in Premise.

The prebuilt Actions are organized into Device classes. Instances of these Device classes are called Device objects. For each Device class summarized below, there is a respective Home class unless otherwise stated.

a) Computer based actions: text-to-speech, sound card adjustments and PC power states and generic python code.

B) Display based actions: power states, image display, on-screen display

c) EG_Tasks based actions: window based functions such as bring to front, minimize, maximize, close are found under each Task object; the ability to start applications and to send keys are found under the EG Tasks container. The Task object does not include a Home class, only the EG_Tasks object does.

d) EG_OSM: generates a topology of Premise Home objects, but using keypad buttons (e.g. MenuEntry objects). Then, when the Start property is triggered or a predefined EventGhost event is received, an on-screen menu (OSM) will be automatically generated on the display of the EventGhost PC, allowing one to toggle on/off properties for lights, adjust fan speeds, etc&hellip; The design of the EG_OSM modules is generic and can easily be customized by deleted unwanted MenuEntry objects. These MenuEntry objects can be bound with generic keypad buttons under home to trigger macros, scripts or scenes as MenuEntry inherits from Premise&rsquo;s keypad button class. EG_OSM has no Home object, so use a generic Home keypad and bind it to the MenuEntry Device objects as needed.

3. The Premise module allows for EventGhost events to be received in Premise by an EG_ReceiveEvent object. In this manner, events triggered in EventGhost can also trigger events (e.g. property state changes) in Premise. These property state changes in Premise can then be monitored by an EG_ReceiveEvent Home object and have code triggered when they occur. Received events are also sent to the corresponding Action object to update property states where appropriate. These properties are usually grayed out as they are typically read only, but some properties such as volume control, offer full two-communication. In other words, you can change the volume slider on the EventGhost PC and see the same change occur in Premise and vice-versa. This allows Premise to track things such as Powerstate of a PC, windows main volume level, mute, what tasks are open, how many windows of each task are open, etc&hellip;

EventGhost knows which Events to send to Premise based on the events included in the Premise: SendEvent Macro shown below. This macro has a Premise Plugin Action called SendEvent that will grab the Event string and payload and sent it out over the TCP port. Note that the lightning bolts represent EventGhost Events. The lightning bolt with the asterix means all EventGhost events (including payload) will be sent to Premise. It is recommended that this be left as all events, unless you dig through each ProcessCmd script found in the Premise module (aka the &ldquo;.xdo&rdquo; file).

4. Instead of performing the method described in part three above, there&rsquo;s a much easier way to invoke state changes on Premise objects! The Premise EventGhost plugin includes a second option as shown above by the example macro entitled &ldquo;Premise: SetValue: Home.Living.Light.&rdquo; The corresponding EventGhost Action (the thing with a lego looking symbol) will send a specially formatted packet to Premise over TCP. This specially formatted packet implements Premise&rsquo;s SetValue method. To change the parameters EventGhost sends, double click the SetValue action. The options are depicted below.

It should be clear that these default values are examples. It is up to the end user to ensure the Premise (aka SYS) object path is valid within Premise; else an event error will occur on the Premise server. The Property Name and Value should be copied just as they appear in Premise. For percent levels, use the decimal equivalent up through 1. Force State Change will force an event state change in Premise, so that a PropertyChange script will fire, even if a property&rsquo;s value did not change. This option is typically reserved for devices with one-way communication (e.g. infrared devices).
 
The few days are for me to finish the documentation before I email you. Of course you can take a week or so to get back to me with any issues.
 
what a great way to pull-in more Premise users!  I was just playing with XBMC's latest release and wondered why I couldn't have a Premise Browser control screen embeded in XBMC.  Of course the UI would have to match the XBMC out-of-the-box theme.  What you're working on is just another way to get there.  What a great way to make Premise even more consumable by non-techies (once programmed).
 
I would be happy to play with the interaction between XBMC, E.G., and Premise.  
 
Please let me know if you still need testers.
 
kjs
 
PM me your email and I'll ship you the beta for Premise EG.
 
I don't think using EventGhost in between Premise and XBMC is how I would do it.  Within a module, Premise can handle HTTP requests and TCP connections.  If XBMC uses UDP, you'd need to develop a plugin using the Premise SDK or you can just write a simple perl script and let it transfer the packets from UDP to a TCP listener for Premise to connect to.
 
Nothing agains EventGhost, but it doesn't have the predefined classes like Premise and this does save time.  The Premise EventGhost instructions will show you how easy TCP is within Premise, using a dummy Lantronix UDS10 work around.  I'd try something similar with XBMC.
 
PS: I still don't use XBMC and probably will not until the whole bluray iso with menu support thing is ironed out.  Frodo looks really nice though and as soon as they add this feature (and it's not beta or something) I'll try it!
 
Back
Top