We have moved at community.getvera.com

Author Topic: wget problem - help needed  (Read 351 times)

Offline ZW-Tom

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +8/-2
wget problem - help needed
« on: January 16, 2019, 01:03:56 pm »
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

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: wget problem - help needed
« Reply #1 on: January 16, 2019, 01:09:59 pm »
Yes, common mistake.

try this instead:

Code: [Select]
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")

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline ZW-Tom

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +8/-2
Re: wget problem - help needed
« Reply #2 on: January 16, 2019, 02:27:08 pm »
That worked. THANK YOU!  :)

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

Thanks again,
Tom

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.