TUTORIAL: Using EventGhost for Scheduling

It’s really easy! When you add the Webserver plugin you configure the “HTML documents root” to point to a folder. In that folder place an empty index.html (or put an actual website there if you like). Then send a GET for your webserver with the URI looking something like this: http://webserver.local/?This.Is.A.Test

In your event log you’ll see an event has been triggered that looks like this

You can drag that event onto a macro, and now that macro will be fired whenever something does a GET for http://webserver.local/?This.Is.A.Test

With the EG SmartApp you select the devices in ST and point it at your new EG webserver. Every time an ST event appears from one of your selected devices, it’ll send a GET command to http://webserver.local/?ST.Your.Device.Name.action_value. You can then drag that event to a macro to respond to that specific device event.

Some events are considered “binary” for things like switches that go on/off, contact sensors that go open/closed, motion sensors active/inactive etc. They look like this in EG:

Some have a “payload” that can be picked up and used with a Python command. They look like this:

(it’s cold here!)

For an example: before @MichaelS published his awesome Alexa Helper I was using EventGhost to control volume on my TV via Amazon Echo, a virtual dimmer, my EG SmartApp, and EG’s own Sonos control capability (far more reliable and functional than Sonos control from ST, written by the also-awesome technoguy).

I created a dimmer device and configured Alexa to see it as “TV”, and set it up in my EG SmartApp. I’d say “Alexa, set the TV to 50%”. The Echo would set the dimmer, that would trigger an event, the EG SmartApp would pick it up and send it to EG as HTTP.ST.TV[50]. The following Python code inside EG would grab that value and send it over to the EG Sonos plugin:

volume = int(eg.event.payload[0])
if volume < 100:
    eg.plugins.Sonos.VolumeSet(u'RINCON_<my_sonos_id>', str(volume))
    print "Setting TV Volume to ", volume

Check here and here for more details on using Python within EG to control plugins. The native Python integration and interpreter is the major source of power in EG.