Forget API Keys on WU, This is better :)

Post Reply
rv24531
Posts: 10
Joined: Thursday 13 September 2018 1:13
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: Chatham, VA
Contact:

Forget API Keys on WU, This is better :)

Post by rv24531 » Saturday 13 October 2018 13:10

Preface - I live in the largest county of Virginia, with only 1 major 'city'. For me, that city is about 30 miles away. And the next closest is about 60 miles away. So, needless to say, WU and other commercial sites often don't line up with the weather we're having. So, I found a way around this issue.

Weather Underground allows feeds from private parties who buy compatible weather stations, to feed information directly to them, using their Personal Weather Station (PWS) system. This includes Davis, Acurite, La Crosse, and others. The majority, if not all, send WU Wind, Rain, Temperature, Humidity and Barometer data.

I did some digging into, and found a PWS that's reporting realish time (5 Minute Delay) weather data by visiting ...

https://www.wunderground.com/wundermap

... and poked around looking for stations that were close to me. Presto! I found one about that is about 2 miles from me, so it's going to be a lot more accurate. I'm more interested in rainfall amount and wind speed, not so much temperature, humidity and barometer.

Once I had the station ID of the station I wanted to monitor, I hunted and hunted to find any reference online to pulling PWS data from WU, and have it returned in XML, but could not find any. But then, low and behold, after hours of trying different URL's, I stumbled upon this little jewel.



http://api.wunderground.com/weatherstat ... format=XML

(Change the XXXXXXXX in the URL to a PWS that you're interested in seeing)

Best part, it works without a API Key or anything like that. It's processed as a generic HTTP Request, and spits the data out back at ya.

I have a little black-magic going on on the back-end, I've got Node-Red set up to pull the XML data via a HTTP Request, then process that data and feed it into Domoticz using HTTP Post/JSON data.

It's been working fine for the last 2 months, polling the data every 5 minutes. Much more accurate in my situation because the data that's shown by the local PWS is more in line to the environment that's going on here, not 30 miles away.

Your mileage may vary, and I'm not the first person to stumble upon this URL, but I didn't find anyone that was using this method to get, convert and push the data into Domoticz. Maybe someone could create a plugin that does it nicer and neater than I've done it, but that's up to someone to else to take on that challenge, as for me - this works, why mess with it :)

rv24531
Posts: 10
Joined: Thursday 13 September 2018 1:13
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: Chatham, VA
Contact:

Re: Forget API Keys on WU, This is better :)

Post by rv24531 » Saturday 13 October 2018 13:47

As a follow up, anyone that's interested in running Node-Red to pull this data and push it out to Domoticz, I'll be more than happy to share my working flow (code) with them. Just drop me a message and I'll make it available.

Or if anyone wants to take a look at the code and re-write it in another language or more compatible for Domoticz, no worries, just ask, I believe knowledge should be free :) !

DarkG
Posts: 35
Joined: Friday 15 September 2017 18:54
Target OS: Raspberry Pi
Domoticz version: 4.10076
Location: Germany
Contact:

Re: Forget API Keys on WU, This is better :)

Post by DarkG » Saturday 13 October 2018 16:24

Wow thx. There are 3 next to my hood
RPi3b+ Max Cube ESPEasy RMMini

User avatar
jvdz
Posts: 1463
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Forget API Keys on WU, This is better :)

Post by jvdz » Saturday 13 October 2018 16:37

I think the issue is that they will discontinue their service totally: http://domoticz.com/forum/viewtopic.php ... nd#p193400
Which links to:
https://apicommunity.wunderground.com/w ... ground-api

Jos

rv24531
Posts: 10
Joined: Thursday 13 September 2018 1:13
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: Chatham, VA
Contact:

Re: Forget API Keys on WU, This is better :)

Post by rv24531 » Saturday 13 October 2018 18:07

"If you are a Personal Weather Station owner, you will receive more information about our plan to offer free access to the data you provide to Weather Underground. We’ll reach out once that plan has been finalized."

I guess only time will tell, we will have to wait and see, but for now this works and might as well use it while it does.

Scones
Posts: 75
Joined: Wednesday 10 December 2014 17:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Forget API Keys on WU, This is better :)

Post by Scones » Monday 29 October 2018 17:56

There is a LUA on the Domoticz site for using a WU feed, which I've been using for years. No need to set up a Node app.

Will be interesting to see what happens for the free API users as I can't see them continuing to support that

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests