Files
EVOLV/examples/pumpingstation-3pumps-dashboard/flow.json
znetsixe 7aacee6482
Some checks failed
CI / lint-and-test (push) Has been cancelled
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

2370 lines
53 KiB
JSON

[
{
"id": "ui_base_ps_demo",
"type": "ui-base",
"name": "EVOLV Demo",
"path": "/dashboard",
"appIcon": "",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control"
],
"showPathInSidebar": true,
"headerContent": "page",
"navigationStyle": "default",
"titleBarStyle": "default"
},
{
"id": "ui_theme_ps_demo",
"type": "ui-theme",
"name": "EVOLV Theme",
"colors": {
"surface": "#ffffff",
"primary": "#0f52a5",
"bgPage": "#f4f6fa",
"groupBg": "#ffffff",
"groupOutline": "#cccccc"
},
"sizes": {
"density": "default",
"pagePadding": "12px",
"groupGap": "12px",
"groupBorderRadius": "6px",
"widgetGap": "8px"
}
},
{
"id": "ui_page_ps_demo",
"type": "ui-page",
"name": "Pumping Station \u2014 3 Pumps",
"ui": "ui_base_ps_demo",
"path": "/pumping-station-demo",
"icon": "water_pump",
"layout": "grid",
"theme": "ui_theme_ps_demo",
"breakpoints": [
{
"name": "Default",
"px": "0",
"cols": "12"
}
],
"order": 1,
"className": ""
},
{
"id": "ps_demo_tab",
"type": "tab",
"label": "Pumping Station \u2014 3 Pumps Demo",
"disabled": false,
"info": "End-to-end demo: pumpingStation + machineGroupControl + 3 rotatingMachines, each with upstream/downstream pressure sensors. Process demand input via dashboard slider OR auto random generator. Dashboard at /dashboard/pumping-station-demo."
},
{
"id": "ui_grp_demand",
"type": "ui-group",
"name": "1. Process Demand",
"page": "ui_page_ps_demo",
"width": "12",
"height": "1",
"order": 1,
"showTitle": true,
"className": "",
"groupType": "default",
"disabled": false,
"visible": true
},
{
"id": "ui_grp_station",
"type": "ui-group",
"name": "2. Pumping Station",
"page": "ui_page_ps_demo",
"width": "12",
"height": "1",
"order": 2,
"showTitle": true,
"className": "",
"groupType": "default",
"disabled": false,
"visible": true
},
{
"id": "ui_grp_pump_a",
"type": "ui-group",
"name": "3a. Pump A",
"page": "ui_page_ps_demo",
"width": "4",
"height": "1",
"order": 3,
"showTitle": true,
"className": "",
"groupType": "default",
"disabled": false,
"visible": true
},
{
"id": "ui_grp_pump_b",
"type": "ui-group",
"name": "3b. Pump B",
"page": "ui_page_ps_demo",
"width": "4",
"height": "1",
"order": 4,
"showTitle": true,
"className": "",
"groupType": "default",
"disabled": false,
"visible": true
},
{
"id": "ui_grp_pump_c",
"type": "ui-group",
"name": "3c. Pump C",
"page": "ui_page_ps_demo",
"width": "4",
"height": "1",
"order": 5,
"showTitle": true,
"className": "",
"groupType": "default",
"disabled": false,
"visible": true
},
{
"id": "ui_grp_trend",
"type": "ui-group",
"name": "4. Trends",
"page": "ui_page_ps_demo",
"width": "12",
"height": "1",
"order": 6,
"showTitle": true,
"className": "",
"groupType": "default",
"disabled": false,
"visible": true
},
{
"id": "c_title",
"type": "comment",
"z": "ps_demo_tab",
"name": "Pumping Station \u2014 3 Pumps Demo",
"info": "Process demand \u2192 pumpingStation (basin model) + machineGroupControl (orchestrator) \u2192 3 rotatingMachines. Each pump has upstream + downstream pressure measurements. Auto/Manual mode toggle on the dashboard.",
"x": 200,
"y": 40,
"wires": []
},
{
"id": "meas_pump_a_u",
"type": "measurement",
"z": "ps_demo_tab",
"name": "PT-A-Up",
"mode": "analog",
"channels": "[]",
"scaling": false,
"i_min": 0,
"i_max": 1,
"i_offset": 0,
"o_min": 50,
"o_max": 400,
"simulator": true,
"smooth_method": "mean",
"count": "5",
"processOutputFormat": "process",
"dbaseOutputFormat": "influxdb",
"uuid": "sensor-pump_a-upstream",
"supplier": "vega",
"category": "sensor",
"assetType": "pressure",
"model": "vega-pressure-10",
"unit": "mbar",
"assetTagNumber": "PT-1-U",
"enableLog": true,
"logLevel": "warn",
"positionVsParent": "upstream",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"x": 200,
"y": 1000,
"wires": [
[],
[],
[
"pump_a"
]
]
},
{
"id": "meas_pump_a_d",
"type": "measurement",
"z": "ps_demo_tab",
"name": "PT-A-Dn",
"mode": "analog",
"channels": "[]",
"scaling": false,
"i_min": 0,
"i_max": 1,
"i_offset": 0,
"o_min": 800,
"o_max": 2200,
"simulator": true,
"smooth_method": "mean",
"count": "5",
"processOutputFormat": "process",
"dbaseOutputFormat": "influxdb",
"uuid": "sensor-pump_a-downstream",
"supplier": "vega",
"category": "sensor",
"assetType": "pressure",
"model": "vega-pressure-10",
"unit": "mbar",
"assetTagNumber": "PT-1-D",
"enableLog": true,
"logLevel": "warn",
"positionVsParent": "downstream",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"x": 440,
"y": 1000,
"wires": [
[],
[],
[
"pump_a"
]
]
},
{
"id": "meas_pump_b_u",
"type": "measurement",
"z": "ps_demo_tab",
"name": "PT-B-Up",
"mode": "analog",
"channels": "[]",
"scaling": false,
"i_min": 0,
"i_max": 1,
"i_offset": 0,
"o_min": 50,
"o_max": 400,
"simulator": true,
"smooth_method": "mean",
"count": "5",
"processOutputFormat": "process",
"dbaseOutputFormat": "influxdb",
"uuid": "sensor-pump_b-upstream",
"supplier": "vega",
"category": "sensor",
"assetType": "pressure",
"model": "vega-pressure-10",
"unit": "mbar",
"assetTagNumber": "PT-2-U",
"enableLog": true,
"logLevel": "warn",
"positionVsParent": "upstream",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"x": 200,
"y": 1220,
"wires": [
[],
[],
[
"pump_b"
]
]
},
{
"id": "meas_pump_b_d",
"type": "measurement",
"z": "ps_demo_tab",
"name": "PT-B-Dn",
"mode": "analog",
"channels": "[]",
"scaling": false,
"i_min": 0,
"i_max": 1,
"i_offset": 0,
"o_min": 800,
"o_max": 2200,
"simulator": true,
"smooth_method": "mean",
"count": "5",
"processOutputFormat": "process",
"dbaseOutputFormat": "influxdb",
"uuid": "sensor-pump_b-downstream",
"supplier": "vega",
"category": "sensor",
"assetType": "pressure",
"model": "vega-pressure-10",
"unit": "mbar",
"assetTagNumber": "PT-2-D",
"enableLog": true,
"logLevel": "warn",
"positionVsParent": "downstream",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"x": 440,
"y": 1220,
"wires": [
[],
[],
[
"pump_b"
]
]
},
{
"id": "meas_pump_c_u",
"type": "measurement",
"z": "ps_demo_tab",
"name": "PT-C-Up",
"mode": "analog",
"channels": "[]",
"scaling": false,
"i_min": 0,
"i_max": 1,
"i_offset": 0,
"o_min": 50,
"o_max": 400,
"simulator": true,
"smooth_method": "mean",
"count": "5",
"processOutputFormat": "process",
"dbaseOutputFormat": "influxdb",
"uuid": "sensor-pump_c-upstream",
"supplier": "vega",
"category": "sensor",
"assetType": "pressure",
"model": "vega-pressure-10",
"unit": "mbar",
"assetTagNumber": "PT-3-U",
"enableLog": true,
"logLevel": "warn",
"positionVsParent": "upstream",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"x": 200,
"y": 1440,
"wires": [
[],
[],
[
"pump_c"
]
]
},
{
"id": "meas_pump_c_d",
"type": "measurement",
"z": "ps_demo_tab",
"name": "PT-C-Dn",
"mode": "analog",
"channels": "[]",
"scaling": false,
"i_min": 0,
"i_max": 1,
"i_offset": 0,
"o_min": 800,
"o_max": 2200,
"simulator": true,
"smooth_method": "mean",
"count": "5",
"processOutputFormat": "process",
"dbaseOutputFormat": "influxdb",
"uuid": "sensor-pump_c-downstream",
"supplier": "vega",
"category": "sensor",
"assetType": "pressure",
"model": "vega-pressure-10",
"unit": "mbar",
"assetTagNumber": "PT-3-D",
"enableLog": true,
"logLevel": "warn",
"positionVsParent": "downstream",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"x": 440,
"y": 1440,
"wires": [
[],
[],
[
"pump_c"
]
]
},
{
"id": "pump_a",
"type": "rotatingMachine",
"z": "ps_demo_tab",
"name": "Pump A",
"speed": "10",
"startup": "2",
"warmup": "1",
"shutdown": "2",
"cooldown": "1",
"movementMode": "staticspeed",
"machineCurve": "",
"uuid": "pump-pump_a",
"supplier": "hidrostal",
"category": "pump",
"assetType": "pump-centrifugal",
"model": "hidrostal-H05K-S03R",
"unit": "m3/h",
"curvePressureUnit": "mbar",
"curveFlowUnit": "m3/h",
"curvePowerUnit": "kW",
"curveControlUnit": "%",
"enableLog": true,
"logLevel": "warn",
"positionVsParent": "atEquipment",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"x": 700,
"y": 700,
"wires": [
[
"router_p0_pump_a"
],
[],
[
"mgc_pumps"
]
]
},
{
"id": "pump_b",
"type": "rotatingMachine",
"z": "ps_demo_tab",
"name": "Pump B",
"speed": "10",
"startup": "2",
"warmup": "1",
"shutdown": "2",
"cooldown": "1",
"movementMode": "staticspeed",
"machineCurve": "",
"uuid": "pump-pump_b",
"supplier": "hidrostal",
"category": "pump",
"assetType": "pump-centrifugal",
"model": "hidrostal-H05K-S03R",
"unit": "m3/h",
"curvePressureUnit": "mbar",
"curveFlowUnit": "m3/h",
"curvePowerUnit": "kW",
"curveControlUnit": "%",
"enableLog": true,
"logLevel": "warn",
"positionVsParent": "atEquipment",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"x": 700,
"y": 820,
"wires": [
[
"router_p0_pump_b"
],
[],
[
"mgc_pumps"
]
]
},
{
"id": "pump_c",
"type": "rotatingMachine",
"z": "ps_demo_tab",
"name": "Pump C",
"speed": "10",
"startup": "2",
"warmup": "1",
"shutdown": "2",
"cooldown": "1",
"movementMode": "staticspeed",
"machineCurve": "",
"uuid": "pump-pump_c",
"supplier": "hidrostal",
"category": "pump",
"assetType": "pump-centrifugal",
"model": "hidrostal-H05K-S03R",
"unit": "m3/h",
"curvePressureUnit": "mbar",
"curveFlowUnit": "m3/h",
"curvePowerUnit": "kW",
"curveControlUnit": "%",
"enableLog": true,
"logLevel": "warn",
"positionVsParent": "atEquipment",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"x": 700,
"y": 940,
"wires": [
[
"router_p0_pump_c"
],
[],
[
"mgc_pumps"
]
]
},
{
"id": "mgc_pumps",
"type": "machineGroupControl",
"z": "ps_demo_tab",
"name": "MGC \u2014 Pump Group",
"uuid": "mgc-pump-group",
"category": "controller",
"assetType": "machinegroupcontrol",
"model": "default",
"unit": "m3/h",
"supplier": "evolv",
"enableLog": true,
"logLevel": "warn",
"positionVsParent": "atEquipment",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"processOutputFormat": "process",
"dbaseOutputFormat": "influxdb",
"x": 1100,
"y": 760,
"wires": [
[],
[],
[
"ps_basin"
]
]
},
{
"id": "ps_basin",
"type": "pumpingStation",
"z": "ps_demo_tab",
"name": "Pumping Station",
"uuid": "ps-basin-1",
"category": "station",
"assetType": "pumpingstation",
"model": "default",
"unit": "m3/s",
"supplier": "evolv",
"enableLog": true,
"logLevel": "info",
"positionVsParent": "atEquipment",
"positionIcon": "",
"hasDistance": false,
"distance": 0,
"distanceUnit": "m",
"distanceDescription": "",
"processOutputFormat": "process",
"dbaseOutputFormat": "influxdb",
"controlMode": "manual",
"basinVolume": 50,
"basinHeight": 4,
"enableDryRunProtection": false,
"enableOverfillProtection": false,
"dryRunThresholdPercent": 0,
"overfillThresholdPercent": 100,
"timeleftToFullOrEmptyThresholdSeconds": 0,
"x": 1450,
"y": 760,
"wires": [
[
"ps_to_dashboard"
],
[]
]
},
{
"id": "ui_demand_slider",
"type": "ui-slider",
"z": "ps_demo_tab",
"group": "ui_grp_demand",
"name": "Process demand slider",
"label": "Process Demand (m\u00b3/h)",
"tooltip": "",
"order": 1,
"width": "0",
"height": "0",
"passthru": true,
"outs": "end",
"topic": "manualDemand",
"topicType": "str",
"min": "0",
"max": "300",
"step": "5.0",
"showLabel": true,
"showValue": true,
"labelPosition": "top",
"valuePosition": "left",
"thumbLabel": false,
"iconStart": "",
"iconEnd": "",
"x": 100,
"y": 200,
"wires": [
[
"demand_router"
]
]
},
{
"id": "ui_random_toggle",
"type": "ui-switch",
"z": "ps_demo_tab",
"group": "ui_grp_demand",
"name": "Random demand",
"label": "Random demand generator (auto)",
"tooltip": "",
"order": 1,
"width": "0",
"height": "0",
"passthru": true,
"decouple": "false",
"topic": "randomToggle",
"topicType": "str",
"style": "",
"className": "",
"evaluate": "true",
"onvalue": "on",
"onvalueType": "str",
"onicon": "auto_mode",
"oncolor": "#0f52a5",
"offvalue": "off",
"offvalueType": "str",
"officon": "back_hand",
"offcolor": "#888888",
"x": 100,
"y": 260,
"wires": [
[
"random_state"
]
]
},
{
"id": "ui_demand_text",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_demand",
"order": 1,
"width": "0",
"height": "0",
"name": "Current demand text",
"label": "Current demand",
"format": "{{msg.payload}} m\u00b3/h",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "demand_rand_tick",
"type": "inject",
"z": "ps_demo_tab",
"name": "tick (random demand)",
"props": [
{
"p": "topic",
"vt": "str"
},
{
"p": "payload",
"v": "",
"vt": "date"
}
],
"topic": "randomTick",
"payload": "",
"payloadType": "date",
"repeat": "3",
"crontab": "",
"once": false,
"onceDelay": "0.5",
"x": 100,
"y": 380,
"wires": [
[
"demand_rand_fn"
]
]
},
{
"id": "random_state",
"type": "function",
"z": "ps_demo_tab",
"name": "store random state",
"func": "context.set('on', msg.payload === 'on'); return null;",
"outputs": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 280,
"y": 260,
"wires": []
},
{
"id": "demand_rand_fn",
"type": "function",
"z": "ps_demo_tab",
"name": "random demand",
"func": "if (!context.get('on')) { return null; }\nconst v = Math.round(40 + Math.random() * 200);\nmsg.payload = v;\nmsg.topic = 'manualDemand';\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 280,
"y": 380,
"wires": [
[
"demand_router",
"ui_demand_text"
]
]
},
{
"id": "demand_router",
"type": "function",
"z": "ps_demo_tab",
"name": "fan-out demand",
"func": "const v = Number(msg.payload);\nif (!Number.isFinite(v) || v <= 0) return null;\n// Feed pumpingStation q_in (m3/s canonical) and MGC Qd (m3/h).\nconst qin = { topic: 'q_in', payload: v / 3600, unit: 'm3/s' };\nconst qd = { topic: 'Qd', payload: v };\nconst text = { topic: 'demand', payload: v };\nreturn [qin, qd, text];",
"outputs": 3,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 480,
"y": 260,
"wires": [
[
"ps_basin"
],
[
"mgc_pumps",
"dbg_demand_to_mgc"
],
[
"ui_demand_text"
]
]
},
{
"id": "dbg_demand_to_mgc",
"type": "debug",
"z": "ps_demo_tab",
"name": "\u2192 MGC Qd",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 700,
"y": 320,
"wires": []
},
{
"id": "ui_mode_toggle",
"type": "ui-switch",
"z": "ps_demo_tab",
"group": "ui_grp_station",
"name": "Auto/Manual mode",
"label": "Mode (Auto = MGC orchestrates \u00b7 Manual = dashboard per-pump)",
"tooltip": "",
"order": 1,
"width": "0",
"height": "0",
"passthru": true,
"decouple": "false",
"topic": "setMode",
"topicType": "str",
"style": "",
"className": "",
"evaluate": "true",
"onvalue": "auto",
"onvalueType": "str",
"onicon": "auto_mode",
"oncolor": "#0f52a5",
"offvalue": "virtualControl",
"offvalueType": "str",
"officon": "back_hand",
"offcolor": "#888888",
"x": 100,
"y": 460,
"wires": [
[
"mode_fanout"
]
]
},
{
"id": "mode_fanout",
"type": "function",
"z": "ps_demo_tab",
"name": "broadcast setMode to all pumps",
"func": "msg.topic = 'setMode';\n// Send same setMode payload to all 3 pumps.\nreturn [msg, msg, msg];",
"outputs": 3,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 460,
"wires": [
[
"pump_a"
],
[
"pump_b"
],
[
"pump_c"
]
]
},
{
"id": "btn_station_startup",
"type": "ui-button",
"z": "ps_demo_tab",
"group": "ui_grp_station",
"name": "Start all pumps",
"label": "Startup all",
"order": 1,
"width": "0",
"height": "0",
"tooltip": "",
"color": "#ffffff",
"bgcolor": "#16a34a",
"className": "",
"icon": "play_arrow",
"iconPosition": "left",
"payload": "startup",
"payloadType": "str",
"topic": "stationStartup",
"topicType": "str",
"buttonType": "default",
"x": 100,
"y": 520,
"wires": [
[
"station_startup_fan"
]
]
},
{
"id": "station_startup_fan",
"type": "function",
"z": "ps_demo_tab",
"name": "fan startup to pumps",
"func": "const cmd = { topic: 'execSequence', payload: { source: 'GUI', action: 'execSequence', parameter: 'startup' } };\nreturn [cmd, cmd, cmd];",
"outputs": 3,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 520,
"wires": [
[
"pump_a"
],
[
"pump_b"
],
[
"pump_c"
]
]
},
{
"id": "btn_station_shutdown",
"type": "ui-button",
"z": "ps_demo_tab",
"group": "ui_grp_station",
"name": "Stop all pumps",
"label": "Shutdown all",
"order": 1,
"width": "0",
"height": "0",
"tooltip": "",
"color": "#ffffff",
"bgcolor": "#ea580c",
"className": "",
"icon": "stop",
"iconPosition": "left",
"payload": "shutdown",
"payloadType": "str",
"topic": "stationShutdown",
"topicType": "str",
"buttonType": "default",
"x": 100,
"y": 580,
"wires": [
[
"station_shutdown_fan"
]
]
},
{
"id": "station_shutdown_fan",
"type": "function",
"z": "ps_demo_tab",
"name": "fan shutdown to pumps",
"func": "const cmd = { topic: 'execSequence', payload: { source: 'GUI', action: 'execSequence', parameter: 'shutdown' } };\nreturn [cmd, cmd, cmd];",
"outputs": 3,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 580,
"wires": [
[
"pump_a"
],
[
"pump_b"
],
[
"pump_c"
]
]
},
{
"id": "btn_station_estop",
"type": "ui-button",
"z": "ps_demo_tab",
"group": "ui_grp_station",
"name": "EMERGENCY STOP",
"label": "EMERGENCY STOP",
"order": 1,
"width": "0",
"height": "0",
"tooltip": "",
"color": "#ffffff",
"bgcolor": "#dc2626",
"className": "",
"icon": "stop_circle",
"iconPosition": "left",
"payload": "estop",
"payloadType": "str",
"topic": "stationEstop",
"topicType": "str",
"buttonType": "default",
"x": 100,
"y": 640,
"wires": [
[
"station_estop_fan"
]
]
},
{
"id": "station_estop_fan",
"type": "function",
"z": "ps_demo_tab",
"name": "fan estop to pumps",
"func": "const cmd = { topic: 'emergencystop', payload: { source: 'GUI', action: 'emergencystop' } };\nreturn [cmd, cmd, cmd];",
"outputs": 3,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 640,
"wires": [
[
"pump_a"
],
[
"pump_b"
],
[
"pump_c"
]
]
},
{
"id": "ui_pump_a_state",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_a",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump A state",
"label": "State",
"format": "{{msg.payload.state}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_a_mode",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_a",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump A mode",
"label": "Mode",
"format": "{{msg.payload.mode}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_a_ctrl",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_a",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump A ctrl",
"label": "Controller %",
"format": "{{msg.payload.ctrl}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_a_flow",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_a",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump A flow",
"label": "Flow (m\u00b3/h)",
"format": "{{msg.payload.flow}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_a_power",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_a",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump A power",
"label": "Power (kW)",
"format": "{{msg.payload.power}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_a_pUp",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_a",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump A pUp",
"label": "p Upstream (mbar)",
"format": "{{msg.payload.pUp}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_a_pDn",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_a",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump A pDn",
"label": "p Downstream (mbar)",
"format": "{{msg.payload.pDn}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_a_setpoint",
"type": "ui-slider",
"z": "ps_demo_tab",
"group": "ui_grp_pump_a",
"name": "Pump A setpoint",
"label": "Setpoint % (manual mode)",
"tooltip": "",
"order": 1,
"width": "0",
"height": "0",
"passthru": true,
"outs": "end",
"topic": "setpoint_pump_a",
"topicType": "str",
"min": "0",
"max": "100",
"step": "5.0",
"showLabel": true,
"showValue": true,
"labelPosition": "top",
"valuePosition": "left",
"thumbLabel": false,
"iconStart": "",
"iconEnd": "",
"x": 100,
"y": 100,
"wires": [
[
"setpoint_to_pump_pump_a"
]
]
},
{
"id": "setpoint_to_pump_pump_a",
"type": "function",
"z": "ps_demo_tab",
"name": "build setpoint cmd for Pump A",
"func": "msg.topic = 'execMovement';\nmsg.payload = { source: 'GUI', action: 'execMovement', setpoint: Number(msg.payload) };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 100,
"wires": [
[
"pump_a"
]
]
},
{
"id": "btn_pump_a_startup",
"type": "ui-button",
"z": "ps_demo_tab",
"group": "ui_grp_pump_a",
"name": "Pump A startup",
"label": "Startup",
"order": 1,
"width": "0",
"height": "0",
"tooltip": "",
"color": "#ffffff",
"bgcolor": "#16a34a",
"className": "",
"icon": "play_arrow",
"iconPosition": "left",
"payload": "startup",
"payloadType": "str",
"topic": "start_pump_a",
"topicType": "str",
"buttonType": "default",
"x": 100,
"y": 160,
"wires": [
[
"start_to_pump_pump_a"
]
]
},
{
"id": "start_to_pump_pump_a",
"type": "function",
"z": "ps_demo_tab",
"name": "build startup for Pump A",
"func": "msg.topic = 'execSequence';\nmsg.payload = { source: 'GUI', action: 'execSequence', parameter: 'startup' };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 160,
"wires": [
[
"pump_a"
]
]
},
{
"id": "btn_pump_a_shutdown",
"type": "ui-button",
"z": "ps_demo_tab",
"group": "ui_grp_pump_a",
"name": "Pump A shutdown",
"label": "Shutdown",
"order": 1,
"width": "0",
"height": "0",
"tooltip": "",
"color": "#ffffff",
"bgcolor": "#ea580c",
"className": "",
"icon": "stop",
"iconPosition": "left",
"payload": "shutdown",
"payloadType": "str",
"topic": "stop_pump_a",
"topicType": "str",
"buttonType": "default",
"x": 100,
"y": 220,
"wires": [
[
"stop_to_pump_pump_a"
]
]
},
{
"id": "stop_to_pump_pump_a",
"type": "function",
"z": "ps_demo_tab",
"name": "build shutdown for Pump A",
"func": "msg.topic = 'execSequence';\nmsg.payload = { source: 'GUI', action: 'execSequence', parameter: 'shutdown' };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 220,
"wires": [
[
"pump_a"
]
]
},
{
"id": "router_p0_pump_a",
"type": "function",
"z": "ps_demo_tab",
"name": "format Pump A port 0",
"func": "const p = msg.payload || {};\nconst c = context.get('c') || {};\nObject.assign(c, p);\ncontext.set('c', c);\nfunction find(prefix) {\n for (const k in c) { if (k.indexOf(prefix) === 0) return c[k]; }\n return null;\n}\nconst flow = find('flow.predicted.downstream.');\nconst power = find('power.predicted.atequipment.');\nconst pU = find('pressure.measured.upstream.');\nconst pD = find('pressure.measured.downstream.');\nmsg.payload = {\n state: c.state || 'idle',\n mode: c.mode || 'auto',\n ctrl: c.ctrl != null ? Number(c.ctrl).toFixed(1) + '%' : 'n/a',\n flow: flow != null ? Number(flow).toFixed(1) + ' m\u00b3/h' : 'n/a',\n power: power != null ? Number(power).toFixed(2) + ' kW' : 'n/a',\n pUp: pU != null ? Number(pU).toFixed(0) : 'n/a',\n pDn: pD != null ? Number(pD).toFixed(0) : 'n/a',\n flowNum: flow != null ? Number(flow) : null,\n powerNum: power != null ? Number(power) : null\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1100,
"y": 190,
"wires": [
[
"ui_pump_a_state",
"ui_pump_a_mode",
"ui_pump_a_ctrl",
"ui_pump_a_flow",
"ui_pump_a_power",
"ui_pump_a_pUp",
"ui_pump_a_pDn",
"trend_split_pump_a"
]
]
},
{
"id": "trend_split_pump_a",
"type": "function",
"z": "ps_demo_tab",
"name": "emit trend points for Pump A",
"func": "const p = msg.payload || {};\nconst out = [];\nif (p.flowNum != null) out.push({ topic: 'Pump A flow', payload: p.flowNum });\nif (p.powerNum != null) out.push({ topic: 'Pump A power', payload: p.powerNum });\nreturn [out];",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1300,
"y": 250,
"wires": [
[
"trend_chart_flow",
"trend_chart_power"
]
]
},
{
"id": "ui_pump_b_state",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_b",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump B state",
"label": "State",
"format": "{{msg.payload.state}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_b_mode",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_b",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump B mode",
"label": "Mode",
"format": "{{msg.payload.mode}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_b_ctrl",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_b",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump B ctrl",
"label": "Controller %",
"format": "{{msg.payload.ctrl}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_b_flow",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_b",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump B flow",
"label": "Flow (m\u00b3/h)",
"format": "{{msg.payload.flow}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_b_power",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_b",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump B power",
"label": "Power (kW)",
"format": "{{msg.payload.power}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_b_pUp",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_b",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump B pUp",
"label": "p Upstream (mbar)",
"format": "{{msg.payload.pUp}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_b_pDn",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_b",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump B pDn",
"label": "p Downstream (mbar)",
"format": "{{msg.payload.pDn}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_b_setpoint",
"type": "ui-slider",
"z": "ps_demo_tab",
"group": "ui_grp_pump_b",
"name": "Pump B setpoint",
"label": "Setpoint % (manual mode)",
"tooltip": "",
"order": 1,
"width": "0",
"height": "0",
"passthru": true,
"outs": "end",
"topic": "setpoint_pump_b",
"topicType": "str",
"min": "0",
"max": "100",
"step": "5.0",
"showLabel": true,
"showValue": true,
"labelPosition": "top",
"valuePosition": "left",
"thumbLabel": false,
"iconStart": "",
"iconEnd": "",
"x": 100,
"y": 420,
"wires": [
[
"setpoint_to_pump_pump_b"
]
]
},
{
"id": "setpoint_to_pump_pump_b",
"type": "function",
"z": "ps_demo_tab",
"name": "build setpoint cmd for Pump B",
"func": "msg.topic = 'execMovement';\nmsg.payload = { source: 'GUI', action: 'execMovement', setpoint: Number(msg.payload) };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 420,
"wires": [
[
"pump_b"
]
]
},
{
"id": "btn_pump_b_startup",
"type": "ui-button",
"z": "ps_demo_tab",
"group": "ui_grp_pump_b",
"name": "Pump B startup",
"label": "Startup",
"order": 1,
"width": "0",
"height": "0",
"tooltip": "",
"color": "#ffffff",
"bgcolor": "#16a34a",
"className": "",
"icon": "play_arrow",
"iconPosition": "left",
"payload": "startup",
"payloadType": "str",
"topic": "start_pump_b",
"topicType": "str",
"buttonType": "default",
"x": 100,
"y": 480,
"wires": [
[
"start_to_pump_pump_b"
]
]
},
{
"id": "start_to_pump_pump_b",
"type": "function",
"z": "ps_demo_tab",
"name": "build startup for Pump B",
"func": "msg.topic = 'execSequence';\nmsg.payload = { source: 'GUI', action: 'execSequence', parameter: 'startup' };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 480,
"wires": [
[
"pump_b"
]
]
},
{
"id": "btn_pump_b_shutdown",
"type": "ui-button",
"z": "ps_demo_tab",
"group": "ui_grp_pump_b",
"name": "Pump B shutdown",
"label": "Shutdown",
"order": 1,
"width": "0",
"height": "0",
"tooltip": "",
"color": "#ffffff",
"bgcolor": "#ea580c",
"className": "",
"icon": "stop",
"iconPosition": "left",
"payload": "shutdown",
"payloadType": "str",
"topic": "stop_pump_b",
"topicType": "str",
"buttonType": "default",
"x": 100,
"y": 540,
"wires": [
[
"stop_to_pump_pump_b"
]
]
},
{
"id": "stop_to_pump_pump_b",
"type": "function",
"z": "ps_demo_tab",
"name": "build shutdown for Pump B",
"func": "msg.topic = 'execSequence';\nmsg.payload = { source: 'GUI', action: 'execSequence', parameter: 'shutdown' };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 540,
"wires": [
[
"pump_b"
]
]
},
{
"id": "router_p0_pump_b",
"type": "function",
"z": "ps_demo_tab",
"name": "format Pump B port 0",
"func": "const p = msg.payload || {};\nconst c = context.get('c') || {};\nObject.assign(c, p);\ncontext.set('c', c);\nfunction find(prefix) {\n for (const k in c) { if (k.indexOf(prefix) === 0) return c[k]; }\n return null;\n}\nconst flow = find('flow.predicted.downstream.');\nconst power = find('power.predicted.atequipment.');\nconst pU = find('pressure.measured.upstream.');\nconst pD = find('pressure.measured.downstream.');\nmsg.payload = {\n state: c.state || 'idle',\n mode: c.mode || 'auto',\n ctrl: c.ctrl != null ? Number(c.ctrl).toFixed(1) + '%' : 'n/a',\n flow: flow != null ? Number(flow).toFixed(1) + ' m\u00b3/h' : 'n/a',\n power: power != null ? Number(power).toFixed(2) + ' kW' : 'n/a',\n pUp: pU != null ? Number(pU).toFixed(0) : 'n/a',\n pDn: pD != null ? Number(pD).toFixed(0) : 'n/a',\n flowNum: flow != null ? Number(flow) : null,\n powerNum: power != null ? Number(power) : null\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1100,
"y": 510,
"wires": [
[
"ui_pump_b_state",
"ui_pump_b_mode",
"ui_pump_b_ctrl",
"ui_pump_b_flow",
"ui_pump_b_power",
"ui_pump_b_pUp",
"ui_pump_b_pDn",
"trend_split_pump_b"
]
]
},
{
"id": "trend_split_pump_b",
"type": "function",
"z": "ps_demo_tab",
"name": "emit trend points for Pump B",
"func": "const p = msg.payload || {};\nconst out = [];\nif (p.flowNum != null) out.push({ topic: 'Pump B flow', payload: p.flowNum });\nif (p.powerNum != null) out.push({ topic: 'Pump B power', payload: p.powerNum });\nreturn [out];",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1300,
"y": 570,
"wires": [
[
"trend_chart_flow",
"trend_chart_power"
]
]
},
{
"id": "ui_pump_c_state",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_c",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump C state",
"label": "State",
"format": "{{msg.payload.state}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_c_mode",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_c",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump C mode",
"label": "Mode",
"format": "{{msg.payload.mode}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_c_ctrl",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_c",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump C ctrl",
"label": "Controller %",
"format": "{{msg.payload.ctrl}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_c_flow",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_c",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump C flow",
"label": "Flow (m\u00b3/h)",
"format": "{{msg.payload.flow}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_c_power",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_c",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump C power",
"label": "Power (kW)",
"format": "{{msg.payload.power}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_c_pUp",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_c",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump C pUp",
"label": "p Upstream (mbar)",
"format": "{{msg.payload.pUp}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_c_pDn",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_pump_c",
"order": 1,
"width": "0",
"height": "0",
"name": "Pump C pDn",
"label": "p Downstream (mbar)",
"format": "{{msg.payload.pDn}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_pump_c_setpoint",
"type": "ui-slider",
"z": "ps_demo_tab",
"group": "ui_grp_pump_c",
"name": "Pump C setpoint",
"label": "Setpoint % (manual mode)",
"tooltip": "",
"order": 1,
"width": "0",
"height": "0",
"passthru": true,
"outs": "end",
"topic": "setpoint_pump_c",
"topicType": "str",
"min": "0",
"max": "100",
"step": "5.0",
"showLabel": true,
"showValue": true,
"labelPosition": "top",
"valuePosition": "left",
"thumbLabel": false,
"iconStart": "",
"iconEnd": "",
"x": 100,
"y": 740,
"wires": [
[
"setpoint_to_pump_pump_c"
]
]
},
{
"id": "setpoint_to_pump_pump_c",
"type": "function",
"z": "ps_demo_tab",
"name": "build setpoint cmd for Pump C",
"func": "msg.topic = 'execMovement';\nmsg.payload = { source: 'GUI', action: 'execMovement', setpoint: Number(msg.payload) };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 740,
"wires": [
[
"pump_c"
]
]
},
{
"id": "btn_pump_c_startup",
"type": "ui-button",
"z": "ps_demo_tab",
"group": "ui_grp_pump_c",
"name": "Pump C startup",
"label": "Startup",
"order": 1,
"width": "0",
"height": "0",
"tooltip": "",
"color": "#ffffff",
"bgcolor": "#16a34a",
"className": "",
"icon": "play_arrow",
"iconPosition": "left",
"payload": "startup",
"payloadType": "str",
"topic": "start_pump_c",
"topicType": "str",
"buttonType": "default",
"x": 100,
"y": 800,
"wires": [
[
"start_to_pump_pump_c"
]
]
},
{
"id": "start_to_pump_pump_c",
"type": "function",
"z": "ps_demo_tab",
"name": "build startup for Pump C",
"func": "msg.topic = 'execSequence';\nmsg.payload = { source: 'GUI', action: 'execSequence', parameter: 'startup' };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 800,
"wires": [
[
"pump_c"
]
]
},
{
"id": "btn_pump_c_shutdown",
"type": "ui-button",
"z": "ps_demo_tab",
"group": "ui_grp_pump_c",
"name": "Pump C shutdown",
"label": "Shutdown",
"order": 1,
"width": "0",
"height": "0",
"tooltip": "",
"color": "#ffffff",
"bgcolor": "#ea580c",
"className": "",
"icon": "stop",
"iconPosition": "left",
"payload": "shutdown",
"payloadType": "str",
"topic": "stop_pump_c",
"topicType": "str",
"buttonType": "default",
"x": 100,
"y": 860,
"wires": [
[
"stop_to_pump_pump_c"
]
]
},
{
"id": "stop_to_pump_pump_c",
"type": "function",
"z": "ps_demo_tab",
"name": "build shutdown for Pump C",
"func": "msg.topic = 'execSequence';\nmsg.payload = { source: 'GUI', action: 'execSequence', parameter: 'shutdown' };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 860,
"wires": [
[
"pump_c"
]
]
},
{
"id": "router_p0_pump_c",
"type": "function",
"z": "ps_demo_tab",
"name": "format Pump C port 0",
"func": "const p = msg.payload || {};\nconst c = context.get('c') || {};\nObject.assign(c, p);\ncontext.set('c', c);\nfunction find(prefix) {\n for (const k in c) { if (k.indexOf(prefix) === 0) return c[k]; }\n return null;\n}\nconst flow = find('flow.predicted.downstream.');\nconst power = find('power.predicted.atequipment.');\nconst pU = find('pressure.measured.upstream.');\nconst pD = find('pressure.measured.downstream.');\nmsg.payload = {\n state: c.state || 'idle',\n mode: c.mode || 'auto',\n ctrl: c.ctrl != null ? Number(c.ctrl).toFixed(1) + '%' : 'n/a',\n flow: flow != null ? Number(flow).toFixed(1) + ' m\u00b3/h' : 'n/a',\n power: power != null ? Number(power).toFixed(2) + ' kW' : 'n/a',\n pUp: pU != null ? Number(pU).toFixed(0) : 'n/a',\n pDn: pD != null ? Number(pD).toFixed(0) : 'n/a',\n flowNum: flow != null ? Number(flow) : null,\n powerNum: power != null ? Number(power) : null\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1100,
"y": 830,
"wires": [
[
"ui_pump_c_state",
"ui_pump_c_mode",
"ui_pump_c_ctrl",
"ui_pump_c_flow",
"ui_pump_c_power",
"ui_pump_c_pUp",
"ui_pump_c_pDn",
"trend_split_pump_c"
]
]
},
{
"id": "trend_split_pump_c",
"type": "function",
"z": "ps_demo_tab",
"name": "emit trend points for Pump C",
"func": "const p = msg.payload || {};\nconst out = [];\nif (p.flowNum != null) out.push({ topic: 'Pump C flow', payload: p.flowNum });\nif (p.powerNum != null) out.push({ topic: 'Pump C power', payload: p.powerNum });\nreturn [out];",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1300,
"y": 890,
"wires": [
[
"trend_chart_flow",
"trend_chart_power"
]
]
},
{
"id": "trend_chart_flow",
"type": "ui-chart",
"z": "ps_demo_tab",
"group": "ui_grp_trend",
"name": "Flow per pump (m\u00b3/h)",
"label": "Flow per pump",
"order": 1,
"chartType": "line",
"category": "topic",
"categoryType": "msg",
"xAxisLabel": "",
"xAxisType": "time",
"xAxisTimeFormat": "auto",
"yAxisLabel": "",
"ymin": "",
"ymax": "",
"action": "append",
"pointShape": "circle",
"pointRadius": 2,
"showLegend": true,
"removeOlder": "10",
"removeOlderUnit": "60",
"removeOlderPoints": "200",
"colors": [],
"textColor": [],
"textColorDefault": true,
"width": "0",
"height": "0",
"className": "",
"wires": [
[]
]
},
{
"id": "trend_chart_power",
"type": "ui-chart",
"z": "ps_demo_tab",
"group": "ui_grp_trend",
"name": "Power per pump (kW)",
"label": "Power per pump",
"order": 1,
"chartType": "line",
"category": "topic",
"categoryType": "msg",
"xAxisLabel": "",
"xAxisType": "time",
"xAxisTimeFormat": "auto",
"yAxisLabel": "",
"ymin": "",
"ymax": "",
"action": "append",
"pointShape": "circle",
"pointRadius": 2,
"showLegend": true,
"removeOlder": "10",
"removeOlderUnit": "60",
"removeOlderPoints": "200",
"colors": [],
"textColor": [],
"textColorDefault": true,
"width": "0",
"height": "0",
"className": "",
"wires": [
[]
]
},
{
"id": "ps_to_dashboard",
"type": "function",
"z": "ps_demo_tab",
"name": "format PS port 0 for dashboard",
"func": "const p = msg.payload || {};\nconst c = context.get('c') || {};\nObject.assign(c, p);\ncontext.set('c', c);\nfunction find(prefix) {\n for (const k in c) { if (k.indexOf(prefix) === 0) return c[k]; }\n return null;\n}\nconst lvl = find('level.predicted.');\nconst vol = find('volume.predicted.');\nconst qIn = find('flow.measured.upstream.') || find('flow.measured.in.');\nconst qOut = find('flow.measured.downstream.') || find('flow.measured.out.');\nmsg.payload = {\n level: lvl != null ? Number(lvl).toFixed(2) + ' m' : 'n/a',\n volume: vol != null ? Number(vol).toFixed(1) + ' m\u00b3' : 'n/a',\n qIn: qIn != null ? (Number(qIn) * 3600).toFixed(0) + ' m\u00b3/h' : 'n/a',\n qOut: qOut != null ? (Number(qOut) * 3600).toFixed(0) + ' m\u00b3/h' : 'n/a',\n state: c.state || c.direction || 'idle',\n netNum: (qIn != null && qOut != null) ? (Number(qIn) - Number(qOut)) * 3600 : null\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1700,
"y": 700,
"wires": [
[
"ui_ps_level",
"ui_ps_volume",
"ui_ps_qin",
"ui_ps_qout",
"ui_ps_state"
]
]
},
{
"id": "ui_ps_state",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_station",
"order": 1,
"width": "0",
"height": "0",
"name": "PS state",
"label": "Basin state",
"format": "{{msg.payload.state}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_ps_level",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_station",
"order": 1,
"width": "0",
"height": "0",
"name": "PS level",
"label": "Basin level",
"format": "{{msg.payload.level}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_ps_volume",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_station",
"order": 1,
"width": "0",
"height": "0",
"name": "PS volume",
"label": "Basin volume",
"format": "{{msg.payload.volume}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_ps_qin",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_station",
"order": 1,
"width": "0",
"height": "0",
"name": "PS Qin",
"label": "Inflow",
"format": "{{msg.payload.qIn}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "ui_ps_qout",
"type": "ui-text",
"z": "ps_demo_tab",
"group": "ui_grp_station",
"order": 1,
"width": "0",
"height": "0",
"name": "PS Qout",
"label": "Pumped out",
"format": "{{msg.payload.qOut}}",
"layout": "row-left",
"style": false,
"font": "",
"fontSize": 14,
"color": "#000000",
"wires": []
},
{
"id": "setup_mgc_scaling",
"type": "inject",
"z": "ps_demo_tab",
"name": "setup: MGC scaling=absolute",
"props": [
{
"p": "topic",
"vt": "str"
},
{
"p": "payload",
"v": "absolute",
"vt": "str"
}
],
"topic": "setScaling",
"payload": "absolute",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "0.5",
"x": 100,
"y": 800,
"wires": [
[
"mgc_pumps"
]
]
},
{
"id": "setup_mgc_mode",
"type": "inject",
"z": "ps_demo_tab",
"name": "setup: MGC mode=optimalcontrol",
"props": [
{
"p": "topic",
"vt": "str"
},
{
"p": "payload",
"v": "optimalcontrol",
"vt": "str"
}
],
"topic": "setMode",
"payload": "optimalcontrol",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "0.5",
"x": 100,
"y": 840,
"wires": [
[
"mgc_pumps"
]
]
},
{
"id": "setup_pumps_mode",
"type": "inject",
"z": "ps_demo_tab",
"name": "setup: pumps mode=auto",
"props": [
{
"p": "topic",
"vt": "str"
},
{
"p": "payload",
"v": "auto",
"vt": "str"
}
],
"topic": "setMode",
"payload": "auto",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "0.5",
"x": 100,
"y": 880,
"wires": [
[
"mode_setup_fan"
]
]
},
{
"id": "mode_setup_fan",
"type": "function",
"z": "ps_demo_tab",
"name": "fan setup mode to pumps",
"func": "msg.topic = 'setMode';\nreturn [msg, msg, msg];",
"outputs": 3,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 880,
"wires": [
[
"pump_a"
],
[
"pump_b"
],
[
"pump_c"
]
]
},
{
"id": "setup_pumps_startup",
"type": "inject",
"z": "ps_demo_tab",
"name": "setup: pumps startup",
"props": [
{
"p": "topic",
"vt": "str"
},
{
"p": "payload",
"v": "{\"source\":\"GUI\",\"action\":\"execSequence\",\"parameter\":\"startup\"}",
"vt": "json"
}
],
"topic": "execSequence",
"payload": "{\"source\":\"GUI\",\"action\":\"execSequence\",\"parameter\":\"startup\"}",
"payloadType": "json",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "4",
"x": 100,
"y": 920,
"wires": [
[
"startup_setup_fan"
]
]
},
{
"id": "startup_setup_fan",
"type": "function",
"z": "ps_demo_tab",
"name": "fan startup to pumps",
"func": "return [msg, msg, msg];",
"outputs": 3,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 920,
"wires": [
[
"pump_a"
],
[
"pump_b"
],
[
"pump_c"
]
]
},
{
"id": "setup_random_on",
"type": "inject",
"z": "ps_demo_tab",
"name": "setup: random demand ON",
"props": [
{
"p": "topic",
"vt": "str"
},
{
"p": "payload",
"v": "on",
"vt": "str"
}
],
"topic": "randomToggle",
"payload": "on",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "5",
"x": 100,
"y": 960,
"wires": [
[
"random_state"
]
]
}
]