The state of Weather, PWS, and SmartThings? (Jan 2019)

sadly i never got a key before they stopped handing them out

There may be hope as they have said that anyone who is uploading data for a PWS, they will be able to use an API to access that data. May be they have plans for provisioning new keys in the future.

1 Like

Not really sure if this will help anyone. But I actually have a key due to me utilizing one of my servers as an OpenHAB server. So I am going to give it a try at putting something together.

I hope this will help!! As soon as I can get to work on it, I will but I am covered up for about three weeks right now. I have some more information on this that I will post later.

i have obtained a new personal API key for my PWS from WU…wonder if anyone can come up with a way to use this key to pull data into smartthings? Here is all the info for PWS owners wanting new keys:

Dear PWS uploaders, thank you for your continued loyalty and patience!

The gateway for the new API keys for PWS uploaders is open.

Cut and paste this URL into your browser: Login | Weather Underground

If you are not logged in, you will be asked to. The system will also verify that you have a PWS uploading to the system.

You will then see a blank box below “Your API keys”. Agree to the new Terms and Conditions by clicking in the small box next to “I agree”, click on the blue “GENERATE” box, and your new key will be created.

The key will be masked on the screen, but you can use the “Show” link below the box to see it. There is also another blue box, which, when clicked, copies the key to your clipboard.

If you have any problems, log out and log back in again. If that does not resolve the problem, please email me at victoria.gardner@ibm.com.

I have been unable to get ST happy with my Github repo, but I modified the ST Smart Weather Station Device Handler:
https://raw.githubusercontent.com/Timeteo/timeteo-smartthings/master/devicetypes/timeteo/smart-weather-tile.src/smart-weather-tile.groovy

ST has updated, but not made live, code changes to allow PWS to work in the Smart Weather Station. Their current implementation is either zip code OR PWS. Unfortunately the PWS API does not return all the same data attributes the zip code does. So I basically modified the handler so that you are required to add both a zip and PWS ID if you are using PWS. It will pull all attributes from zip, and then will overwrite those with PWS attributes for the attributes the PWS API supports.
the following are coming from PWS.
Temp
Feels Like
Humidity
Wind
Wind Vector
Location (PWS name)
UV Index
Alerts

The following are coming from zip:
uvDescription
localSunrise
localSunset
illuminance
percentPrecip
forecastIcon
forecastToday
forecastTonight
forecastTomorrow

This is working for me in ST and ActionTiles… Until ST can restore the same functionality (if they can with the new APIs), I will be using this Device Handler.

4 Likes

Hi @Timeteo, this DT works great! Thanks.

Notes for others, for the PWS, you just need to use your Station ID, you do not need to use the “PWS:” tag in front of it, since Tim created two fields.

How does it update? Do we need to use something like Polster? Do you have a recommendation on frequency of update?

It will update the same as the delivered SmartWeather Tile. I use a webCoRE piston to trigger a poll/refresh every 10 minutes. Frequency would be based on your use case… do you need to deflate Christmas decorations when it is windy (real use case I read in these forums)? Refreshing every hour might be too long for that…

1 Like

Thanks for getting this working.

Works great – thanks @Timeteo!

So you’re handler code above now works just the same as Smart Weather Tile did before? May I ask is it the original version or 2.0 style? Doesn’t really matter as long as it works. Additionally you commented about refreshing frequency - do you need to create a piston to refresh the device or will it update on its own? If it will do it on its own do you know how often it refreshes? Thanks for your work on this!

Long answer
TL;DR below (may still be TL :smile:)

Not quite… the way it worked before (as far as I understand) is that if you used PWS, all values were populated from PWS, otherwise all values were based on zip. The new TWC APIs omit some data for PWS that were previously provided by the old Wunderground API (the long answer link at the top of this post has a list of which attributes come from PWS and which come from zip in my DH). There would be a lot of ‘N/A’ values using only a PWS with the new SmartThings’ DH. I took SmartThings’ DH, which would use PWS OR Zip, and made a hybrid of PWS + Zip. So for all the values the API provides for PWS, those come from PWS, for the values that the API does not provide from PWS, it fetches using Zip.

It does not use the 2.0 style but it doesn’t use the original 1.0 style either. SmartThings updated their DH to use the new TWC APIs in December and my DH is a copy of that version. They updated the tiles and display in the December update. I think it looks nicer than it did, but is still pretty different from 2.0. Updating the existing DH was pretty trivial since SmartThings had already migrated it the new API… updating the 2.0 version would be possible, but more work since it would require refactoring the code to be based on the new TWC APIs… I just got lazy :smile:.

No auto refresh. I use a piston in webCoRE.

I entered and removed and re-entered the DTH a few times, and I still don’t have the option to enter my WU ID. I even tried to switch the 2 lines under preferences. Am I doing something wrong?

Perhaps you didn’t choose the custom handler in the IDE? You will end up with two identically named “SmartWeather Station Tile” device handlers… the custom one you add will be at the bottom of the list of choices for the device in the IDE, not around other handlers that start with the word “Smart”:
Capture

That was true. It was hiding. The issue now is there isn’t any data. I added my WU station (IALBERTAXXX) and my postal code and get this in the loggong groovyx.net.http.HttpResponseException: Not Found @line 237 (pollUsingZipCode)

This is great! I really appreciate it. I’ve been using WebCoRE to build my own little tile from the old API (until it eventually breaks I’m sure) to replace the ST Weather Tile that stopped working. But having the data show up as a device in ST obviously has so many advantages over a WebCoRE tile.

Is there any way to grab precipitation for today with this? I think that’s the only thing missing. Not a big deal either way - just figured I’d ask! Thanks again

I found that you need longitude and latitude for the non US systems.

I’ve been connected to WU stations in Alberta as well. Seem if you put in a postal, it stops functioning after a while. I just select the WU ID and leave the postal blank.

Also, what device are you reporting into WU with. I’m thinking of getting a WS-2902c

I have a Peet Brothers Ultimeter 2100. I’ve had it for about 16 years, and only had to replace the cups and vane once. Next project later this winter is to run the weather display on a pi.

Michael Matthews

I went an grabbed an Ambient Weather WS-2902c . Now to get the Author: Kurt Sanders, SanderSoft™ SmartApp to work on my device.

I did a long, probably convoluted way of adding my system. I have a web site I ftp to, along with a pi for backup, use weatherunderground for extended publishing, then use webcore to announce the readings on google home when I get into the kitchen in the morning.