Making HTTP requests from Z-Cloud

Tips, Tricks and Scripts to enhance your home automation and workaround known device bugs, limitations and incompatibilities
Locked
User avatar
PoltoS
Posts: 4731
Joined: 26 Jan 2011 19:36

Making HTTP requests from Z-Cloud

Post by 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.

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Would it also be possible to

Post by 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?
Since 29-12-2016 I am no longer a moderator for this forum

eligv
Posts: 30
Joined: 08 Jun 2012 17:50

Hello friends,

Post by 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

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

Sure, you can use HTTP Z-Way

Post by 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: 4731
Joined: 26 Jan 2011 19:36

Please be more precise. We do

Post by PoltoS » 17 Dec 2012 13:39

Please be more precise. We do not understand your question

eligv
Posts: 30
Joined: 08 Jun 2012 17:50

hello

Post by 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

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

Basically, yes. If you have a

Post by 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.

eligv
Posts: 30
Joined: 08 Jun 2012 17:50

It's fantastic! With that

Post by eligv » 17 Dec 2012 13:39

It's fantastic! With that command could do so by adding the IP address?
Thanks and regards

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

Please see our API

Post by PoltoS » 17 Dec 2012 13:39

Please see our API description: http://en.z-wave.me/content/z-way-api

Locked