Skip to content

OpenWeather (English)

roe-dl edited this page Aug 25, 2024 · 14 revisions

What is OpenWeather?

OpenWeather is an UK based company that provides weather data based on calculations for every point on earth. Despite how they call themselves, their services are not entirely for free. There is a rate limit for the current weather data if you don't pay. To get the forecast you need a separate subscription, which involves a per-download fee and some free downloads. For maps you have to pay always.

Using OpenWeather API with WeeWX

weewx-DWD supports retrieving actual weather data from OpenWeather by their API. It includes additional observation types to the archive record. The observation types are named like the standard observation types of core WeeWX, but prepended by a configurable prefix. You can retrieve data for more than one location in parallel.

Their maps you can download using the [[download]] feature. You need a subscription with OpenWeather for that.

Configuration

The configuration is simple. Specify latitude and longitude and the language, the text messages should be provided in. You need an API key which you get from OpenWeather for free. The configuration section in weewx.conf could look like this:

[WeatherServices]
    [[current]]
        [[[FichtelbergOWM]]]
            provider = OpenWeather
            station = Fichtelberg
            latitude = 50.4283
            longitude = 12.9536
            lang = 'en'
            prefix = 'xyz'
            api_key = 'API key that you got from OpenWeather'

This would retrieve current weather data for mount Fichtelberg in Saxony. You can specify any other location around the world.

The prefix is set to xyz in this example. This means, if you want to display the temperature you would write $current.xyzOutTemp in the skin template. $current.xyzIcon.raw provides an icon file name, and $current.xyzIcontitle.raw a text message describing the current weather.

As OpenWeather does not provide dewpoint, it is calculated within weewx-DWD using the WeeWX formula.

WeeWX uses a constant archive interval, but OpenWeather provides their data with a varying interval. Therefore, weewx-DWD stores the data it got from OpenWeather to a separate database. This database can be made available to WeeWX by configuring an appropriate binding.

I see no use in putting downloaded data into LOOP packets here, as their data is updated at most once per 5 minutes.

If your station is mounted on a vehicle and its location is available in WeeWX by observation types called latitude and longitude, you can specify station = mobile, and data is always retrieved for the current location of the station as provided by the observation types latitude and longitude. I am sure there is at least one person who wants to try this feature.