Important: As of snapshot build 1772, the WeatherCompany binding is included in the openHAB distribution.
As part of the review process, there were several important changes of which you need to be aware:
- A bridge thing is now required. The bridge thing represents your WetherCompany account. This is where you enter the API key.
- There are now two different thing types, one for the weather forecast, and another for the PWS observations. Your item definitions will need to be updated to account for these two thing types.
- Since, the PWS weather observations are handled by a separate thing, there’s no longer a channel group for those items. Your item definitions will need to be modified to account for this.
- The latitude and longitude channels on the PWS weather observations thing have been combined into a single channel of type Location. Your item definitions will need to be modified to account for this.
Your things will need to be deleted and readded to account for the above changes.
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
NOTE 1: 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.
NOTE 2: The temperatures returned in the PWS Observations are integers. There’s much consternation in the WeatherUnderground community w.r.t. The Weather Company’s inability to return a higher level of precision. This is especially problematic when temps are in Celsius. At some point, when decimal numbers are available from the TWC API, I’ll update the binding to support the higher level of precision
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.