more G-Labs products

Author Topic: Web Run - Run a Program, Turn a Module On/Off/Set Level  (Read 1947 times)

November 07, 2014, 05:51:25 AM
Read 1947 times

ziflin

  • *
  • Information
  • Newbie
  • Posts: 2
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.
« Last Edit: November 07, 2014, 03:29:46 PM by ziflin »

November 07, 2014, 06:59:14 AM
Reply #1

nolio

  • *****
  • Information
  • Global Moderator
  • Posts: 544
Hi,

There is existing API on HG : 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

November 07, 2014, 03:31:14 PM
Reply #2

ziflin

  • *
  • Information
  • Newbie
  • Posts: 2
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.


November 07, 2014, 03:39:52 PM
Reply #3

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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.