[ANSWERED]: How to create button that sends a HTTP command?

Posted on
Sun May 17, 2015 2:46 am
DrLaban offline
Posts: 53
Joined: Apr 28, 2015
Location: Norway

[ANSWERED]: How to create button that sends a HTTP command?

I'm trying to trigger my VERA lite using HTTP.

What's the easiest way to trigger a command like this when I press a button on my control page?
http://x.x.x.x.x:49451/data_request?id= ... d=VolumeUp

Posted on
Mon May 18, 2015 5:38 am
Vangelis offline
Posts: 167
Joined: Mar 18, 2014
Location: Southampton (UK)

Re: How to create button that sends a HTTP command?

Curl...?

Vangelis

Posted on
Mon May 18, 2015 2:35 pm
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

Re: How to create button that sends a HTTP command?

Here is a thread that discusses various HTTP POST techniques. Some of those are probably overkill if you just need a HTTP GET request sent, but there are still some good code snippets in there.

Image

Posted on
Sat Dec 05, 2015 2:18 pm
mortenkols offline
Posts: 198
Joined: Oct 29, 2014
Location: Norway

Re: [ANSWERED]: How to create button that sends a HTTP comma

how can i send a http command in a action group or in a schedule?

Posted on
Sat Dec 05, 2015 3:16 pm
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: [ANSWERED]: How to create button that sends a HTTP comma

Hi mortenkols -

Can you be a bit more specific with what you want to do? Do you want to send an Indigo HTTP command or a more general one? Here is a method to execute a more straightforward Python method:

Code: Select all
import urllib2

url = 'http://www.google.com'
response = urllib2.urlopen(url)
html = response.read()

indigo.server.log(html)

Place this script as an embedded script in your Action (for example, the Actions tab of the Schedule) and replace the url with your target.
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Dec 05, 2015 4:29 pm
mortenkols offline
Posts: 198
Joined: Oct 29, 2014
Location: Norway

Re: [ANSWERED]: How to create button that sends a HTTP comma

i want to do send a http command to my vera lite. your example worked. thanks. i did this.

import urllib2

url = 'http://192.168.17.28:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=1'
response = urllib2.urlopen(url)
html = response.read()

indigo.server.log(html)

Posted on
Mon Dec 07, 2015 12:46 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: [ANSWERED]: How to create button that sends a HTTP comma

FYI, you can use the Vera Bridge plugin to run scenes.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Dec 09, 2015 6:07 pm
mortenkols offline
Posts: 198
Joined: Oct 29, 2014
Location: Norway

Re: [ANSWERED]: How to create button that sends a HTTP comma

I Know. but its unstable. sometimes its report error in the log that it can't find the scene I'm trying to run. better to run scenes with http command.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest