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?