node-red-contrib-norbico
v0.2.1
Published
Node-RED nodes for Danish utility APIs: Eloverblik (electricity) and Aalborg Forsyning (district heating). Per-meter outputs, encrypted credentials, MQTT runtime control, automatic retry, and CSV payloads ready for downstream systems like Niagara.
Downloads
346
Maintainers
Readme
node-red-contrib-norbico
Node-RED nodes for Danish utility APIs.
| Node | API | Data |
|------|-----|------|
| Eloverblik | api.eloverblik.dk | Electricity consumption |
| Aalborg Forsyning | services.aalborgforsyning.dk | District heating & water consumption |
Both nodes appear under the Norbico category in the Node-RED palette and emit CSV payloads suitable for downstream systems like Niagara.
Install
cd ~/.node-red
npm install node-red-contrib-norbicoOr use the Node-RED palette manager (Install tab → search norbico).
Requirements: Node-RED 2.0+, Node.js 14+, plus credentials for whichever API you're using.
Eloverblik
Fetches electricity consumption time series from Energinet's customer API.
Configuration (see in-node help for full detail):
- Refresh token (encrypted, ~1 year validity)
- Resolution: Actual / Quarter / Hour / Day / Month / Year
- Date range: presets (yesterday, last month, etc.) or custom
- One output per meter
Output payload (CSV, 10 fields):
meterID, periodEnd_local, kWh, periodStart_local, periodEnd_local,
resolution, position, quality, unit, triggerTimestamps are Europe/Copenhagen local time. The first 6 fields match the legacy manual-function-node format for back-compat.
Quality field codes (ENTSO-E / Energinet):
| Code | Meaning | |------|---------| | A03 | Estimated (reading didn't arrive in time) | | A04 | Measured (real measurement) | | Other | Adjusted, substituted, or not available |
Treat A04 as authoritative; flag others for review. See the in-node help for the full list.
MQTT runtime control:
| Topic | Effect |
|-------|--------|
| Eloverblik/Configuration/Token | Update refresh token (persists encrypted) |
| Eloverblik/Configuration/MeterIDs | Override meter list (comma-separated, or empty for all) |
| Eloverblik/Configuration/ForceUpdate | Trigger a fetch (payload truthy) |
Default prefix is Eloverblik, configurable per node.
Aalborg Forsyning
Fetches both district heating and water meter data. Meter type is detected automatically from the API response; each profile has its own CSV format and output topic.
Configuration (see in-node help for full detail):
- Username + password (encrypted)
- One output per meter, mixed heating/water OK in the same node
- Optional daily schedule (HH:MM)
API limits enforced by the node:
- 3 calls per 24 hours (official limit)
- 5-hour minimum between scheduled calls (bypassable via ForceUpdate)
- Budget persisted to disk; survives Node-RED restarts
The node maintains daily counter snapshots for each meter (62-day retention) and uses them to compute daily, current-month, and previous-month consumption between API calls. Confidence labels (complete / partial / unavailable) flag whether the underlying snapshot coverage is sufficient.
Heating profile
Topic: AalborgForsyning/Consumption/Heating/<meterID>
Payload (CSV, 16 fields):
meterID, timestamp, energy_MWh, volume_m3, temp_supply, temp_return, flow,
operating_hours, readings_count, daily_MWh, currentMonth_MWh,
previousMonth_MWh, currentMonth_daysMissing, currentMonth_confidence,
previousMonth_confidence, triggerThe first 13 fields match the legacy EnergyMeter_xxx function-node format for back-compat with existing Niagara wiring.
Water profile
Topic: AalborgForsyning/Consumption/Water/<meterID>
Payload (CSV, 11 fields):
meterID, timestamp, volume_m3, readings_count, daily_m3, currentMonth_m3,
previousMonth_m3, currentMonth_daysMissing, currentMonth_confidence,
previousMonth_confidence, triggerMQTT runtime control
| Topic | Effect |
|-------|--------|
| AalborgForsyning/Configuration/Username | Update username (persists encrypted) |
| AalborgForsyning/Configuration/Password | Update password (persists encrypted) |
| AalborgForsyning/Configuration/MeterIDs | Override meter list |
| AalborgForsyning/Configuration/ForceUpdate | Trigger a fetch |
State files
Snapshots and call history persist to two JSON files in the Node-RED user directory:
norbico-aalborg-<nodeId>.json— call history + heating snapshotsnorbico-aalborg-<nodeId>-water.json— water snapshots
Writes are atomic (temp file + rename); safe against crash mid-write.
Common behavior
Both nodes share:
- Encrypted credentials in Node-RED's credential store; MQTT-set credentials persist encrypted too
- Per-meter outputs — one output per configured meter, in dialog order
msg.debugalongside the CSVmsg.payload— same data as a structured object for inspection- Automatic retry on transient errors (HTTP 5xx, 408, 429, network failures) with configurable exponential backoff. Permanent errors (4xx) don't retry.
- Optional daily schedule as
HH:MM. For more complex schedules, drive the node from an external inject node.
License
MIT — see LICENSE.
