Hi good people… long time no post… well I’m super excited to share with you all the following update to HousePanel. With the latest version you can now use HousePanel as a generic EndPoint to call from either Python or EventGhost. Both work equally well but Python is more flexible of course. To use first update your code from the HousePanel main repository. Be sure to get both the front end housepanel.php file and the back end HousePanel.groovy file. They are in separate GIT repositories.
As a reminder, the front end is here:
and the back end is here:
To use HousePanel as an EndPoint start by launching your browser and invoking:
http://yoururl/housepanel.php?useajax=showid
Where yoururl should be replace by where you installed the housepanel.php web site. This will retrieve a page that gives you all the info you need to make your Python or EventGhost script. The page returned will look something like this:
Once you have this info, you can turn on any switch, query any thing, or do any other action that HousePanel knows how to do using strings that look like:
http://yoururl/housepanel.php?useajax=doaction?id=abcd1234…
or
http://yoururl/housepanel.php?useajax=doquery?id=abcd1234…
Of course you have to use the full id from the list returned by showid. The first call will toggle any switch. The second call will query any switch. You can use locks, momentary buttons, contacts, thermostats, and anything else supported by HousePanel in the above calls. The only catch is when you use doaction for something other than a switch you have to also supply the attr GET variable. You can find what those variables need to be by looking at the doAction and doQuery functions in the housepanel.groovy file. I will document it more fully at a later time when I get around to making a Wiki.
The doquery calls return a Json string that you can parse to use however you like. For example, the following call:
http://192.168.xx.xx/smartthings/housepanel.php?useajax=doquery&id=123abc3-1234-1234-1234-abcaf1234
will return the following result:
{“temperature”:75,“heat”:68,“cool”:72,“thermofan”:“fanAuto”,“thermomode”:“cool”,“thermostate”:“cooling”}
The parameters of the above example were redacted of course but notice that I only had to provide the ID and HousePanel figured out that it was a Thermostat device on its own.
You’re probably wondering why this is such an exciting development. Well, just take a look at the EventGhost website (http://www.eventghost.net/) and you’ll immediately connect the dots. With this feature you can now tie HousePanel to any event invoked by your PC via the EventGhost application. If you are the adventurous type you can skip EventGhost and write your own Python application that interacts with your Smart Home. The possibilities are endless here folks.
Hope you enjoy. I would love to see your feedback, ideas, and examples.