Sorry, I can't remember who first came up with this, I just copied it. Don't forget to change the filename to your own flows file. Mine is in a non-standard location and has a non-standard name.
[
{
"id": "c34db4d4.2863a8",
"type": "file in",
"z": "9974253c.de8db8",
"name": "",
"filename": "/home/pi//node/nrlive/.data/flows.json",
"format": "utf8",
"chunk": false,
"sendError": false,
"x": 330,
"y": 480,
"wires": [
[
"113a5dd3.0310f2"
]
]
},
{
"id": "113a5dd3.0310f2",
"type": "json",
"z": "9974253c.de8db8",
"name": "",
"pretty": false,
"x": 550,
"y": 480,
"wires": [
[
"213eb35d.27e87c"
]
]
},
{
"id": "213eb35d.27e87c",
"type": "change",
"z": "9974253c.de8db8",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload^(type) {\t \"TOTAL\": $count($$.payload),\t $substringBefore(type, \":\"): $count([$])\t}",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 720,
"y": 480,
"wires": [
[
"a8fa7ea8.800bf"
]
]
},
{
"id": "a8fa7ea8.800bf",
"type": "debug",
"z": "9974253c.de8db8",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 910,
"y": 480,
"wires": []
},
{
"id": "16fe06b3.a34209",
"type": "inject",
"z": "9974253c.de8db8",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 100,
"y": 480,
"wires": [
[
"c34db4d4.2863a8"
]
]
},
{
"id": "43a5f911.e2c248",
"type": "comment",
"z": "9974253c.de8db8",
"name": "How Many Nodes in my flow?",
"info": "",
"x": 160,
"y": 440,
"wires": []
}
]
```