[ANSWERED] getting vera device status

Posted on
Wed Apr 30, 2014 5:18 pm
Seeker offline
Posts: 440
Joined: Aug 05, 2013

[ANSWERED] getting vera device status

if this question is in the wrong place, I apologize.

I'm trying to get the status of a virtual device from vera and set an indigo variable with it.

this command:

Code: Select all
http://192.168.2.140:3480/data_request?id=lu_variableget&DeviceNum=15&serviceId=urn:upnp-org:serviceId:VSwitch1&Variable=Status


...entered in a browser from my mac works. It returns a 1 for on, a 0 for off.

Can anyone point me in a direction of how to script this command to periodically check the status of this device AND put the result in an indigo variable?

Thanks.

Posted on
Wed Apr 30, 2014 7:22 pm
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: getting vera device status

Probably sloppy as hell, but the following works.

Code: Select all
import urllib2
import simplejson
var1 = urllib2.urlopen('http://192.168.2.140:3480/data_request?id=lu_variableget&DeviceNum=15&serviceId=urn:upnp-org:serviceId:VSwitch1&Variable=Status')

var2 = var1.read()


indigo.variable.updateValue(1331605932, value=str(var2))

Posted on
Thu May 01, 2014 3:53 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: [ANSWERED] getting vera device status

[MODERATOR NOTE] Moved to a more appropriate forum.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests

cron