Skip to main content

DMI smart home integration, free and open source

DMI integration for Gladys Assistant

Official DMI weather for Denmark, Greenland and the Faroes: station data and forecasts.

The official weather of the Danish Meteorological Institute (DMI) in Gladys: what the nearest DMI weather station measures, and the DMI HARMONIE forecast of your place, in Denmark, Greenland and the Faroe Islands. DMI open data: no account, no API key.

Not affiliated with DMI. Tested against the live DMI API, not yet in a real Gladys installation: feedback welcome on the Gladys forum.

What the integration does​

  • One forecast device per place: each Gladys house that has a location, plus, optionally, a place given by its coordinates (a summer house, a boat
). It gives the forecast of the hour in progress (temperature, humidity, pressure, wind, gusts, direction, cloud cover, precipitation, the weather in words), and the low, high and precipitation of today and tomorrow.
  • One station device per DMI station used: the measurements of the nearest DMI weather station measuring temperature and wind, every 10 minutes: temperature, humidity, pressure at sea level, wind, gusts, direction, precipitation of the last hour, visibility, cloud cover. Only what the station measures is shown.
  • A scene trigger when the forecast announces frost, storm gusts or heavy rain within 24 hours.
  • Two scene actions: read one day of the forecast, read the station.
  • A dashboard widget: measured weather, next 24 hours, coming days.

How it differs from the other weather integrations: MET Norway gives a worldwide forecast without measurements, MeteoAlarm gives the official warnings (including DMI's). This one gives the measurements of the DMI stations and the DMI model, the most precise for Denmark.

Requirements​

  • Gladys Assistant 5.3.0 or later.
  • Gladys must reach opendataapi.dmi.dk over HTTPS.
  • For the houses: a location set in Settings → Houses of Gladys.

Installation​

  1. In Gladys, open Integrations → Install from GitHub and enter https://github.com/guim31/gladys-dmi, or install DMI from the store.
  2. Open the Configuration tab, check the settings and save.
  3. Open the Discovery tab and add the devices you want: a forecast device per place, a station device per station.

Configuration​

  • Follow the Gladys houses: one place per house with a location.
  • Other place: latitude, longitude (decimal degrees, a comma is accepted) and a name. Leave empty for the houses only.
  • DMI station: empty for the nearest station measuring temperature and wind; or a DMI station id, five digits (06180 for Copenhagen Airport). The ids are on the DMI open data pages.
  • Nearest station within: 25, 50 or 100 km. Farther, the place gets the forecast only (a place outside Denmark, for instance).
  • Refresh interval: 10 minutes by default, as often as DMI measures.
  • Language of the names and texts: names of the features of new devices, weather in words, scene action sentences. French by default.

The devices​

The forecast device of a place holds: temperature, humidity, pressure, wind speed, wind gusts, wind direction, cloud cover, precipitation of the hour (mm), the weather in words (clear, partly cloudy, cloudy, light rain, rain, snow), the low, high and precipitation of today (since the start of the model run, early in the morning) and of tomorrow.

The station device holds what the station measures, among: temperature, humidity, pressure at sea level, wind speed, gusts (highest 3-second wind of the last 10 minutes), direction, precipitation of the last hour, visibility and cloud cover. A value older than 3 hours is not published (station stopped). Every feature can start a Gladys scene ("temperature below 0 °C").

Dashboard widget​

The DMI weather widget shows, for a place: the weather in words, the station and the time of its measurement, the temperature, wind and humidity measured (forecast when no station is near), a 24-hour temperature chart and the next three days. Settings: the place (or a station: measurements only), show the chart, show the coming days.

Scene trigger: DMI forecast alert​

Fired when the forecast of a place announces, within 24 hours:

  • frost: a temperature below 0 °C;
  • storm gusts: gusts of 24.5 m/s or more;
  • heavy rain: 24 mm or more within 6 hours.

An alert is fired when it appears in the forecast, again a day later if it still lasts, and never twice because of a restart. Filter by place and kind. Variables: kind (frost, storm, heavy_rain), value (lowest temperature in °C, strongest gust in m/s or largest 6-hour total in mm) and starts_at.

Scene actions​

  • Read the DMI forecast: for a place and a day (today, tomorrow, the day after), gives the low, high, precipitation, strongest gust, weather, and a sentence such as "Tomorrow in DMI Home: Light rain, 3 to 7 °C, 2.1 mm of precipitation, gusts up to 14 m/s." Fails when the forecast does not cover enough of the day.
  • Read the DMI station: for a place or a station, gives temperature, humidity, wind, gust, precipitation of the last hour, the station name and the time of the measurement. Fails without a recent measurement.

Configuration action: check DMI​

Check DMI reads, for every place (added or not), its station and its forecast, and shows the answer. Shown in red when DMI does not answer.

Refresh and quotas​

DMI publishes no quota for its keyless open data, but refuses bursts of requests. The integration sends one request at a time, a second apart, and retries after a pause. Per refresh: one request per added station; the forecast of an added place at most once an hour (the model runs every three hours); the station list once a day. Only the devices you added are read.

Troubleshooting​

  • "No location": give a house a location in Gladys, or enter coordinates.
  • "Outside the DMI forecast area": the DMI models cover Denmark, the Faroe Islands, Iceland, the North Sea and Greenland.
  • No station device: no DMI station within the chosen distance; raise it, or enter a station id.
  • "This DMI station is unknown": the id is wrong or the station stopped; leave the field empty.
  • Set LOG_LEVEL=debug for the detail of every request.

Limits​

  • The weather in words is derived from the cloud cover, the precipitation and the temperature: HARMONIE gives no weather symbol.
  • The forecast covers about 60 hours (72 in Greenland): the day after tomorrow is often partial.
  • The DMI warnings are not part of the open data: use MeteoAlarm.

Credits and licence​

Data: Danish Meteorological Institute (DMI), open data under the Creative Commons Attribution 4.0 licence. Integration: Apache-2.0, by guim31.

Configuration settings​

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

SettingTypeRequiredDescription
DMI weathersectionNoOpen data of the Danish Meteorological Institute (DMI): what its nearest weather station measures, and its HARMONIE forecast. Public data, no account, no key. One device per place and one per station. Not affiliated with DMI.
Follow the Gladys housesbooleanNoOne device per house that has a location in Gladys (Settings → Houses).
Other place: latitudestringNoDecimal degrees, a comma is accepted. Leave empty for the houses only.
Other place: longitudestringNoDecimal degrees, east positive.
Other place: namestringNoName of its device, DMI when empty.
DMI stationstringNoEmpty: the nearest station measuring temperature and wind. Or a DMI station id (5 digits).
Nearest station withinselectNoFarther than this, the place gets the forecast only.
Refresh intervalselectNoDMI stations measure every 10 minutes; the forecast is read at most once an hour.
Language of the names and textsselectNoFeature names of new devices, weather texts, scene action summary.

How to install DMI in Gladys​

  1. In Gladys, open Integrations: DMI appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/guim31/gladys-dmi:1.0.0), 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/guim31/gladys-dmi.

DMI requires Gladys >=5.3.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​

DMI 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 guim31, 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 🙂