HomeGenie Forum

Automation Program Plugins and Wizard Scripting => APP Contributions => Topic started by: ziflin on November 07, 2014, 05:51:25 AM

Title: Web Run - Run a Program, Turn a Module On/Off/Set Level
Post by: ziflin on November 07, 2014, 05:51:25 AM
I'm not sure if there's already a way to do this in HomeGenie, but this will let you do the following from a web request (Android Tasker, etc):

http://{yourserver}/api/run/{Program} - Runs the specified program.
http://{yourserver}/api/run/{Module}:on - Turns the specified module on.
http://{yourserver}/api/run/{Module}:off - Turns the specified module off.
http://{yourserver}/api/run/{Module}:toggle - Toggles the specified module.
http://{yourserver}/api/run/{Module}:75 - Turns the specified module on to 75%.

Multiple runs can be done in a single request. ex:
     http://{yourserver}/api/run/Outside%20Lights:on/Inside%20Fan:off
     ^- Turns the "Outside Lights" lights on and the "Inside Fan" off. Note the use of %20 for a {space}.

So with this and the Tasker app you can make a Tasker Shortcut on your Android home screen to run a Program or control a Module. Or pretty much any other Tasker trigger.
Title: Re: Web Run - Run a Program, Turn a Module On/Off/Set Level
Post by: nolio on November 07, 2014, 06:59:14 AM
Hi,

There is existing API on HG : http://www.homegenie.it/docs/automation_advanced.php (http://www.homegenie.it/docs/automation_advanced.php)
like :  http://<hg_address>/api/<module_domain>/<module_address>/<command>/<param>

But i don't know if you can do multiple actions ...

Bye
Title: Re: Web Run - Run a Program, Turn a Module On/Off/Set Level
Post by: ziflin on November 07, 2014, 03:31:14 PM
I figured there was something similar already.  But it's here if anyone finds it useful.

Updated: added the "toggle" option and slight cleanup to string args handling.

Title: Re: Web Run - Run a Program, Turn a Module On/Off/Set Level
Post by: mvdarend on November 07, 2014, 03:39:52 PM
Thanks! I was looking for a way to start a sequence of events from my IP camera when movement is detected. This looks like it should do the trick.