Making HTTP requests from Z-Cloud

Tips, Tricks and Scripts to enhance your home automation and workaround known device bugs, limitations and incompatibilities

Making HTTP requests from Z-Cloud

Postby PoltoS » 17 Dec 2012 13:39

We have improved Z-Cloud to allow HTTP requests inside scenes. These can be used to store data in other cloud services such as data logging to present graphs.

Use the folowing scene script as a reference:

import httplib

import encodings.ascii
try:
conn = httplib.HTTPConnection("google.com", 80, timeout=10)
conn.request("GET", "/")
res = conn.getresponse()
logging.rules.info(res.status, res.reason)
data = res.read()
logging.rules.info(data)
except Exception, inst:
logging.exception(inst, "httplib failed")
raise

Of course instead of writing data to logfile you are better to use it somehow.

User avatar
PoltoS
 
Posts: 2393
Joined: 26 Jan 2011 19:36

Would it also be possible to

Postby pz1 » 17 Dec 2012 13:39

Would it also be possible to do it the other way around; i.e. for example use an http call to Z-Cloud to toggle one of the ZME switches I have? If so, how would that look like?
My systems specifications
I have no ties with any vendor.
pz1
 
Posts: 1847
Joined: 08 Apr 2012 13:44

Hello friends,

Postby eligv » 17 Dec 2012 13:39

Hello friends,
A few days ago I asked about the possibility of having access through z-cloud of "Accessing a Wired Home Network IP address". I contestabais but not with this program improvement would be possible? What would your script?
Thanks and regards
eligv
 
Posts: 30
Joined: 08 Jun 2012 17:50

Sure, you can use HTTP Z-Way

Postby PoltoS » 17 Dec 2012 13:39

Sure, you can use HTTP Z-Way API to do so. Check the official forum thread to see the API description.
User avatar
PoltoS
 
Posts: 2393
Joined: 26 Jan 2011 19:36

Please be more precise. We do

Postby PoltoS » 17 Dec 2012 13:39

Please be more precise. We do not understand your question
User avatar
PoltoS
 
Posts: 2393
Joined: 26 Jan 2011 19:36

hello

Postby eligv » 17 Dec 2012 13:39

hello
Happy New Year to all. I have a microcontroller board with 8 outputs networked through a server wev. with an IP address do I access a page made in html with which active exits via IP address. Can send commands z-cloud IP address to the local network to activate the outputs of the board? and receive data via local network ip?

Thanks and prosperous 2013
eligv
 
Posts: 30
Joined: 08 Jun 2012 17:50

Basically, yes. If you have a

Postby PoltoS » 17 Dec 2012 13:39

Basically, yes. If you have a public IP (fixed or with some dyndns-like service) you can use Z-Cloud to trigger HTTP requests to your public IP from Z-Wave events.
User avatar
PoltoS
 
Posts: 2393
Joined: 26 Jan 2011 19:36

It's fantastic! With that

Postby eligv » 17 Dec 2012 13:39

It's fantastic! With that command could do so by adding the IP address?
Thanks and regards
eligv
 
Posts: 30
Joined: 08 Jun 2012 17:50

Please see our API

Postby PoltoS » 17 Dec 2012 13:39

Please see our API description: http://en.z-wave.me/content/z-way-api
User avatar
PoltoS
 
Posts: 2393
Joined: 26 Jan 2011 19:36


Return to Recipes

Who is online

Users browsing this forum: No registered users and 1 guest