• You've been granted Beta access to this site, allowing you to explore some of the new features while they're still under construction. More information can be found in the Beta forum.

[download] PremiseEventGhost


Senior Member
File Name: PremiseEventGhost
File Submitter: etc6849
File Submitted: 16 Jan 2013
File Category: Premise
Author: etc6849
Contact: Premise support forum

Now attached is the zip file with everything you need to get EventGhost and Premise talking, including detailed instructions in a PDF.  This module is not limited to one way event triggering.  Events can be triggered in EventGhost using Premise, or events can be triggered in Premise using EventGhost!
The Premise Home Control EventGhost module has four main features. 
1. It allows Premise Home Control to send events to EventGhost.  
This means Macros from within EventGhost can 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 commands 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 send keys are also found under the EG Tasks container.  The Task object does not include a Home class, while there is a home class called EG_Tasks_Home.
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…  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’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 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…   
EventGhost knows which Events to send to Premise based on the events included in the Premise: SendEvent Macro.  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 is, unless you dig through each ProcessCmd script found in the Premise module (aka the “.xdo” file) and discern which events should be sent.
4. Instead of performing the SendEvent macro method described in part three above, there’s a much easier way to invoke state changes on Premise objects!  The Premise EventGhost plugin includes a second option using EventGhost Actions.  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’s SetValue method.

Click here to download this file