Skip to main content
Data Connectors · Environment

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.

  • Data source
  • Trigger or polling
  • FloodMonitoring
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 Danger and trigger notifications.
  • Time series of a gauge provided for dashboards or analyses.

How the node works​

1

Trigger

An incoming message or the poll timer starts the fetch. If a fetch is already running, the new one is skipped.

2

Download

Station list (JSON) and measurement archive (ZIP with CSV) are loaded in parallel; the CSV is extracted.

3

Join

Readings are grouped by station number, sorted and enriched with name, catchment, coordinates and thresholds of the station.

4

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​

FieldTypeDefaultMeaning
NameTextemptyDisplay name of the node in the flow. Without a name the node shows "LANUK Hochwasser".
Output modeSelect (latest, timeseries)latestLatest 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 formatSelect (array, split)arraySingle message (array) sends all entities in one message; One message per station sends a separate message per entity.

Stations tab​

FieldTypeDefaultMeaning
Show only stations with current measurementsCheckbox (dialog only)enabledShows 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 stationsDual list with search fieldno selectionUse 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 selectionButtons–Reloads the station list, or removes the whole selection.

Sources tab​

FieldTypeDefaultMeaning
Measurements ZIPText (required)see belowAddress of the measurement archive. The contained text file is a semicolon-separated CSV with the columns station_no, time, value.
Station listText (required)see belowAddress of the station master data.
Poll interval (min)Number0Fetch interval in minutes. 0 disables polling; then only an input message starts the fetch.
Fetch on startupCheckboxenabledWith polling enabled, performs a first fetch about 2 seconds after deployment.
Timeout (sec)Number60Timeout 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​

FieldTypeDefaultMeaning
Entity typeText (required)FloodMonitoringValue of the field type in every entity and of msg.topic in array mode.
ID prefixTexturn:ngsi-ld:FloodMonitoring:LANUK:Prefix of the entity ID. The ID is built from prefix and station number.
Debug modeCheckboxoffWrites 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.

PropertyTypeMeaning
msganyStarts 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
}
}
FieldMeaning
idID prefix followed by the station number.
typeConfigured entity type, FloodMonitoring by default.
stationIDStation number (station_no) from the archive.
currentLevelLatest water level of the station in centimetres.
observationDateTimeTimestamp of the latest reading, unchanged from the CSV column time.
nameStation name from the master data; missing if the station is not in the station list.
areaServedCatchment (catchment_name) from the master data.
dataProviderOperator according to the master data (LANUV_Betr, falling back to site_name); LANUK without master data.
locationGeoJSON point in the order longitude, latitude; only present if the master data provides coordinates.
dangerLevelMean flood level (MHW) in centimetres from the master data; omitted if missing or 0.
referenceLevelGauge datum (station_gauge_datum) in centimetres; omitted if missing or 0.
floodLevelStatusDanger if currentLevel reaches or exceeds the danger threshold, otherwise Normal. Omitted without dangerLevel.
sourceConfigured address of the station list.
unitCodeAlways CMT (UN/CEFACT code for centimetre).
measurementsOnly in full time series mode: array of objects with observedAt and currentLevel, sorted chronologically.
lanuk.stationCountNumber of emitted entities.
lanuk.unmatchedStationsNumber of stations with readings but without an entry in the station list.
lanuk.containsPersonalDataAlways 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.

Step 1

Inject

An Inject node 'Go!' triggers the fetch manually. Alternatively set a poll interval in the node.

Step 2

LANUK Flood Portal

The node is preconfigured with the default endpoints, no station selection and the mode 'Latest value only' as an array.

Step 3

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​

IndicatorMeaning
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/stations of the Node-RED server. The endpoint requires the permission lanuk.read and 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 dataProvider names the operator of the station.

References​