npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-red-contrib-dwd-weatherforecast

v1.4.1

Published

Node-RED node for official DWD MOSMIX forecast (KMZ/KML) per weather station. Parses the forecast, normalizes it, and outputs a structured JSON time series.

Downloads

164

Readme

node-red-contrib-dwd-weatherforecast

A Node-RED node that retrieves local weather forecasts from the Deutscher Wetterdienst (DWD) using the official MOSMIX_L open data products.

The node downloads the KMZ file for a given DWD station, extracts and parses the KML content and returns a structured JSON payload that is easy to consume in dashboards, notifications or further processing nodes.


✨ Features

  • Uses official DWD MOSMIX_L forecast data (hourly resolution)
  • Works with any DWD single station ID (e.g. H721 for Cologne/Bonn)
  • Supports auto-refresh (periodic updates, no inject node required)
  • Optional fetch on deploy (immediate forecast after deployment)
  • Optional stale fallback (keep last valid data if DWD is temporarily unavailable)
  • Configurable forecast horizon (limit to next N hours)
  • Flexible unit conversions (°C, hPa, km/h, km)
  • Optional core-only mode for compact payloads
  • Optional cardinal wind direction output (windDirCardinal) in 8 or 16 sectors
  • Adds a human-readable precipitation text field
  • Fully i18n-enabled (English / German, including help text and status messages)

📦 Install

From your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-dwd-weatherforecast

Or via the Node-RED Palette Manager:

  1. Open the Node-RED editor
  2. Menu → Manage palette
  3. Tab Install
  4. Search for node-red-contrib-dwd-weatherforecast
  5. Click Install

🔧 Configuration

The main configuration options of the node:

Name

Optional display name for the node. If left empty, a default label is used.

DWD station ID

The DWD station identifier, for example H721 for Cologne/Bonn airport.

You can look up station IDs via the DWD documentation and station lists.

Source URL

Template URL for the DWD MOSMIX_L KMZ file. By default:

https://opendata.dwd.de/weather/local_forecasts/mos/MOSMIX_L/single_stations/{station}/kml/MOSMIX_L_LATEST_{station}.kmz

The placeholder {station} will be replaced with the configured station ID (e.g. H721).

In most cases you can keep this field untouched.

Fetch on deploy

When enabled, the node performs an initial fetch shortly after the flow is deployed.
This is useful when you always want to have fresh data available without a manual trigger.

Auto-refresh (sec)

Interval in seconds for periodic updates.

  • 0 → no automatic refresh (only manual/inject-triggered)
  • > 0 → fetch forecast in this interval (e.g. 1800 = every 30 minutes)

Lead time (hours)

Limits the forecast horizon.

  • 0 → all available forecast steps
  • 24 → only the next 24 hours
  • 48 → next two days, etc.

Only future timestamps

If enabled, forecast steps in the past are filtered out and only current / future timestamps are returned.

Fallback on error (stale)

When enabled, the node returns the last successfully fetched forecast data in case of an error (network issues, DWD outage, etc.).
The _meta.stale flag in the output is set to true in this case.

Output options

  • Core fields only
    Reduces the payload to the main weather parameters (temperature, pressure, wind, precipitation, humidity, visibility).

  • Temperature in °C
    Converts Kelvin → °C.

  • Wind speed in km/h
    Converts m/s → km/h.

  • Pressure in hPa
    Converts Pa → hPa.

  • Visibility in km
    Converts m → km.

  • Wind direction as text
    Controls whether the node adds a windDirCardinal field:

    • deg → keep numeric degrees only (0–360)
    • 8 → 8 sectors (N, NE, E, SE, S, SW, W, NW)
    • 16 → 16 sectors (N, NNE, NE, ENE, E, ESE, …)

Enable diagnostics

When enabled, additional log messages are written into the Node-RED log to help with debugging and understanding the internal processing steps.


🔌 Inputs

Any incoming message triggers a forecast update using the current configuration, unless the node is already updating due to auto-refresh.

The contents of the input message are not evaluated in the current version – only the trigger matters.


📤 Outputs

The node outputs a message where msg.payload contains an array of forecast steps and additional metadata:

{
  "payload": [
    {
      "ts": 1761609600000,
      "iso": "2025-10-28T00:00:00.000Z",
      "temperature": 7.7,
      "pressure": 1010.1,
      "windSpeed": 18.5,
      "windDir": 236,
      "windDirCardinal": "SW",
      "cloudCover": 69,
      "precipitation": 0.3,
      "precipitationText": "Rain (light)",
      "relHumidity": 92,
      "condition": "61",
      "visibility": 25.7
    }
  ],
  "station": {
    "id": "H721",
    "name": "Köln/Bonn-Flughafen"
  },
  "_meta": {
    "url": "https://opendata.dwd.de/weather/local_forecasts/mos/MOSMIX_L/single_stations/H721/kml/MOSMIX_L_LATEST_H721.kmz",
    "count": 120,
    "stale": false,
    "coreOnly": false
  }
}

The exact structure depends on your configuration (unit conversions, core-only mode, visibility, wind direction options, etc.).


🔎 Status text

The node uses its status indicator in the Node-RED editor to show what it is doing:

  • loading… – fetching data from DWD
  • ready – idle, waiting for triggers or auto-refresh
  • ok – last fetch successful, shows number of points
  • error – an error occurred while fetching or parsing
  • stale (n) – serving cached (stale) data because the latest fetch failed

All status strings are localized (English / German).


🌍 Internationalisation (i18n)

All editor labels, tips, help text and runtime status messages are localized using the Node-RED i18n mechanism:

  • English:
    • nodes/locales/en-US/dwd-weatherforecast.json
    • nodes/locales/en-US/dwd-weatherforecast.html
  • German:
    • nodes/locales/de/dwd-weatherforecast.json
    • nodes/locales/de/dwd-weatherforecast.html

The Node-RED editor language (or browser language, if configured) controls which texts are displayed.


🧪 Example flow

A basic example flow is included in:

examples/weatherforecast-basic.json

It demonstrates:

  • manual triggering via Inject node,
  • configuration of the DWD station ID,
  • and inspection of the full payload using a Debug node.

Import steps:

  1. In Node-RED, open the menu → Import
  2. Choose Clipboard
  3. Paste the contents of weatherforecast-basic.json
  4. Click Import

🗺️ Roadmap

Planned enhancements:

  • Additional helper fields (e.g. “feels like” temperature)
  • Optional aggregation (min/max per day)
  • Ready-to-use dashboard examples
  • Combined flows with other DWD nodes (pollen, warnings, rain radar)
  • Extended error reporting and metrics

⚖️ License

MIT © 2025 Gerd Rütten


🧰 Changelog

See CHANGELOG.md for a detailed list of changes.


🌦 node-red-contrib-dwd-weatherforecast — bringing official DWD forecast data directly into your Node-RED flows.