LANUK Flood Portal
The node downloads the ZIP file with the current water levels of the NRW flood portal (operated by the State Agency for Nature, Environment and Climate, LANUK), extracts the contained CSV file and joins it with the station list. The result is a set of FloodMonitoring entities according to the FIWARE Smart Data Model, either with the latest value or the full time series.
- Node type
- lanuk
- Package
- @htag/node-red-contrib-hypertegrity-environment
- Inputs / outputs
- 1 / 1
- Data source
- NRW flood portal (hochwasserportal.nrw)
When to use this node
The NRW flood portal publishes the water levels of the state gauges in North Rhine-Westphalia as a regularly updated archive. The LANUK node brings this archive into a Node-RED flow, assigns the gauge master data to every reading and maps everything to the Smart Data Model FloodMonitoring, including danger threshold and flood status.
Typical use cases are:
- Gauges on state waters such as Ruhr, Lippe, Sieg or Wupper transferred into an NGSI-LD context broker.
- Flood alerting flows that evaluate the status
Dangerand trigger notifications. - Time series of a gauge provided for dashboards or analyses.
How the node works
Trigger
An incoming message or the poll timer starts the fetch. If a fetch is already running, the new one is skipped.
Download
Station list (JSON) and measurement archive (ZIP with CSV) are loaded in parallel; the CSV is extracted.
Join
Readings are grouped by station number, sorted and enriched with name, catchment, coordinates and thresholds of the station.
Emit
One FloodMonitoring entity is built per station, emitted as one array or as one message per station.
Result: FloodMonitoring entities with current water level in centimetres, status, location and retrieval metadata in msg.lanuk.
The node works trigger-based or by polling. With a poll interval of 0 only an incoming message starts the fetch. With an interval greater than 0 the node also fetches on its own and, if enabled, once about 2 seconds after startup. Properties of the triggering message are carried over into the output.
Configuration
The edit dialog is divided into the tabs General, Stations, Sources and Advanced.
General tab
| Field | Type | Default | Meaning |
|---|---|---|---|
| Name | Text | empty | Display name of the node in the flow. Without a name the node shows "LANUK Hochwasser". |
| Output mode | Select (latest, timeseries) | latest | Latest value only emits the most recent reading per station; Full time series adds an array measurements with all values of the archive to each entity. |
| Message format | Select (array, split) | array | Single message (array) sends all entities in one message; One message per station sends a separate message per entity. |
Stations tab
| Field | Type | Default | Meaning |
|---|---|---|---|
| Show only stations with current measurements | Checkbox (dialog only) | enabled | Shows only stations that have readings in the current archive in the left-hand list. If the archive is unreachable, all stations are shown. |
| Available stations / Selected stations | Dual list with search field | no selection | Use the arrow buttons to move stations to the right-hand list. The station numbers are stored in the array stations. Without a selection the node emits all stations that have readings. |
| Reload / Clear selection | Buttons | – | Reloads the station list, or removes the whole selection. |
Sources tab
| Field | Type | Default | Meaning |
|---|---|---|---|
| Measurements ZIP | Text (required) | see below | Address of the measurement archive. The contained text file is a semicolon-separated CSV with the columns station_no, time, value. |
| Station list | Text (required) | see below | Address of the station master data. |
| Poll interval (min) | Number | 0 | Fetch interval in minutes. 0 disables polling; then only an input message starts the fetch. |
| Fetch on startup | Checkbox | enabled | With polling enabled, performs a first fetch about 2 seconds after deployment. |
| Timeout (sec) | Number | 60 | Timeout for the two downloads in seconds. |
Default values of the URL fields:
Measurements ZIP: https://www.hochwasserportal.nrw/data/downloads/messwerte.zip
Station list: https://www.hochwasserportal.nrw/data/internet/stations/stations.json
Advanced tab
| Field | Type | Default | Meaning |
|---|---|---|---|
| Entity type | Text (required) | FloodMonitoring | Value of the field type in every entity and of msg.topic in array mode. |
| ID prefix | Text | urn:ngsi-ld:FloodMonitoring:LANUK: | Prefix of the entity ID. The ID is built from prefix and station number. |
| Debug mode | Checkbox | off | Writes detailed logs as warnings to the debug sidebar. |
Input
Every incoming message triggers a fetch. The node does not evaluate any special properties but passes the message on as the base of the output.
| Property | Type | Meaning |
|---|---|---|
msg | any | Starts the fetch. All properties of the message are kept in the output; payload, topic and lanuk are overwritten. |
If a message arrives while a fetch is running, it is skipped (with a hint in debug mode).
Output
In the message format array the node sends one message with all entities; in the format per station one message per entity with msg.topic set to the entity ID. In both cases msg.lanuk contains metadata about the retrieval.
{
"payload": [
{
"id": "urn:ngsi-ld:FloodMonitoring:LANUK:2718130000100",
"type": "FloodMonitoring",
"stationID": "2718130000100",
"currentLevel": 84,
"observationDateTime": "2026-10-01T08:00:00+02:00",
"name": "Exampletown",
"areaServed": "Example Brook",
"dataProvider": "LANUK",
"location": {"type": "Point", "coordinates": [7.0101, 51.4502]},
"dangerLevel": 180,
"referenceLevel": 112.5,
"floodLevelStatus": "Normal",
"source": "https://www.hochwasserportal.nrw/data/internet/stations/stations.json",
"unitCode": "CMT"
}
],
"topic": "FloodMonitoring",
"lanuk": {
"dataModel": "FloodMonitoring",
"source": "LANUK Hochwasserportal NRW",
"zipUrl": "https://www.hochwasserportal.nrw/data/downloads/messwerte.zip",
"stationsUrl": "https://www.hochwasserportal.nrw/data/internet/stations/stations.json",
"outputMode": "latest",
"retrievedAt": "2026-10-01T08:15:00.000Z",
"stationCount": 1,
"unmatchedStations": 0,
"containsPersonalData": false
}
}
| Field | Meaning |
|---|---|
id | ID prefix followed by the station number. |
type | Configured entity type, FloodMonitoring by default. |
stationID | Station number (station_no) from the archive. |
currentLevel | Latest water level of the station in centimetres. |
observationDateTime | Timestamp of the latest reading, unchanged from the CSV column time. |
name | Station name from the master data; missing if the station is not in the station list. |
areaServed | Catchment (catchment_name) from the master data. |
dataProvider | Operator according to the master data (LANUV_Betr, falling back to site_name); LANUK without master data. |
location | GeoJSON point in the order longitude, latitude; only present if the master data provides coordinates. |
dangerLevel | Mean flood level (MHW) in centimetres from the master data; omitted if missing or 0. |
referenceLevel | Gauge datum (station_gauge_datum) in centimetres; omitted if missing or 0. |
floodLevelStatus | Danger if currentLevel reaches or exceeds the danger threshold, otherwise Normal. Omitted without dangerLevel. |
source | Configured address of the station list. |
unitCode | Always CMT (UN/CEFACT code for centimetre). |
measurements | Only in full time series mode: array of objects with observedAt and currentLevel, sorted chronologically. |
lanuk.stationCount | Number of emitted entities. |
lanuk.unmatchedStations | Number of stations with readings but without an entry in the station list. |
lanuk.containsPersonalData | Always false; the data contains no personal information. |
Example flow
The package ships with an example flow. Import it in Node-RED via Menu → Import → Examples → @htag/node-red-contrib-hypertegrity-environment → lanuk. Alternatively download lanuk.json and import it via Menu → Import.
Inject
An Inject node 'Go!' triggers the fetch manually. Alternatively set a poll interval in the node.
LANUK Flood Portal
The node is preconfigured with the default endpoints, no station selection and the mode 'Latest value only' as an array.
Debug
A Debug node 'Lanuk Output' shows the array of FloodMonitoring entities in the sidebar.
Show example flow as JSON
[
{"id": "tab1", "type": "tab", "label": "Lanuk", "disabled": false, "info": ""},
{"id": "inject1", "type": "inject", "z": "tab1", "name": "Go!", "props": [{"p": "payload"}, {"p": "topic", "vt": "str"}], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 110, "y": 120, "wires": [["lanuk1"]]},
{"id": "lanuk1", "type": "lanuk", "z": "tab1", "name": "", "zipUrl": "https://www.hochwasserportal.nrw/data/downloads/messwerte.zip", "stationsUrl": "https://www.hochwasserportal.nrw/data/internet/stations/stations.json", "stations": [], "outputMode": "latest", "messageFormat": "array", "entityType": "FloodMonitoring", "idPrefix": "urn:ngsi-ld:FloodMonitoring:LANUK:", "pollInterval": 0, "requestTimeout": 60, "fetchOnStartup": true, "debug": false, "x": 320, "y": 120, "wires": [["debug1"]]},
{"id": "debug1", "type": "debug", "z": "tab1", "name": "Lanuk Output", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "x": 550, "y": 120, "wires": []}
]
Status and errors
| Indicator | Meaning |
|---|---|
| Blue dot "Loading data..." | Station list and measurement archive are being downloaded. |
| Blue dot "Processing..." | The CSV is being parsed and joined with the master data. |
| Green dot "n stations" | The fetch succeeded; n entities were sent. |
| Red ring "Retrieval failed" | Download, extraction or processing failed. The message "LANUK fetch failed: …" is reported via node.error together with the triggering message. |
Errors can be handled with a Catch node. The dialog shows the notification "Could not load the station list." if the admin endpoint cannot fetch the station list.
Notes
- Data volume and interval: The measurement archive is about 1 MB and is downloaded completely on every fetch. Choose a poll interval that matches the update frequency of the portal; intervals of 15 minutes or more are usually sufficient. No API key is required.
- Terms of use: Observe the terms of use and licence conditions of the NRW flood portal for reusing the data.
- Admin endpoint: The dialog loads the station list via
/lanuk/stationsof the Node-RED server. The endpoint requires the permissionlanuk.readand caches the list of stations with readings for 5 minutes. - Units: Water levels, danger threshold and gauge datum are given in centimetres (
unitCode: CMT). Decimal commas in the CSV are converted to points. - Output format: The entity is a flat object with an NGSI-style ID. Use the NGSI-LD Builder to shape the data for a context broker.
- Personal data: The datasets contain only technical station and measurement data and no personal information. The field
dataProvidernames the operator of the station.