HomeGenie Forum

Automation Program Plugins and Wizard Scripting => Help => Topic started by: baptist on August 13, 2014, 12:56:07 PM

Title: Security Alarm System API
Post by: baptist on August 13, 2014, 12:56:07 PM
Hi I'm trying to control the Security system by a WebServiceCallReceived...
http://192.168.1.10/api/HomeAutomation.HomeGenie.Automation/Control.On (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.
Title: Re: Security Alarm System API
Post by: Gene on August 13, 2014, 01:19:13 PM
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 (http://192.168.1.10/api/HomeAutomation.HomeGenie.Automation/90/Control.On)

Cheers,
g.
Title: Re: Security Alarm System API
Post by: baptist on August 13, 2014, 01:43:01 PM
Many Thanks Gene.. Brilliant :)
Title: Re: Security Alarm System API
Post by: nolio on August 31, 2014, 09:54:27 PM
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
Title: Re: Security Alarm System API
Post by: ado464 on September 01, 2014, 10:59:00 AM
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 :)
Title: Re: Security Alarm System API
Post by: kevin1 on September 08, 2014, 04:28:46 PM
Can this be used to query status of security system as well (armed or triggered back to Android/Tasker)?