Web commands

I can send a web command like this:
http://domain/api/HomeAutomation.X10/A5/Control.On
which works fine. But can you send a web command using the module name such as “bedside lamp” instead of of the module number as in A5 above?

I think it’s impossible at the moment because HG uses this domain/address notation to forward your message to the corresponding MIG interface.

How does the voice commands in hg work? The web interface and Android app both work in that way.

you could write a program to do it :slight_smile: my sms code could be altered to do what you want :slight_smile:

I don’t want to hijack but what would the url be for a normal program like the security program. I was given a suggestion of:
/api/HomeAutomation.HomeGenie/Automation/Programs.Enable/90

That doesn’t work to arm and disarm. It should have the control.on at the end. I usually pull it up on the forum and plug it in, but…

Hi, @Naps1saps.

Actually, on G+ you asked

What is the URL address for turning on/off the security program?

and I believe that /api/HomeAutomation.HomeGenie/Automation/Programs.Enable/90 is that address :wink:.

I’ll try to find how can you arm or disarm the security program using API and will write here later.

I have a browser plugin called wrapapi - which shows the requests nicely…

/api/HomeAutomation.HomeGenie.Automation/90/Control.ArmHome/undefined/
/api/HomeAutomation.HomeGenie.Automation/90/Control.ArmAway/undefined/
/api/HomeAutomation.HomeGenie.Automation/90/Control.Disarm/undefined/

All http gets and nothing fancy in the request body…

an example with powershell:

1 Like

I get a json error when I run it with Control.ArmAway
SyntaxError: JSON.parse: expected property name or ‘}’ at line 1 column 3 of the JSON data

If I use Control.On it works which is what I’ve been using. So thank you for getting that for me. I didn’t know this was going to be such a long thing or I would have made a new thread. We should start a sticky with a list of common API commands. I use trigger on my phone to arm my alarm when it loses WIFI connection meaning I left the house. Very handy if you live alone.

I think it’s because HG uses single quotes in serialized responses and Firefox, for example, doesn’t like them.
For this request HG replies with

{ 'ResponseValue' : 'ARMING AWAY' }

and this is valid JSON (you can check it here).

Don’t forget about documentation at this locations: