Skip to main content

OpenWeather external integration for Gladys Assistant

OpenWeather integration for Gladys Assistant

Weather conditions, forecasts and alerts from OpenWeather.

This integration provides the weather displayed in Gladys: the dashboard weather widget, and the answers of the chat assistant when you ask "what is the weather like?".

Once installed and configured, it takes over from the OpenWeather service built into Gladys, with nothing else to do. If you stop or uninstall it, Gladys falls back to the built-in service automatically.

1. Get an OpenWeather API key

  1. Create a free account on openweathermap.org.
  2. Open the API keys tab of your account and copy the key (a 32-character string).
  3. Be patient: a brand-new key takes up to a couple of hours before OpenWeather activates it. Until then, every request answers 401.

2. Configure the integration

Open the Configuration tab of the integration and fill in:

  • API key — the key you just copied. It is stored as a secret: Gladys never sends it back to the browser.
  • OpenWeather API — which API to call:
    • Free (default): works with any account. Current conditions, 24 hours of 3-hourly forecast and 5 days.
    • One Call 3.0: needs the "One Call by Call" subscription on your OpenWeather account (1000 calls a day are free, but a credit card is required to subscribe). It adds real hour-by-hour forecasts, the UV index, the dew point and the national weather alerts (Météo-France vigilance, NWS warnings…), which the free API does not carry.
  • Cache duration — how long an answer is reused before calling OpenWeather again, in seconds (10 minutes by default). It keeps the dashboard well within the free quota. Set it to 0 if you want every refresh to hit the API.

Save. The status at the top of the page turns green as soon as the integration can serve the weather.

3. Check it works

The Test the connection button runs a real request to OpenWeather (Paris by default, change the coordinates to your own if you like) and shows the temperature, the condition and the number of forecast days it got back. It bypasses the cache, so it always tells you the truth about the current state of your key.

Then open your dashboard: the weather widget shows the location configured in your Gladys house.

Where the location comes from

The integration does not store a location: Gladys sends the coordinates of the house that asks, along with the language and the unit system (°C or °F) of the user who asks. Change your house address or your unit preference in Gladys and this integration follows.

Troubleshooting

What you seeWhat it means
"OpenWeather rejected the API key (HTTP 401)"The key is wrong, or it is not active yet (wait up to a couple of hours after creating it).
"OpenWeather does not serve /data/3.0/onecall for this account (HTTP 404)"You selected One Call 3.0 without the matching subscription. Subscribe on the OpenWeather site, or switch back to the free API.
"OpenWeather quota exceeded (HTTP 429)"Too many calls. Raise the cache duration, or upgrade your OpenWeather plan.
The widget shows the weather but no alertsWeather alerts only exist on One Call 3.0, and only where a meteorological office has issued one.

The integration logs every request it makes: open the integration logs from the Gladys UI (or docker logs on the host). Set LOG_LEVEL=debug for the full detail, including the URLs called (the API key is never logged).

Configuration settings

These are the settings OpenWeather asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Your OpenWeather accountsectionNoOpenWeather is a free weather API. Create an account, copy the API key from the "API keys" tab and paste it below. A new key takes up to a couple of hours to become active.
API keysecretYesThe OpenWeather API key used for every request.
OpenWeather APIselectNo"Free" works with any account. "One Call 3.0" needs the One Call subscription (1000 free calls a day, a credit card is required) and adds hourly detail, UV index, dew point and weather alerts.
Cache duration (s)numberNoHow long a weather answer is reused before calling OpenWeather again. Keeps the dashboard within the free quota. Set to 0 to always call the API.

How to install OpenWeather in Gladys

  1. In Gladys, open Integrations: OpenWeather appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/gladysassistant/gladys-openweather:1.0.1), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/GladysAssistant/gladys-openweather.

OpenWeather requires Gladys >=4.85.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations

OpenWeather is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by GladysAssistant, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂