Files
EVOLV/examples/README.md

54 lines
3.8 KiB
Markdown
Raw Normal View History

feat(examples): pumpingstation-3pumps-dashboard end-to-end demo + bump generalFunctions New top-level examples/ folder for end-to-end demos that show how multiple EVOLV nodes work together (complementing the per-node example flows under nodes/<name>/examples/). Future end-to-end demos will live as siblings. First demo: pumpingstation-3pumps-dashboard - 1 pumpingStation (basin model, manual mode for the demo so it observes rather than auto-shutting pumps; safety guards disabled — see README) - 1 machineGroupControl (optimalcontrol mode, absolute scaling) - 3 rotatingMachine pumps (hidrostal-H05K-S03R curve) - 6 measurement nodes (per pump: upstream + downstream pressure mbar, simulator mode for continuous activity) - Process demand input via dashboard slider (0-300 m3/h) AND auto random generator (3s tick, [40, 240] m3/h) — both feed PS q_in + MGC Qd - Auto/Manual mode toggle (broadcasts setMode to all 3 pumps) - Station-wide Start / Stop / Emergency-Stop buttons - Per-pump setpoint slider, individual buttons, full status text - Two trend charts (flow per pump, power per pump) - FlowFuse dashboard at /dashboard/pumping-station-demo build_flow.py is the source of truth — it generates flow.json deterministically and is the right place to extend the demo. Bumps: nodes/generalFunctions 43f6906 -> 29b78a3 Fix: childRegistrationUtils now aliases the production softwareType values (rotatingmachine, machinegroupcontrol) to the dispatch keys parent nodes check for (machine, machinegroup). Without this, MGC <-> rotatingMachine and pumpingStation <-> MGC wiring silently never matched in production even though tests passed. Demo confirms: MGC reports '3 machine(s) connected'. Verified end-to-end on Dockerized Node-RED 2026-04-13: pumps reach operational ~5s after deploy, MGC distributes random demand across them, basin tracks net flow direction, all dashboard widgets update each second. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:53:47 +02:00
# EVOLV — End-to-End Example Flows
> **Working with these examples?** See [`WORKFLOW.md`](WORKFLOW.md) — the canonical guide for editing, switching projects, persistence, and debugging.
feat(examples): pumpingstation-3pumps-dashboard end-to-end demo + bump generalFunctions New top-level examples/ folder for end-to-end demos that show how multiple EVOLV nodes work together (complementing the per-node example flows under nodes/<name>/examples/). Future end-to-end demos will live as siblings. First demo: pumpingstation-3pumps-dashboard - 1 pumpingStation (basin model, manual mode for the demo so it observes rather than auto-shutting pumps; safety guards disabled — see README) - 1 machineGroupControl (optimalcontrol mode, absolute scaling) - 3 rotatingMachine pumps (hidrostal-H05K-S03R curve) - 6 measurement nodes (per pump: upstream + downstream pressure mbar, simulator mode for continuous activity) - Process demand input via dashboard slider (0-300 m3/h) AND auto random generator (3s tick, [40, 240] m3/h) — both feed PS q_in + MGC Qd - Auto/Manual mode toggle (broadcasts setMode to all 3 pumps) - Station-wide Start / Stop / Emergency-Stop buttons - Per-pump setpoint slider, individual buttons, full status text - Two trend charts (flow per pump, power per pump) - FlowFuse dashboard at /dashboard/pumping-station-demo build_flow.py is the source of truth — it generates flow.json deterministically and is the right place to extend the demo. Bumps: nodes/generalFunctions 43f6906 -> 29b78a3 Fix: childRegistrationUtils now aliases the production softwareType values (rotatingmachine, machinegroupcontrol) to the dispatch keys parent nodes check for (machine, machinegroup). Without this, MGC <-> rotatingMachine and pumpingStation <-> MGC wiring silently never matched in production even though tests passed. Demo confirms: MGC reports '3 machine(s) connected'. Verified end-to-end on Dockerized Node-RED 2026-04-13: pumps reach operational ~5s after deploy, MGC distributes random demand across them, basin tracks net flow direction, all dashboard widgets update each second. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:53:47 +02:00
Demo flows that show how multiple EVOLV nodes work together in a realistic wastewater-automation scenario. Each example is self-contained: its folder has a `flow.json` you can import directly into Node-RED plus a `README.md` that walks through the topology, control modes, and dashboard layout.
These flows complement the per-node example flows under `nodes/<name>/examples/` (which exercise a single node in isolation). Use the per-node flows for smoke tests during development; use the flows here when you want to see how a real plant section behaves end-to-end.
## Catalogue
| Folder | What it shows |
|---|---|
| [`pumpingstation-complete-example/`](pumpingstation-complete-example/) | End-to-end stack: pumpingStation + MGC + 3 pumps + 12 measurement nodes (4 per pump, physics-coupled), operator-driven inflow with scenario buttons (Constant / Sine / Diurnal / Storm), FlowFuse dashboard (realtime + 1h trends), and provisioned Grafana dashboard backed by InfluxDB. |
## How it loads
Each subfolder here is a **Node-RED project**. The Docker stack has Node-RED's Projects feature enabled and bootstraps each `examples/<name>/` into `/data/projects/<name>/` on first container start.
feat(examples): pumpingstation-3pumps-dashboard end-to-end demo + bump generalFunctions New top-level examples/ folder for end-to-end demos that show how multiple EVOLV nodes work together (complementing the per-node example flows under nodes/<name>/examples/). Future end-to-end demos will live as siblings. First demo: pumpingstation-3pumps-dashboard - 1 pumpingStation (basin model, manual mode for the demo so it observes rather than auto-shutting pumps; safety guards disabled — see README) - 1 machineGroupControl (optimalcontrol mode, absolute scaling) - 3 rotatingMachine pumps (hidrostal-H05K-S03R curve) - 6 measurement nodes (per pump: upstream + downstream pressure mbar, simulator mode for continuous activity) - Process demand input via dashboard slider (0-300 m3/h) AND auto random generator (3s tick, [40, 240] m3/h) — both feed PS q_in + MGC Qd - Auto/Manual mode toggle (broadcasts setMode to all 3 pumps) - Station-wide Start / Stop / Emergency-Stop buttons - Per-pump setpoint slider, individual buttons, full status text - Two trend charts (flow per pump, power per pump) - FlowFuse dashboard at /dashboard/pumping-station-demo build_flow.py is the source of truth — it generates flow.json deterministically and is the right place to extend the demo. Bumps: nodes/generalFunctions 43f6906 -> 29b78a3 Fix: childRegistrationUtils now aliases the production softwareType values (rotatingmachine, machinegroupcontrol) to the dispatch keys parent nodes check for (machine, machinegroup). Without this, MGC <-> rotatingMachine and pumpingStation <-> MGC wiring silently never matched in production even though tests passed. Demo confirms: MGC reports '3 machine(s) connected'. Verified end-to-end on Dockerized Node-RED 2026-04-13: pumps reach operational ~5s after deploy, MGC distributes random demand across them, basin tracks net flow direction, all dashboard widgets update each second. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:53:47 +02:00
To run:
feat(examples): pumpingstation-3pumps-dashboard end-to-end demo + bump generalFunctions New top-level examples/ folder for end-to-end demos that show how multiple EVOLV nodes work together (complementing the per-node example flows under nodes/<name>/examples/). Future end-to-end demos will live as siblings. First demo: pumpingstation-3pumps-dashboard - 1 pumpingStation (basin model, manual mode for the demo so it observes rather than auto-shutting pumps; safety guards disabled — see README) - 1 machineGroupControl (optimalcontrol mode, absolute scaling) - 3 rotatingMachine pumps (hidrostal-H05K-S03R curve) - 6 measurement nodes (per pump: upstream + downstream pressure mbar, simulator mode for continuous activity) - Process demand input via dashboard slider (0-300 m3/h) AND auto random generator (3s tick, [40, 240] m3/h) — both feed PS q_in + MGC Qd - Auto/Manual mode toggle (broadcasts setMode to all 3 pumps) - Station-wide Start / Stop / Emergency-Stop buttons - Per-pump setpoint slider, individual buttons, full status text - Two trend charts (flow per pump, power per pump) - FlowFuse dashboard at /dashboard/pumping-station-demo build_flow.py is the source of truth — it generates flow.json deterministically and is the right place to extend the demo. Bumps: nodes/generalFunctions 43f6906 -> 29b78a3 Fix: childRegistrationUtils now aliases the production softwareType values (rotatingmachine, machinegroupcontrol) to the dispatch keys parent nodes check for (machine, machinegroup). Without this, MGC <-> rotatingMachine and pumpingStation <-> MGC wiring silently never matched in production even though tests passed. Demo confirms: MGC reports '3 machine(s) connected'. Verified end-to-end on Dockerized Node-RED 2026-04-13: pumps reach operational ~5s after deploy, MGC distributes random demand across them, basin tracks net flow direction, all dashboard widgets update each second. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:53:47 +02:00
1. `docker compose up -d` from the EVOLV root.
feat(examples): pumpingstation-3pumps-dashboard end-to-end demo + bump generalFunctions New top-level examples/ folder for end-to-end demos that show how multiple EVOLV nodes work together (complementing the per-node example flows under nodes/<name>/examples/). Future end-to-end demos will live as siblings. First demo: pumpingstation-3pumps-dashboard - 1 pumpingStation (basin model, manual mode for the demo so it observes rather than auto-shutting pumps; safety guards disabled — see README) - 1 machineGroupControl (optimalcontrol mode, absolute scaling) - 3 rotatingMachine pumps (hidrostal-H05K-S03R curve) - 6 measurement nodes (per pump: upstream + downstream pressure mbar, simulator mode for continuous activity) - Process demand input via dashboard slider (0-300 m3/h) AND auto random generator (3s tick, [40, 240] m3/h) — both feed PS q_in + MGC Qd - Auto/Manual mode toggle (broadcasts setMode to all 3 pumps) - Station-wide Start / Stop / Emergency-Stop buttons - Per-pump setpoint slider, individual buttons, full status text - Two trend charts (flow per pump, power per pump) - FlowFuse dashboard at /dashboard/pumping-station-demo build_flow.py is the source of truth — it generates flow.json deterministically and is the right place to extend the demo. Bumps: nodes/generalFunctions 43f6906 -> 29b78a3 Fix: childRegistrationUtils now aliases the production softwareType values (rotatingmachine, machinegroupcontrol) to the dispatch keys parent nodes check for (machine, machinegroup). Without this, MGC <-> rotatingMachine and pumpingStation <-> MGC wiring silently never matched in production even though tests passed. Demo confirms: MGC reports '3 machine(s) connected'. Verified end-to-end on Dockerized Node-RED 2026-04-13: pumps reach operational ~5s after deploy, MGC distributes random demand across them, basin tracks net flow direction, all dashboard widgets update each second. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:53:47 +02:00
2. Open Node-RED at `http://localhost:1880`.
3. Menu → **Projects****Open Project** → pick one.
feat(examples): pumpingstation-3pumps-dashboard end-to-end demo + bump generalFunctions New top-level examples/ folder for end-to-end demos that show how multiple EVOLV nodes work together (complementing the per-node example flows under nodes/<name>/examples/). Future end-to-end demos will live as siblings. First demo: pumpingstation-3pumps-dashboard - 1 pumpingStation (basin model, manual mode for the demo so it observes rather than auto-shutting pumps; safety guards disabled — see README) - 1 machineGroupControl (optimalcontrol mode, absolute scaling) - 3 rotatingMachine pumps (hidrostal-H05K-S03R curve) - 6 measurement nodes (per pump: upstream + downstream pressure mbar, simulator mode for continuous activity) - Process demand input via dashboard slider (0-300 m3/h) AND auto random generator (3s tick, [40, 240] m3/h) — both feed PS q_in + MGC Qd - Auto/Manual mode toggle (broadcasts setMode to all 3 pumps) - Station-wide Start / Stop / Emergency-Stop buttons - Per-pump setpoint slider, individual buttons, full status text - Two trend charts (flow per pump, power per pump) - FlowFuse dashboard at /dashboard/pumping-station-demo build_flow.py is the source of truth — it generates flow.json deterministically and is the right place to extend the demo. Bumps: nodes/generalFunctions 43f6906 -> 29b78a3 Fix: childRegistrationUtils now aliases the production softwareType values (rotatingmachine, machinegroupcontrol) to the dispatch keys parent nodes check for (machine, machinegroup). Without this, MGC <-> rotatingMachine and pumpingStation <-> MGC wiring silently never matched in production even though tests passed. Demo confirms: MGC reports '3 machine(s) connected'. Verified end-to-end on Dockerized Node-RED 2026-04-13: pumps reach operational ~5s after deploy, MGC distributes random demand across them, basin tracks net flow direction, all dashboard widgets update each second. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:53:47 +02:00
4. Open the FlowFuse dashboard at `http://localhost:1880/dashboard`.
The default active project is `pumpingstation-complete-example` (override via `DEFAULT_PROJECT` env var on the nodered service). Switching is two clicks; persistence is handled by the `evolv_nodered_data` named volume — `docker compose down && up` doesn't lose the active flow.
Each example uses a unique dashboard `path` so they can coexist if you load multiple in the same runtime.
feat(examples): pumpingstation-3pumps-dashboard end-to-end demo + bump generalFunctions New top-level examples/ folder for end-to-end demos that show how multiple EVOLV nodes work together (complementing the per-node example flows under nodes/<name>/examples/). Future end-to-end demos will live as siblings. First demo: pumpingstation-3pumps-dashboard - 1 pumpingStation (basin model, manual mode for the demo so it observes rather than auto-shutting pumps; safety guards disabled — see README) - 1 machineGroupControl (optimalcontrol mode, absolute scaling) - 3 rotatingMachine pumps (hidrostal-H05K-S03R curve) - 6 measurement nodes (per pump: upstream + downstream pressure mbar, simulator mode for continuous activity) - Process demand input via dashboard slider (0-300 m3/h) AND auto random generator (3s tick, [40, 240] m3/h) — both feed PS q_in + MGC Qd - Auto/Manual mode toggle (broadcasts setMode to all 3 pumps) - Station-wide Start / Stop / Emergency-Stop buttons - Per-pump setpoint slider, individual buttons, full status text - Two trend charts (flow per pump, power per pump) - FlowFuse dashboard at /dashboard/pumping-station-demo build_flow.py is the source of truth — it generates flow.json deterministically and is the right place to extend the demo. Bumps: nodes/generalFunctions 43f6906 -> 29b78a3 Fix: childRegistrationUtils now aliases the production softwareType values (rotatingmachine, machinegroupcontrol) to the dispatch keys parent nodes check for (machine, machinegroup). Without this, MGC <-> rotatingMachine and pumpingStation <-> MGC wiring silently never matched in production even though tests passed. Demo confirms: MGC reports '3 machine(s) connected'. Verified end-to-end on Dockerized Node-RED 2026-04-13: pumps reach operational ~5s after deploy, MGC distributes random demand across them, basin tracks net flow direction, all dashboard widgets update each second. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:53:47 +02:00
## Adding new examples
When you create a new end-to-end example:
1. Make a subfolder under `examples/` named `<scenario>-<focus>`.
2. Include at least `flow.json` and `README.md`. A `build_flow.py` (or equivalent generator) is recommended so the JSON stays diff-friendly.
3. `docker compose restart nodered` — the entrypoint will bootstrap your new folder as a Node-RED project (synthesizes `package.json`, `git init`, initial commit) under `/data/projects/<name>/`.
4. Editor → Projects → Open Project → pick your new one.
5. Add a row to the catalogue table above.
The bootstrap skips folders that already exist in the volume. To force a refresh of an existing project from the repo source (e.g. after editing `build_flow.py`), use `./scripts/sync-example.sh <name>`.
feat(examples): pumpingstation-3pumps-dashboard end-to-end demo + bump generalFunctions New top-level examples/ folder for end-to-end demos that show how multiple EVOLV nodes work together (complementing the per-node example flows under nodes/<name>/examples/). Future end-to-end demos will live as siblings. First demo: pumpingstation-3pumps-dashboard - 1 pumpingStation (basin model, manual mode for the demo so it observes rather than auto-shutting pumps; safety guards disabled — see README) - 1 machineGroupControl (optimalcontrol mode, absolute scaling) - 3 rotatingMachine pumps (hidrostal-H05K-S03R curve) - 6 measurement nodes (per pump: upstream + downstream pressure mbar, simulator mode for continuous activity) - Process demand input via dashboard slider (0-300 m3/h) AND auto random generator (3s tick, [40, 240] m3/h) — both feed PS q_in + MGC Qd - Auto/Manual mode toggle (broadcasts setMode to all 3 pumps) - Station-wide Start / Stop / Emergency-Stop buttons - Per-pump setpoint slider, individual buttons, full status text - Two trend charts (flow per pump, power per pump) - FlowFuse dashboard at /dashboard/pumping-station-demo build_flow.py is the source of truth — it generates flow.json deterministically and is the right place to extend the demo. Bumps: nodes/generalFunctions 43f6906 -> 29b78a3 Fix: childRegistrationUtils now aliases the production softwareType values (rotatingmachine, machinegroupcontrol) to the dispatch keys parent nodes check for (machine, machinegroup). Without this, MGC <-> rotatingMachine and pumpingStation <-> MGC wiring silently never matched in production even though tests passed. Demo confirms: MGC reports '3 machine(s) connected'. Verified end-to-end on Dockerized Node-RED 2026-04-13: pumps reach operational ~5s after deploy, MGC distributes random demand across them, basin tracks net flow direction, all dashboard widgets update each second. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:53:47 +02:00
## Wishlist for future examples
These are scenarios worth building when there's a session for it:
- **Pump failure + MGC re-routing** — kill pump 2 mid-run, watch MGC redistribute to pumps 1 and 3.
- **Energy-optimal vs equal-flow control** — same demand profile run through `optimalcontrol` and `prioritycontrol` modes side-by-side, energy comparison chart.
- **Schedule-driven demand** — diurnal flow pattern (low at night, peak at 7 am), MGC auto-tuning over 24 simulated hours.
- **Reactor + clarifier loop** — `reactor` upstream feeding `settler`, return sludge controlled by a small `pumpingStation`.
- **Diffuser + DO control** — aeration grid driven by a PID controller from a dissolved-oxygen sensor.
- **Digital sensor bundle** — MQTT-style sensor (BME280, ATAS, etc.) feeding a `measurement` node in digital mode + parent equipment node.
- **Maintenance window** — entermaintenance / exitmaintenance cycle with operator handover dashboard.
- **Calibration walk-through** — measurement node calibrate cycle with stable / unstable input demonstrations.