Two governance items from the 2026-05-14 quality review:
- test/_output-manifest.md enumerates every Port 0/1/2 key MGC emits, its
source, type, range, and which tests cover it in populated/degraded states
(per .claude/rules/output-coverage.md).
- src/control/strategies.js extracts computeEqualFlowDistribution as a pure
function so the equal-flow algorithm is testable without an MGC fixture.
test/basic/equalFlowDistribution.basic.test.js (6 tests) covers all three
demand branches and pins the legacy quirk where the default branch counts
active machines but iterates priority-ordered first-N (documented in the
test so the future cleanup is a deliberate change).
Plus rolled-up session work that landed alongside:
- set.demand is now unit-self-describing ({value, unit:'m3/h'|'l/s'|'%'|...}
or bare number = %); setScaling/scaling.current removed from MGC, commands,
editor (mgc.html), specificClass.
- _optimalControl + equalFlowControl now compute eta = (Q*dP)/P_shaft rather
than Q/P, keeping the metric in the same scale as each child's cog.
- groupEfficiency.calcRelativeDistanceFromPeak returns undefined (was 1) when
pumps are homogeneous (|max-min| < 1e-9). Dashboard treats undefined as
'-' instead of showing a misleading 100% / 0% reading.
- examples/02-Dashboard.json: auto-init inject so the dashboard populates at
deploy, NCog formatter normalizes the SUM emitted by MGC by
machineCountActive, Q-H fanout trims the flat-Q tail so the H axis isn't
stretched to 40m by curve-envelope clamp points, num/pct treat null AND
undefined as no-data (closes the +null === 0 trap).
- new test/integration/dashboard-fanout.integration.test.js (17 tests),
bep-distance-demand-sweep.integration.test.js (3 tests),
group-bep-cascade.integration.test.js -- total suite now 108/108 green.
- .gitignore: wiki/test.gif (143 MB screen recording, kept locally only).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
machineGroupControl - Example Flows
Import-ready Node-RED examples for machineGroupControl (MGC). MGC is not a standalone node — it needs at least one rotatingMachine child to dispatch demand to. Both flows below ship three child pumps.
Files
| File | Tier | What it shows |
|---|---|---|
01-Basic.json |
1 | One MGC + three rotatingMachine pumps driven by inject buttons. Setup once-fires virtualControl + cmd.startup on all three pumps; mode / scaling / demand are then driven by buttons. |
02-Dashboard.json |
2 | Same command surface driven by a FlowFuse Dashboard 2.0 page — mode + scaling buttons, demand slider, live status rows, three trend charts, and a raw-output table. |
Prerequisites
- Node-RED with the EVOLV package installed (
machineGroupControlandrotatingMachineregistered). - For
02-Dashboard.json:@flowfuse/node-red-dashboard(Dashboard 2.0).
Load a flow
curl -X POST -H 'Content-Type: application/json' \
--data @nodes/machineGroupControl/examples/01-Basic.json \
http://localhost:1880/flows
Or in the editor: Menu → Import → drag the file → Import.
Canonical command surface
| Topic | Aliases | Payload | What it does |
|---|---|---|---|
set.mode |
setMode |
"optimalControl", "priorityControl", "prioritypercentagecontrol", "maintenance" |
Switch dispatch strategy |
set.scaling |
setScaling |
"normalized", "absolute" |
Interpret demand as 0–100 % vs m³/h |
set.demand |
Qd |
number | Operator demand setpoint |
child.register |
registerChild |
child node id (string) | Manually register a child (Port 2 wiring does this automatically) |
01-Basic — what to try
- Deploy. After ~1.5 s the Setup group auto-fires, putting all three pumps in
virtualControlmode + sendingcmd.startupto each. - Click
set.demand = 50 %— MGC'soptimalControlpicks the best pump combination by BEP-gravitation and dispatchesflowmovementto the selected pumps. - Click
set.demand = 100 %— MGC switches to a higher combination, possibly engaging an extra pump. - Switch mode to
priorityControland try the same demands — pumps now run equal-flow by priority order. - Switch scaling to
absolute— set.demand is now interpreted as m³/h (capped at the group min / max). set.demand = 0— MGC callsturnOffAllMachines, all pumps shut down.
02-Dashboard — what to try
- Deploy → open
http://localhost:1880/dashboard/mgc-basic. - The dashboard auto-initialises the pumps; the
Initialize pumpsbutton on the page re-runs the setup manually. - Drag the Demand slider — MGC dispatches and the Flow / Power / BEP charts react.
- Switch modes and scalings via the buttons; the Mode / Scaling rows in the Status panel reflect the change.
- Inspect the Raw output table for the full Port 0 surface (every field MGC emits, including
flowCapacityMax,machineCountActive,absDistFromPeak,relDistFromPeak).