wget problem - help needed

I need to get the status of a VSwitch on a VeraSecure from a VeraPlus. The device id=24. Using the following pasted into a browser, I get the results “1” or “0” as expected:

http://VeraIP/port_3480/data_request?id=variableget&DeviceNum=24&serviceId=urn:upnp-org:serviceId:VSwitch1&Variable=Status

However, the following does not work from Lua in a scene to set vsStat to “1” or “0”:

vsStat = luup.inet.wget(“http://VeraIP/port_3480/data_request?id=variableget&DeviceNum=24&serviceId=urn:upnp-org:serviceId:VSwitch1&Variable=Status”)

Anyone know why?

Thanks,
Tom

Yes, common mistake.

try this instead:

local status
status, vsStat = luup.inet.wget("http://VeraIP/port_3480/data_request?id=variableget&DeviceNum=24&serviceId=urn:upnp-org:serviceId:VSwitch1&Variable=Status")

That worked. THANK YOU! :slight_smile:

Any chance you could point out a link where that is documented?

Thanks again,
Tom

Try this:

http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_wget