more G-Labs products

Author Topic: Security Alarm System API  (Read 2424 times)

August 13, 2014, 12:56:07 PM
Read 2424 times

baptist

  • **
  • Information
  • Jr. Member
  • Posts: 27
Hi I'm trying to control the Security system by a WebServiceCallReceived...
http://192.168.1.10/api/HomeAutomation.HomeGenie.Automation/Control.On

But I receive an error
{ 'ResponseValue' : 'ERROR: Array index is out of range.   at HomeGenie.Automation.Scripting.ScriptingInstance+<RunCode>c__AnonStorey0.<>m__2 (System.Object args) [0x00000] in <filename unknown>:0 ' }

I'm using tasker on my android, and by using the 'RESTask plugin' I was trying to create different actions based on GPS location.

August 13, 2014, 01:19:13 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
The correct syntax for an api call is:

/api/<domain>/<address>/<command>/<option_1>/.../<option_n>

so the program **address** is actually missing in the url you specified.
The correct call would be:

http://192.168.1.10/api/HomeAutomation.HomeGenie.Automation/90/Control.On

Cheers,
g.

August 13, 2014, 01:43:01 PM
Reply #2

baptist

  • **
  • Information
  • Jr. Member
  • Posts: 27
Many Thanks Gene.. Brilliant :)

August 31, 2014, 09:54:27 PM
Reply #3

nolio

  • *****
  • Information
  • Global Moderator
  • Posts: 544
Hi,
I want to do something like this :
Code: [Select]
/api/HomeAutomation.HomeGenie.Automation/90/Control.Level/To have the status of alarm : "On" or "Off".

But with this request HG don't answer anything like i do wrong command like this :
Code: [Select]
/api/HomeAutomation.HomeGenie.Automation/90/Control.aaa/
Perhaps all the "commands" are not available with API .... Is it ?
Or is there a way to do ?

Bye

September 01, 2014, 10:59:00 AM
Reply #4

ado464

  • **
  • Information
  • Jr. Member
  • Posts: 32
No it doesn't have all API, you will have to go into the source code of the alarm system and edit the API call section, search for Control.On and add your own commands under it.

cheers :)

September 08, 2014, 04:28:46 PM
Reply #5

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
Can this be used to query status of security system as well (armed or triggered back to Android/Tasker)?