lua code for retrieving local temperature ???

Can somebody share the code to get only the local current temperature value from the following XML file:

https://forecast.weather.gov/MapClick.php?lat=37.5237&lon=-122.2785&unit=0&lg=english&FcstType=dwml

Thank you in advance.

OK, Iā€™m a noob, so pardon meā€¦
BUT. I needed the temperature for some codeā€¦

  1. i installed the ā€œVirtual Outdoor Temperature Sensorā€ (from APPS)

  2. this gets the temp from that ā€˜sensorā€™ (which gets it from the web)

local DEVICE_NO = 30 ā€“ the virtual temp sensor device number
local LS_SID = ā€œurn:upnp-org:serviceId:TemperatureSensor1ā€ ā€“ the ID

local currentLevel = luup.variable_get (LS_SID, ā€œCurrentTemperatureā€, DEVICE_NO) or 0
currentLevel = tonumber(currentLevel)

i know itā€™s not what you asked for, but returns the same resultā€¦ the local temp.

Iā€™ll look at the logs, maybe i can see exactly that the VOTS calls.

Iā€™d like to be able to use my local outdoor temperature in Reactor scripts, but donā€™t know if Vera keeps this information available in a variable.

I do see the current temp outside shown on the Vera UI, so itā€™s got to be coming from somewhere. Is that data exposed in Luup??

  • Libra

nope. This icon on the right is polled from by the vera web server from its cloud server. It is not done by the luup engine and is therefore not available in luup. You can certainly use a weather plugin to do that. (i.e Darksky)

Yep, in the intervening minutes, I discovered DarkSky (comes highly recommended!) and have it installed. Will do the trick for what little is needed.

Thanks!

1 Like

DarkSky is excellent! @reneboer has done the community a real service!

2 Likes