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

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy