How to get Zwave device status from RPi using Python

Can someone throw me a rope? I’m so far over my head, I’m not sure where to post or how to ask my question.

From some very basic examples on the Raspberry Pi site, I have a Pi2 reading a sensor and sending commands to a Vera3 to control some light switches. For example, the following lines dims my device 301 to 30% and turns off another switch.

requests.post("http://<VeraIP>:3480/data_request?id=action&DeviceNum=301&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=30") requests.post("http://<VeraIP>:3480/data_request?id=action&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&DeviceNum=480")

What I can’t accomplish is to read the Status (or any variable) from Vera. The lines below works in AltUI Lua Test, but I can’t find a way to make it work in Python code.

local result, status = luup.inet.wget("http://<VeraIP>:3480/data_request?id=variableget&DeviceNum=480&serviceId=urn:upnp-org:serviceId:SwitchPower1&Variable=Status") print (status)

I have searched in this and various other forums, and keep coming up empty. I’ve looked at urllib, httplib, socket.http and a few other things I don’t understand. It just can’t be that hard, can it? Can someone help point me in the right direction?

Ok, guess it was there all along. The lines below are working. The problems now seem to be that Vera doesn’t update the variables very often, and sometimes refuses the connection. I’m still not sure this is the right way to do these things, but learning is always fun. There are so many knowledgable people on this forum, I welcome any suggestions for a better way. Thanks to all.

t = requests.get("http://<VeraIP>:3480/data_request?id=variableget&DeviceNum=395&serviceId=urn:upnp-org:serviceId:SwitchPower1&Variable=Status") w = requests.get("http://<VeraIP>:3480/data_request?id=variableget&DeviceNum=395&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=Watts")