I recently developed a binding to use the Weather Company API to retrieve Personal Weather Station (PWS) data and the 5-day weather forecast.
Important: This binding will work only for people who upload their PWS data to WeatherUnderground. If you don’t have a PWS and you don’t upload your PWS data to Weather Underground, you can stop reading. Sorry.
With that out of the way…
The Weather Underground API was turned off in March. However, PWS data uploaders are being given access to the weather forecast API from The Weather Company (TWC). TWC API provides access to PWS data, as well as a 5-day weather forecast.
Here’s the API spec.
In order to use this binding, you need a new API key from WeatherUnderground, and you can get one of these only if you are uploading your PWS data to Weather Underground. Old Weather Underground API keys will not work. I’m sorry to stress this, but I hope to prevent any misunderstandings that this binding is a replacement for everyone who’s using the Weather Underground binding.
If you currently upload your PWS data to WeatherUnderground, you can create the API key from your Weather Underground user profile. Or, you can use this direct link to get the API key.
The binding currently supports:
- 5 day forecast (one daily forecast for Today, Tomorrow, Day 2, Day 3, Day 4, Day 5)
- 5 day “daypart” (Day and Night) forecast for each of the above days
- PWS current observations (must set station ID in the thing config)
- TWC’s full list of language translations, which is quite extensive
- UoM for conversion of units
- configurable refresh time of forecast (fastest refresh is 2 minutes, default is 30 minutes)
- location types of postal code (only for US, UK, DE, FR, IT), geocode (latitude and longitude), and IATA airport code
- auto discovery of local weather thing if location and locale are set in openHAB
PLEASE NOTE: The daypart channels for the Day 0 Day forecast, as well as the temperatureMax channel the Day 0 forecast, will be null after 3:00pm Local Apparent Time. This is a “feature” of the new API.
The binding is still missing a some functionality:
- the binding documentation is not 100% complete (but it does include a full list of channels, example items, and example sitemap)
- some location types are not supported yet: ICAO code and street address. I’m not certain these are needed. If you feel strongly that one or both of these should be supported, please make your case in this thread.
The jar file is located here.
Important: Note that if you are on an older version of openHAB (such as 2.4 stable, or an early 2.5 snapshot, you may need to drop this jar into your addons directory in order to avoid an unresolved dependency.