Rain Warner — Hyperlocal DWD radar nowcasting (2–6 h forecast, alert sensors, Lovelace card)

:cloud_with_rain: Rain Warner

I built a Home Assistant integration that turns the raw DWD RADOLAN radar composite into hyperlocal precipitation sensors with a 2–6 h forecast — no external Python deps, no API key, free unlimited DWD Open Data.

Repo: GitHub - nodomain/ha-rain-warner: Smart Rain Prediction for Home Assistant · GitHub
Install: HACS → Custom repository → nodomain/ha-rain-warner (one-click button in the README)


Why another rain integration?

Most weather components give you "nearest station" or "model grid cell" values. Rain Warner reads the actual 1.1 km × 1.1 km radar grid that DWD publishes every 5 minutes (DE1200_RV_LATEST.tar.bz2), parses it in pure Python (no numpy / h5py / pysteps required), and tells you what's happening over your roof — plus the 2 h RADVOR nowcast and an extension up to 6 h via custom optical flow.

For non-German users: there's a global Open-Meteo fallback. The default auto mode picks DWD when you're inside coverage and Open-Meteo otherwise.

What you get

Sensors

  • Current precipitation (mm/h), intensity class, type (rain / sleet / freezing rain / snow / hail likely)
  • Rain starts in / ends in (minutes) + absolute clock times"endet um 18:42" instead of "endet in 250 min"
  • Max & total precipitation for next 1 h / 2 h
  • Today / yesterday accumulation, dry-streak hours, last rain timestamp, 30-day daily-rain history (persisted across restarts)

Binary sensors — wire-and-forget alerts

  • rain_imminent — dry now, rain in ≤ 30 min (use this for "grab the laundry" push notifications)
  • severe_weather — heavy / violent / hail likelihood
  • winter_weather — snow / sleet / freezing rain
  • extended_dry_spell — ≥ 7 days dry and no rain in the 6 h forecast

These pre-compute the conditions you actually want to react to, so you can wire them straight into Lovelace conditional cards and automations without re-implementing the logic in Jinja.

Custom Lovelace card

A vanilla-JS custom card (no build step, ~6 KB, no dependencies) with status banner, 2 h precipitation bar chart and an optional 6 h extended-forecast tail. Auto-registers in the visual editor's card picker.

Two nowcast engines

Beyond DWD's 2 h RADVOR horizon the integration extends the forecast up to 6 h. Pick your engine in the config flow:

  • Simple (default, stdlib) — cross-correlation + semi-Lagrangian advection. Estimates a global motion vector and advects the latest frame. Runs comfortably on a Raspberry Pi 4. Best for frontal weather.
  • pysteps (opt-in) — wraps the pysteps library: Lucas-Kanade per-pixel optical flow + S-PROG cascade decomposition with AR(2) lifecycle modelling. State-of-the-art for convective storms. Requires pip install pysteps in your HA Python env (recommended for Intel/x86 hosts). Falls back to the simple engine if the import fails — never worse than the baseline.

Reference automations & dashboard

The repo ships YAML reference snippets you can drop straight into your setup:

  • automations/rain-warner-push.yaml — two iOS time-sensitive push automations (rain in <30 min / severe weather + hail). Tag/group set so iOS stacks notifications instead of spamming the lock screen, gated to 07:00–22:00 by default so a 4 a.m. summer storm doesn't wake you up.
  • dashboard/notification-cards.yaml — four conditional markdown cards (:cloud_with_rain: rain coming / :cloud_with_lightning_and_rain: severe / :snowflake: winter / :cactus: dry spell) for any walldisplay notification stack.
  • dashboard/rain-warner-dashboard.yaml — full reference dashboard with the custom card, tile sensors and history graphs.

Architecture highlights for the curious

  • Pure stdlib RADOLAN parserarray, bz2, tarfile, re, math. Reads DWD's binary grid format directly (uint16 LE, 1200×1100 cells, polar stereographic projection, ASCII header with ETX terminator).
  • Polar stereographic projection baked in — sub-km accuracy when mapping GPS coordinates to radar grid cells.
  • Optical-flow nowcasting — derived independently in nowcast.py (pysteps-inspired but stdlib-only). Tested against synthetic moving rain blocks and live DWD data.
  • 80 unit tests, all green, runnable without a HA install (uv run pytest tests/). Tests use mocked HA modules so the parser, projection, optical flow, alert flag logic, statistics and Open-Meteo client are fully exercised in CI.

Status & versioning

Currently at v0.6.1, calver-friendly weekly releases on GitHub. Used daily on my own Intel NUC HA install. Issues + PRs welcome — especially feedback from non-German users running the Open-Meteo backend and from anyone with pysteps installed and convective storms to throw at it.

Cheers, and may your laundry stay dry. :sun_behind_rain_cloud:

2 Likes

v0.7.0 — Radar camera, interactive map & rock-solid motion tracking

Highlights

  • Radar camera entity (camera.radarbild) — a rendered local radar crop around your location, color-coded by intensity with a motion-direction arrow baked in.
  • Interactive radar map — dark Leaflet map with the live DWD WMS overlay (served same-origin, no API key, no CORS pain) plus a geo-scaled motion arrow that projects the rain front up to 6 h with hour ticks and arrival times. Tap the heading for a fullscreen view.
  • Much steadier motion tracking — the simple engine now does multi-pair TREC estimation with sub-pixel refinement and temporal smoothing, so the arrow stops jumping around between 5-min updates.
  • Less alarm fatiguerain_imminent no longer cries wolf over trace radar echoes; it only fires for rain you'd actually notice (≥ 0.3 mm/h within 30 min).

Full changelog: https://github.com/nodomain/ha-rain-warner/releases/tag/v0.7.0