For quite a while now I make use of EventGhost to control MediaPortal with my remote-control. Why shouldn’t I make use of the same remote to execute HomeSeer events?
Unfortunately there wasn’t any existing plugin for EventGhost doing this. That’s why I tried to quickly build something in C# (see here). However, the result wasn’t what I expected it to be, so I decided to create an EventGhost (Python) plugin myself; I must admit, Python was completely new to me.
Requisites:
- EventGhost – http://www.eventghost.org/ (to trigger the events)
- HomeSeer – http://www.homeseer.com/ (to control the devices)
- HomeSeer Speaker Client – http://www.homeseer.com/downloads/index.htm
When EventGhost is installed on the same machine running HomeSeer, nothing extra needs to be installed. However, when a remote machine is used to control HomeSeer, then you’ll need to download and install the HomeSeer Speaker Client. As such, you can call the necessary HomeSeer COM objects from Python.
The source for the plugin is a .py file, which needs to be copied into /plugins/Homeseer
located in the EventGhost
folder.
Necessary imports to use the COM objects:
We create a simple Homeseer class to call the HomeSeer functions:
A hs.speak test function is added to easily test our setup:
The actual function that, depending on the status of a device, sends a On or Off command to HomeSeer:
The actual EventGhost plugin which will call the HomeSeer class:
The actual EventGhost Actions which will call HomeSeer commands:
Download the full source code here.
References:
- http://www.eventghost.org/docs/scripting.html
- http://www.homeseer.com/support/homeseer/WebHelp/scripting/homeseer_scripting_interface_(function_quick_reference).htm
- http://www.homeseer.com/support/homeseer/WebHelp2/tipstricks/tipstricks_controlling_homeseer_remotely.h