# Weather API Changes

**URL:** <https://community.smartthings.com/t/weather-api-changes/147511>\
**Category:** Announcements\
**Created:** [December 24, 2018, 6:58pm UTC](https://community.smartthings.com/t/weather-api-changes/147511 "2018-12-24T18:58:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![SmartThings](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/smartthings/32/198105_2.png) [@SmartThings](https://community.smartthings.com/u/SmartThings)\
**Post date:** [December 24, 2018, 6:58pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/1 "2018-12-24T18:58:28Z")

</div>

The WeatherUnderground (WU) APIs SmartThings has been using to access local weather data are being shut down at the end of this year. This means any Automations or Devices that use the getWeatherFeature() method will stop running or begin returning errors on January 1, 2019.

We are taking steps to ensure that the SmartThings SmartApps and the SmartWeather Station Tile device handler will continue to work by porting them to new APIs from The Weather Company (TWC). These will be released into Production this week and there will be no gap in performance. To maintain your SmartApps and device handlers, we have exposed the [following methods for SmartApps and Device Handlers](https://docs.smartthings.com/en/latest/ref-docs/smartapp-ref.html?highlight=getWeatherFeature#getweatherfeature-deprecated) to replace getWeatherFeature().

# 

**def getTwcConditions(String locationString=null)**  
_Current weather conditions_

The optional locationString argument must be a 5 digit US zip code or a latitude, longitude string (e.g., "38.25,-76.45"). If it is not specified, the method will use the latitude and longitude of the location as set in the mobile app.

[Example getTwcConditions response](https://smartthings-twc-responses.s3.amazonaws.com/conditions.json)

# 

**def getTwcForecast(String locationString=null)**  
_Daily weather forecast at the specified location_

The optional locationString argument must be a 5 digit US zip code or a latitude, longitude string (e.g., "38.25,-76.45"). If it is not specified, the method will use the latitude and longitude of the location as set in the mobile app.

[Example getTwcForecast response](https://smartthings-twc-responses.s3.amazonaws.com/forecast.json)

# 

**def getTwcLocation(String locationString=null)**  
_Location data, such as time zone and zip code at the specified location_

The optional locationString argument must be a 5 digit US zip code or a latitude, longitude string (e.g., "38.25,-76.45"). If it is not specified, the method will use the latitude and longitude of the location as set in the mobile app.

[Example getTwcLocation response](https://smartthings-twc-responses.s3.amazonaws.com/location.json)

# 

**def getTwcAlerts(String geoLocation=null)**  
_Current severe weather alerts at the specified location_

The optional geoLocation argument requires a latitude & longitude string (e.g., "38.25,-76.45"). Zip codes are not supported in getTwcAlerts().

[Example getTwcAlerts response](https://smartthings-twc-responses.s3.amazonaws.com/alerts.json)

# 

**def getTwcAlertDetail(String alertId)**  
_Detailed description and text of the specified weather alert_

The alertId argument comes from the result of the getTwcAlerts() method.

[Example getTwcAlertDetail response](https://smartthings-twc-responses.s3.amazonaws.com/alertdetail.json)

* * *

**Final note** : If you are considering the development of an application that makes extensive use of detailed weather data, you should look into gaining direct access to APIs from a weather data provider such as TWC or others.

---

<div class="post-metadata">

**Author:** ![brbeaird](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/brbeaird/32/49286_2.png) [@brbeaird](https://community.smartthings.com/u/brbeaird)\
**Post date:** [December 24, 2018, 7:00pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/2 "2018-12-24T19:00:09Z")

</div>

Bummer. I assume this means we can’t point to an individual personal weather station anymore…

---

<div class="post-metadata">

**Author:** ![Neil\_Oakley](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@Neil\_Oakley](https://community.smartthings.com/u/Neil_Oakley)\
**Post date:** [December 24, 2018, 7:11pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/3 "2018-12-24T19:11:57Z")

</div>

The first question that came into my head too. Only reason I like the Weather tile so much is it tells me the weather at my house, from my PWS on the roof that uploads to Weather Underground.

---

<div class="post-metadata">

**Author:** ![Paul\_Haskins](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/paul_haskins/32/105059_2.png) [@Paul\_Haskins](https://community.smartthings.com/u/Paul_Haskins)\
**Post date:** [December 24, 2018, 7:22pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/4 "2018-12-24T19:22:44Z")

</div>

And Ditto…

---

<div class="post-metadata">

**Author:** ![RBoy](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rboy/32/62677_2.png) [@RBoy](https://community.smartthings.com/u/RBoy)\
**Post date:** [December 24, 2018, 8:57pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/5 "2018-12-24T20:57:17Z")

</div>

> [@SmartThings](#):
>
> We are taking steps to ensure that the SmartThings SmartApps and the SmartWeather Station Tile device handler will continue to work by porting them to new APIs from The Weather Company (TWC)

If I’m reading this correctly the changes would be transparent to the user and SmartApps which are using the WeatherTile. I.e. you should continue to be able to use the Weather Tile without any issues. It only affects apps which are using specific features of the weather tile API, `getWeatherFeature`.

---

<div class="post-metadata">

**Author:** ![SGrayban](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/sgrayban/32/105895_2.png) [@SGrayban](https://community.smartthings.com/u/SGrayban)\
**Post date:** [December 24, 2018, 9:41pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/6 "2018-12-24T21:41:39Z")

</div>

I would completely abandon WU… I have been in talks with them and the only way to get the same weather info after Dec. 31 will take 3 API calls from IBM’s new API.

---

<div class="post-metadata">

**Author:** ![Neil\_Oakley](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@Neil\_Oakley](https://community.smartthings.com/u/Neil_Oakley)\
**Post date:** [December 24, 2018, 9:54pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/7 "2018-12-24T21:54:41Z")

</div>

I read it as ST are cutting links with WU, and moving to source data from TWC instead using a zip code or lat/long.

Within the current WU setup, you can call data from a specific weather station by using the PWS ID. TWC does have the same capability - so it’s another nail in ST’s coffin if you ask me, and another backwards step.

---

<div class="post-metadata">

**Author:** ![RBoy](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rboy/32/62677_2.png) [@RBoy](https://community.smartthings.com/u/RBoy)\
**Post date:** [December 24, 2018, 10:29pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/8 "2018-12-24T22:29:01Z")

</div>

If WU is shutting down the API not sure what ST can do about it. There are custom weather station devices also but they also depends on WU API - which if shutdown won’t work either. So the question is does TWC allow for more specific control in place for a zip code? I’m not sure since I haven’t researched it yet. The question is are you using the specific station because it provides additional data or more accurate data compared to zip code data?

---

<div class="post-metadata">

**Author:** ![Neil\_Oakley](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@Neil\_Oakley](https://community.smartthings.com/u/Neil_Oakley)\
**Post date:** [December 24, 2018, 11:00pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/9 "2018-12-24T23:00:56Z")

</div>

Yes - specific name because it is hyper localised and more accurate. My weather station is on my roof and properly calibrated. It send data to WU and ST calls it back. There is still a support WU API, but requires work for ST to implement.

---

<div class="post-metadata">

**Author:** ![Paul\_Haskins](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/paul_haskins/32/105059_2.png) [@Paul\_Haskins](https://community.smartthings.com/u/Paul_Haskins)\
**Post date:** [December 24, 2018, 11:09pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/10 "2018-12-24T23:09:50Z")

</div>

API and such are over my head, but doesn’t Weatherlink (Davis Instruments) have an API?

I know a lot of the PWS use Davis. I do and use it to post to WU and CWOPS.

---

<div class="post-metadata">

**Author:** ![Benji](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/benji/32/74764_2.png) [@Benji](https://community.smartthings.com/u/Benji)\
**Post date:** [December 25, 2018, 12:30am UTC](https://community.smartthings.com/t/weather-api-changes/147511/11 "2018-12-25T00:30:04Z")

</div>

> [@Neil\_Oakley](#):
>
> Yes - specific name because it is hyper localised and more accurate. My weather station is on my roof and properly calibrated. It send data to WU and ST calls it back. There is still a support WU API, but requires work for ST to implement.

As a slight side note, what weather station do you guys use and how well does it integrate with SmartThings directly (aside from through what was available with WU)?

---

<div class="post-metadata">

**Author:** ![bamarayne](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bamarayne/32/18206_2.png) [@bamarayne](https://community.smartthings.com/u/bamarayne)\
**Post date:** [December 25, 2018, 12:55am UTC](https://community.smartthings.com/t/weather-api-changes/147511/12 "2018-12-25T00:55:54Z")

</div>

WU announced about a year ago they were doing away with the api, that is the same time that they stopped issuing new keys.

If you a WU key, you can modify the app to use that.

If you don’t, you can use something like the netatmo weather station.

---

<div class="post-metadata">

**Author:** ![bago](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bago/32/16144_2.png) [@bago](https://community.smartthings.com/u/bago)\
**Post date:** [December 25, 2018, 2:16am UTC](https://community.smartthings.com/t/weather-api-changes/147511/13 "2018-12-25T02:16:10Z")

</div>

IBM bought TWC, TWC bought WU.

Supposedly they are grandfathering people with a PWS and will provide us access to our own data. I’m not sure what that looks like yet.

---

<div class="post-metadata">

**Author:** ![SGrayban](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/sgrayban/32/105895_2.png) [@SGrayban](https://community.smartthings.com/u/SGrayban)\
**Post date:** [December 25, 2018, 3:12am UTC](https://community.smartthings.com/t/weather-api-changes/147511/14 "2018-12-25T03:12:09Z")

</div>

It looks like shit… IBM proposal is you will have to make 3 API calls for the same info the WU API single offered.

---

<div class="post-metadata">

**Author:** ![bago](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bago/32/16144_2.png) [@bago](https://community.smartthings.com/u/bago)\
**Post date:** [December 25, 2018, 3:27am UTC](https://community.smartthings.com/t/weather-api-changes/147511/15 "2018-12-25T03:27:55Z")

</div>

Do you have a PWS? It looks like they are basically leaving us alone.

---

<div class="post-metadata">

**Author:** ![SGrayban](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/sgrayban/32/105895_2.png) [@SGrayban](https://community.smartthings.com/u/SGrayban)\
**Post date:** [December 25, 2018, 3:41am UTC](https://community.smartthings.com/t/weather-api-changes/147511/16 "2018-12-25T03:41:27Z")

</div>

I have 3 stations…

According to Victoria from the TWC/IBM team member we will keep our free key but will have to use the same API’s to get our data.

---

<div class="post-metadata">

**Author:** ![Neil\_Oakley](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@Neil\_Oakley](https://community.smartthings.com/u/Neil_Oakley)\
**Post date:** [December 25, 2018, 10:13am UTC](https://community.smartthings.com/t/weather-api-changes/147511/18 "2018-12-25T10:13:36Z")

</div>

> [@bago](#):
>
> Do you have a PWS? It looks like they are basically leaving us alone.

I have two, both upload to WU and both are used with Smartthings Weather device. As long as there is a solution that means I can still get data from my weather stations into SmartThings, then i’ll Be happy.

---

<div class="post-metadata">

**Author:** ![Neil\_Oakley](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@Neil\_Oakley](https://community.smartthings.com/u/Neil_Oakley)\
**Post date:** [December 25, 2018, 10:15am UTC](https://community.smartthings.com/t/weather-api-changes/147511/19 "2018-12-25T10:15:01Z")

</div>

> [@SGrayban](#):
>
> I have 3 stations…
> 
> According to Victoria from the TWC/IBM team member we will keep our free key but will have to use the same API’s to get our data.

[https://apicommunity.wunderground.com/weatherapi/topics/end-of-service-for-the-weather-underground-api](https://apicommunity.wunderground.com/weatherapi/topics/end-of-service-for-the-weather-underground-api)

> [@Weather Underground Says](#):
>
> 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.

So i guess I have to sit and wait and see what they come up with, then home someone builds a new Device Handler or SmartApp that can make use of the data?

---

<div class="post-metadata">

**Author:** ![Jwwhite](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@Jwwhite](https://community.smartthings.com/u/Jwwhite)\
**Post date:** [December 25, 2018, 2:24pm UTC](https://community.smartthings.com/t/weather-api-changes/147511/20 "2018-12-25T14:24:15Z")

</div>

I have a smartapp of my own that I was using to get weather alerts. Started playing around with the new stuff here and a little lost about 1 part. I can get things like temperature, etc with no problems. But when it comes to the alerts I’m not sure of the exact syntax. Could someone point out what it should be. Me not being that good a programmer. Here is what I have done.

```
def wxalerts = getTwcAlerts("36.67,-93.34")
log.debug "Alert = ${wxalerts.alerts.phenomena} Description = ${wxalerts.alerts.eventDescription} Office = ${wxalerts.alerts.officeCode}"
```

---

<div class="post-metadata">

**Author:** ![TonyFleisher](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@TonyFleisher](https://community.smartthings.com/u/TonyFleisher)\
**Post date:** [December 26, 2018, 1:33am UTC](https://community.smartthings.com/t/weather-api-changes/147511/21 "2018-12-26T01:33:46Z")

</div>

Based on the examples in the documentation, it looks like the alerts property in the getTwcAlerts response is a list “alerts”:[…], so you need to either iterate the list or grab the first element (depending on your implementation needs) to get the structure that has the phenomenon and eventDescription properties.

[Next page](https://community.smartthings.com/t/weather-api-changes/147511.md?page=2)
