I did not completely understand this option. I will test it for the watermeter first, below my flow.
[
{
"id": "02c8da9c9f004ce0",
"type": "rpi-gpio in",
"z": "daac5e65e6e72986",
"name": "Watermeter puls (L1)",
"pin": "23",
"intype": "tri",
"debounce": "25",
"read": true,
"bcm": true,
"x": 200,
"y": 1660,
"wires": [
[
"ce8d952f.18666"
]
]
},
{
"id": "fda0a334.bc9588",
"type": "inject",
"z": "daac5e65e6e72986",
"name": "reset",
"repeat": "",
"crontab": "",
"once": false,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 190,
"y": 1800,
"wires": [
[
"17cce981.975686"
]
]
},
{
"id": "ce8d952f.18666",
"type": "function",
"z": "daac5e65e6e72986",
"name": "msg object",
"func": "msg.increment = 1;\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 1720,
"wires": [
[
"ac65bf94.6e609"
]
]
},
{
"id": "17cce981.975686",
"type": "function",
"z": "daac5e65e6e72986",
"name": "msg object",
"func": "msg.reset = true;\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 1800,
"wires": [
[
"ac65bf94.6e609"
]
]
},
{
"id": "ac65bf94.6e609",
"type": "counter",
"z": "daac5e65e6e72986",
"name": "",
"init": "100",
"step": 1,
"lower": null,
"upper": null,
"mode": "increment",
"outputs": 1,
"x": 560,
"y": 1740,
"wires": [
[
"c2893b966e892354",
"fba855e07eca3774",
"c9adc4cdcdda4625",
"96beafdd58160cd1"
]
]
},
{
"id": "fba855e07eca3774",
"type": "function",
"z": "daac5e65e6e72986",
"name": "Watermeter",
"func": "flow.set(\"water\",msg.count)\nlet waterT = flow.get(\"water\")\nmsg.payload = waterT;\nmsg.topic = \"Totaal water\"\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 790,
"y": 1740,
"wires": [
[
"04564826297c0bc0"
]
]
},
{
"id": "285e0e19.b9680a",
"type": "inject",
"z": "daac5e65e6e72986",
"name": "increment",
"repeat": "",
"crontab": "",
"once": false,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 180,
"y": 1720,
"wires": [
[
"ce8d952f.18666"
]
]
},
{
"id": "a8ad38766f6fa0c2",
"type": "change",
"z": "daac5e65e6e72986",
"name": "get value water",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "#:(file)::wstore",
"tot": "flow"
},
{
"t": "set",
"p": "whold",
"pt": "flow",
"to": "0",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1060,
"y": 1860,
"wires": [
[
"0ca4f578aa918e28"
]
]
},
{
"id": "0ca4f578aa918e28",
"type": "function",
"z": "daac5e65e6e72986",
"name": "Water totaal",
"func": "var waterT = msg.payload;\nmsg.payload = waterT / 1000 + (\" m3\");\nmsg.topic = \"Totaal water\"\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1250,
"y": 1860,
"wires": [
[
"6ec8afb177c37c43"
]
]
},
{
"id": "f8d5be30f9e348a5",
"type": "inject",
"z": "daac5e65e6e72986",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "HOLD",
"payloadType": "str",
"x": 170,
"y": 1860,
"wires": [
[
"c9adc4cdcdda4625"
]
]
},
{
"id": "6ec8afb177c37c43",
"type": "ui-text",
"z": "daac5e65e6e72986",
"group": "927da3575e7dfcde",
"order": 28,
"width": 2,
"height": 0,
"name": "Vastleggen water",
"label": "Water totaal:",
"format": "{{msg.payload}}",
"layout": "row-left",
"style": true,
"font": "Arial Black,Arial Black,Gadget,sans-serif",
"fontSize": "14",
"color": "#000000",
"wrapText": false,
"className": "",
"value": "payload",
"valueType": "msg",
"x": 1450,
"y": 1860,
"wires": []
},
{
"id": "0ad55939fdce4995",
"type": "ui-text",
"z": "daac5e65e6e72986",
"group": "927da3575e7dfcde",
"order": 12,
"width": 2,
"height": 0,
"name": "Water totaal",
"label": "Water totaal:",
"format": "{{msg.payload}}",
"layout": "row-spread",
"style": true,
"font": "Arial Black,Arial Black,Gadget,sans-serif",
"fontSize": "16",
"color": "#000000",
"wrapText": false,
"className": "",
"value": "payload",
"valueType": "msg",
"x": 1430,
"y": 1740,
"wires": []
},
{
"id": "992b6aa48bb386f6",
"type": "trigger",
"z": "daac5e65e6e72986",
"name": "",
"op1": "false",
"op2": "true",
"op1type": "bool",
"op2type": "bool",
"duration": "250",
"extend": false,
"overrideDelay": false,
"units": "ms",
"reset": "true",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 1040,
"y": 1680,
"wires": [
[
"99f2b642925a51dc"
]
]
},
{
"id": "c2893b966e892354",
"type": "function",
"z": "daac5e65e6e72986",
"name": "Water tarief pulsen",
"func": "const thisvalue = msg.count // Extract the latest value from payload\nconst lastvalue = context.get(\"lastvalueW\") || true // and previous value from context\n\nif (thisvalue > lastvalue) { // Do some sort of comparison\n msg.payload = false\n}\nelse {\n msg.payload = true\n}\n\ncontext.set(\"lastvalueW\", thisvalue)\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 810,
"y": 1680,
"wires": [
[
"992b6aa48bb386f6"
]
]
},
{
"id": "99f2b642925a51dc",
"type": "ui-led",
"z": "daac5e65e6e72986",
"name": "Water tatief led",
"group": "927da3575e7dfcde",
"order": 13,
"width": 1,
"height": 0,
"label": "",
"labelPlacement": "left",
"labelAlignment": "center",
"states": [
{
"value": "false",
"valueType": "bool",
"color": "#0000ff"
},
{
"value": "true",
"valueType": "bool",
"color": "#ffffff"
}
],
"allowColorForValueInMessage": false,
"shape": "circle",
"showBorder": true,
"showGlow": true,
"x": 1440,
"y": 1680,
"wires": []
},
{
"id": "04564826297c0bc0",
"type": "function",
"z": "daac5e65e6e72986",
"name": "Water totaal",
"func": "let waterT = msg.count;\nmsg.payload = waterT / 1000 + (\" m3\");\n\nmsg.topic = \"Totaal water\"\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1030,
"y": 1740,
"wires": [
[
"0ad55939fdce4995"
]
]
},
{
"id": "c9adc4cdcdda4625",
"type": "function",
"z": "daac5e65e6e72986",
"name": "Water hold",
"func": "const message = msg.payload\nlet whold = flow.get(\"holdw\") || 0\n\n// If `HOLD`\nif (message == \"HOLD\")\n{\n flow.set(\"holdw\",1)\n return // Nothing more to do be hone here/now\n}\n\nif (whold == 1)\n{\n // `hold` is set.\n flow.set(\"wstore\",msg.count, \"file\")\n flow.set(\"holdw\",0) // stop next message being storred too.\n}\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 1860,
"wires": [
[
"a8ad38766f6fa0c2"
]
]
},
{
"id": "96beafdd58160cd1",
"type": "change",
"z": "daac5e65e6e72986",
"name": "",
"rules": [
{
"t": "set",
"p": "latestValue",
"pt": "flow",
"to": "count",
"tot": "msg",
"dc": true
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 810,
"y": 1800,
"wires": [
[
"05c575a78364c32a"
]
]
},
{
"id": "05c575a78364c32a",
"type": "change",
"z": "daac5e65e6e72986",
"name": "",
"rules": [
{
"t": "set",
"p": "heldvalue",
"pt": "flow",
"to": "LatestValue",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1050,
"y": 1800,
"wires": [
[]
]
},
{
"id": "927da3575e7dfcde",
"type": "ui-group",
"name": "Nr.11 Verbruik en tellerstanden",
"page": "a5219b6b7f535c4d",
"width": 3,
"height": 1,
"order": 3,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{
"id": "a5219b6b7f535c4d",
"type": "ui-page",
"name": "Nr.11 Groepen / verbruik / WiFi",
"ui": "9db73792cdc62e1e",
"path": "/page8",
"icon": "home",
"layout": "grid",
"theme": "2afc50d1d1cfac95",
"breakpoints": [
{
"name": "Default",
"px": "0",
"cols": "3"
},
{
"name": "Tablet",
"px": "576",
"cols": "6"
},
{
"name": "Small Desktop",
"px": "768",
"cols": "9"
},
{
"name": "Desktop",
"px": "1024",
"cols": "12"
}
],
"order": 9,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "9db73792cdc62e1e",
"type": "ui-base",
"name": "Muntsetille",
"path": "/dashboard",
"appIcon": "",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control"
],
"showPathInSidebar": false,
"headerContent": "dashpage",
"navigationStyle": "default",
"titleBarStyle": "default",
"showReconnectNotification": true,
"notificationDisplayTime": 1,
"showDisconnectNotification": true,
"allowInstall": false
},
{
"id": "2afc50d1d1cfac95",
"type": "ui-theme",
"name": "Default Theme",
"colors": {
"surface": "#924f96",
"primary": "#ccc500",
"bgPage": "#c19a9a",
"groupBg": "#84b4e1",
"groupOutline": "#cccccc"
},
"sizes": {
"density": "default",
"pagePadding": "12px",
"groupGap": "4px",
"groupBorderRadius": "4px",
"widgetGap": "12px"
}
},
{
"id": "b23bc31c4967b732",
"type": "global-config",
"env": [],
"modules": {
"node-red-node-pi-gpio": "2.0.7",
"node-red-contrib-counter": "0.1.6",
"@flowfuse/node-red-dashboard": "1.30.2",
"@flowfuse/node-red-dashboard-2-ui-led": "1.1.0"
}
}
]
(sorry for the dutch text)