HomeGenie Forum

Automation Program Plugins and Wizard Scripting => Help => Topic started by: KaZe on June 24, 2015, 03:36:27 PM

Title: Control HG from command line or from other program
Post by: KaZe on June 24, 2015, 03:36:27 PM
It is possible to control HG switches from the other program, or command line?
for example: https://packetsender.com/ (https://packetsender.com/)

I'd like to use Jarvis Mark II voice control software (http://jarvis.ai-dot.net/ (http://jarvis.ai-dot.net/)) to control my switches.
Title: Re: Control HG from command line or from other program
Post by: dani on June 24, 2015, 04:34:04 PM
Yes, you have to look at the Api documentation : http://www.homegenie.it/docs/api/overview.html (http://www.homegenie.it/docs/api/overview.html)

Sample for switch on the ZWave switch Node 3 : 192.168.1.xxx/api/HomeAutomation.ZWave/3/Control.On

Cheers
Dani
Title: Re: Control HG from command line or from other program
Post by: kevin1 on June 24, 2015, 05:23:26 PM
Can these web apis be added freely in our program code or are they limited to specific commands such as Control.On?  When I try to create my own in programs they don't seem to work.  The default ones I used as templates do seem to work correctly in the original program.
Title: Re: Control HG from command line or from other program
Post by: KaZe on June 24, 2015, 09:32:21 PM
In browser running, but prompt asking for a username and password.
How can I enter a user name and password on the command line?

Title: Re: Control HG from command line or from other program
Post by: mvdarend on June 25, 2015, 07:06:01 AM
You'll need to send it as an HTTP request (from a browser):

http://10.1.1.205/api/... (http://10.1.1.205/api/...)

Title: Re: Control HG from command line or from other program
Post by: KaZe on June 25, 2015, 08:39:16 AM
With browser, works perfectly. This way I can control everything with my voice. (switches, lights, alarm, etc... without any controller)

Thank you for your help!
Title: Re: Control HG from command line or from other program
Post by: kevin1 on June 25, 2015, 01:37:36 PM
Dani suggested this way of adding username/password to URL in another thread, maybe it will work from command line too:

http://admin:password@192.168.xxx.xxx/api/HomeAutomation.ZWave/3/Control.On

If that doesn't work directly you could try accessing it via a command line browser such as curl or wget http://wget.addictivecode.org/FrequentlyAskedQuestions?action=show&redirect=Faq#download (http://wget.addictivecode.org/FrequentlyAskedQuestions?action=show&redirect=Faq#download).
Title: Re: Control HG from command line or from other program
Post by: KaZe on June 25, 2015, 02:13:53 PM
I try...Unfortunately, this command is not working. (http://admin:[email protected]/api/HomeAutomation.ZWave/3/Control.On (http://admin:[email protected]/api/HomeAutomation.ZWave/3/Control.On))
But with wget, works perfectly.

Thanks for the suggestion.