> ## Content Index
> Fetch the complete content index at: https://blog.thebrainyhome.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# DMI Weather: Danish forecasts, observations and lightning in Home Assistant
- URL: https://blog.thebrainyhome.com/dmi-weather/
- Published: 2026-11-22T14:26:24.000Z
- Updated: 2026-11-22T14:52:01.000Z
- Description: A free Home Assistant integration for DMI's open data: a 2 km HARMONIE forecast, measurements from the nearest DMI station and lightning strikes near you. No API key needed.
- Author: Bjarne Riis
- Tags: Home Assistant, Weather

DMI, the Danish Meteorological Institute, publishes a lot of its data for free through its Open Data API. That includes its own high-resolution weather model, measurements from its weather stations and lightning detections. **DMI Weather** is my Home Assistant integration that brings all three into Home Assistant: a `weather` entity with hourly and daily forecasts, plus sensors you can use in automations and dashboards.

No API key, no account, and setup is done entirely in the UI.

![Danish Meteorological Institute logo](https://raw.githubusercontent.com/briis/ha-dmi-weather/main/custom_components/dmi_weather/brand/logo@2x.png)

## Forecasts from HARMONIE

The forecast comes from DMI's **HARMONIE DINI** model. It runs on a grid of about 2 km, in hourly steps, roughly 60 hours ahead, and DMI starts a new run every 3 hours. The integration picks the grid point nearest your location, so you get a forecast for where you actually live rather than for the nearest big town.

- **Hourly forecast**: runs until the end of the current model run, typically 50–60 hours ahead.
- **Daily forecast**: today plus the next two days. Days with fewer than 12 hourly steps are left out, so you don't get a misleading high or low built from half a day.

On top of the weather entity there are sensors for the *current hour* of the forecast: temperature, humidity, pressure, wind speed, gust and direction, precipitation next hour, chance of precipitation (from DMI's ensemble forecast), cloud cover and solar radiation. Dew point, visibility and lightning probability are there too, disabled by default. A diagnostic sensor shows which model run the data comes from.

Those current-hour sensors are mainly there for comparison. If you have your own weather station, it's interesting to see how close the model gets to what you actually measure.

## Real measurements from DMI's stations

A forecast is a model estimate. So the integration also finds the nearest active DMI Synop station within 50 km and creates **observed** sensors from it: temperature, humidity, sea-level pressure, wind, precipitation over the last 10 minutes and the last hour, cloud cover and solar radiation (with dew point, visibility and sunshine minutes available if you enable them).

Every observed sensor carries attributes for the station name and ID, its distance from you and the time of the measurement. If a value is more than an hour old, the sensor goes unavailable instead of showing stale data. And if there's no station within 50 km, the observed sensors simply aren't created.

## Lightning

DMI's lightning detection network is part of the open data as well. The integration gives you:

- Strikes in the last hour within your chosen radius (and the last 10 minutes, disabled by default)
- The nearest strike, with direction, time and current in kA as attributes
- The most recent strike, with distance, direction and current

That makes for some useful automations, like a notification when lightning is getting close, or switching off sensitive equipment.

## A current condition based on what's actually happening

DMI's API doesn't include a weather symbol, so the integration works out the condition itself. The current condition in the weather entity is based on **measured** values: recent precipitation, cloud cover, visibility and wind from the nearest station, with forecast values filling any gaps. If there has been a lightning strike within 20 km in the last 15 minutes, the condition switches to *lightning*, or *lightning-rainy* if it's also raining.

## Installation

On **Home Assistant 2026.11 and later**, you can install it straight from the new Marketplace:

1. Go to **Settings → Marketplace** and choose *Add from link*.
2. Enter `briis/ha-dmi-weather` (you may need to connect GitHub).
3. Download **DMI Weather** and restart Home Assistant.
4. Go to **Settings → Devices & services → Add integration → DMI Weather**.

On Home Assistant 2026.1–2026.10, add the same repository to HACS as a custom repository of type *Integration*. You can also copy `custom_components/dmi_weather` into your config folder manually.

The location defaults to your Home Assistant home location, and there's a map picker if you want somewhere else. It has to be inside the HARMONIE DINI model area, which covers Northwestern Europe. You can add the integration several times if you want forecasts for more than one place, such as your summer house.

## Options

The second setup step, and later the **Configure** button, lets you choose:

| Setting                        | Default       | Notes                                       |
| ------------------------------ | ------------- | ------------------------------------------- |
| Address on dmi.dk              | Nearest place | Where the device's *Visit* button takes you |
| Observations from DMI stations | On            | Updated every 10 minutes                    |
| Lightning near the location    | On            | Updated every 5 minutes                     |
| Lightning radius               | 50 km         | 10–300 km                                   |

Turning off observations or lightning removes those sensors and stops the requests to those APIs completely. The *Visit* button opens your location on dmi.dk, which is handy because dmi.dk shows DMI's longer forecast. The nearest place is found offline from a bundled list of Danish, Faroese and Greenlandic places with at least 500 inhabitants.

## Being a good API citizen

DMI's fair-use limit is shared by everyone using the API, so the integration is careful about how often it asks. The forecast is fetched every 30 minutes (the model only changes every 3 hours anyway), observations every 10 minutes and lightning every 5 minutes. If DMI answers with HTTP 429 (rate limited), the underlying [pydmi-weather](https://pypi.org/project/pydmi-weather/?ref=blog.thebrainyhome.com) library backs off and keeps serving the last forecast.

## Need more than 2½ days?

The biggest limitation of DMI Weather is how far ahead it reaches. The daily forecast covers **today plus the next two days**, and the hourly forecast stops when the model run ends, about 2½ days out. That isn't a choice I made in the integration. It's simply how far DMI's HARMONIE DINI model runs. The 7–10 day forecast you see on dmi.dk comes from ECMWF, and that data isn't part of DMI's free open data, so there's no way to get it through this integration.

If you want a longer forecast, I've also made [**Open-Meteo Weather**](https://github.com/briis/ha-openmeteo?ref=blog.thebrainyhome.com), an integration for the free Open-Meteo API. It gives you daily and hourly forecasts of up to 16 days, and you choose which weather model to use: *Best match* by default, or one of around 50 models such as ECMWF IFS, DWD ICON, MET Norway Nordic or DMI Harmonie. It also adds air quality and pollen.

The two work well together. Use DMI Weather for the next couple of days, the local station measurements and lightning, and Open-Meteo for the week ahead. Just keep in mind that regional models such as DMI Harmonie only run a couple of days ahead, so for the week ahead leave it on Best match or pick a global model like ECMWF IFS. I'll write a separate post about Open-Meteo Weather soon.

## Limitations

- **About 60 hours of forecast.** That's the full length of the HARMONIE DINI model, and the integration can't stretch it.
- **No 7–10 day forecast.** See above: for day 3 and beyond, add Open-Meteo Weather alongside it.
- **Model vs. measurement.** Forecast sensors are model estimates. If you want what's actually happening, use the observed sensors, or your own station.

## Get it

The integration is open source under the MIT license: [github.com/briis/ha-dmi-weather](https://github.com/briis/ha-dmi-weather?ref=blog.thebrainyhome.com). Bug reports and ideas are very welcome there. It's a community project and isn't made or endorsed by DMI. The forecast and observation data are © DMI under CC BY 4.0, and every entity carries the required attribution.

If you run your own weather station, take a look at [WeatherDataLogger](https://blog.thebrainyhome.com/weatherdatalogger/) too. It's a nice match: your own station for what's happening right now, and DMI for what's coming.

– Bjarne