Hi All, we are using the trigger node as part of a watchdog flow to provide an alert (via webhook) when sensor data is not received after X minutes.
We are new to NodeRed and are learning as we go.
Originally we had a 'watchdog' flow (attached below) per sensor but as we started scaling up we started using the 'Handling' option on the unique sensor ID (devEUI) for the trigger node so we have a single watchdog flow for multiple sensors of the same type.
This appears to work as expected but as we continue to scale up we will be looking at this flow potentially monitoring hundreds of sensors. As I understand it, this will involve hundreds of counters running simultaneously and in this case being reset (via change node) every ~15 minutes providing data is present.
Would you have any performance concerns with this approach or other options/solutions that we've not yet considered for monitoring frequency of data?
Hopefully I have provided sufficient detail to understand our requirements but if not I'm happy to elaborate further.
Data is coming via MQTT, decode is either via a function node or directly on the gateway. The main flow also writes to DB, provides dashboarding, alerts on out of spec data and in some cases will provide some cause and effect actions.
Thanks in advance
Matt
[
{
"id": "9cb3c40960cdf070",
"type": "group",
"z": "8ff88037d9bc958d",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
"fill": "none",
"fill-opacity": "1",
"label": true,
"label-position": "nw",
"color": "#a4a4a4"
},
"nodes": [
"e8a94db3fb960e72",
"70ce5cc2692fe19a",
"d50aa1520aa6a42c",
"9c1bf22685b78818",
"1a9c5ddc4080e7d5",
"3e4271fad7812916"
],
"x": 604,
"y": 439,
"w": 1092,
"h": 202
},
{
"id": "e8a94db3fb960e72",
"type": "debug",
"z": "8ff88037d9bc958d",
"g": "9cb3c40960cdf070",
"name": "debug 192",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1230,
"y": 480,
"wires": []
},
{
"id": "70ce5cc2692fe19a",
"type": "trigger",
"z": "8ff88037d9bc958d",
"g": "9cb3c40960cdf070",
"name": "Watchdog",
"op1": "",
"op2": "timeout",
"op1type": "nul",
"op2type": "str",
"duration": "1",
"extend": true,
"overrideDelay": false,
"units": "hr",
"reset": "",
"bytopic": "topic",
"topic": "payload.devEUI",
"outputs": 1,
"x": 890,
"y": 600,
"wires": [
[
"e8a94db3fb960e72",
"d50aa1520aa6a42c",
"9c1bf22685b78818"
]
]
},
{
"id": "d50aa1520aa6a42c",
"type": "template",
"z": "8ff88037d9bc958d",
"g": "9cb3c40960cdf070",
"name": "No Data warning",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\n \"@context\": \"https://schema.org/extensions\",\n \"@type\": \"MessageCard\",\n \"themeColor\": \"0072C6\",\n \"title\": \"Milesight Fridge Timeout\",\n \"subject\": \"Milesight Fridge Timeout\",\n \"text\": \"Milesight Fridge Timeout has not received data for 1 hr\"\n}",
"output": "str",
"x": 1280,
"y": 560,
"wires": [
[
"3e4271fad7812916"
]
]
},
{
"id": "9c1bf22685b78818",
"type": "delay",
"z": "8ff88037d9bc958d",
"g": "9cb3c40960cdf070",
"name": "",
"pauseType": "delay",
"timeout": "10",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 930,
"y": 520,
"wires": [
[
"1a9c5ddc4080e7d5"
]
]
},
{
"id": "1a9c5ddc4080e7d5",
"type": "change",
"z": "8ff88037d9bc958d",
"g": "9cb3c40960cdf070",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 710,
"y": 520,
"wires": [
[
"70ce5cc2692fe19a"
]
]
},
{
"id": "3e4271fad7812916",
"type": "http request",
"z": "8ff88037d9bc958d",
"g": "9cb3c40960cdf070",
"name": "Teams Webhook Alerts",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://webhook.office.com",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 1570,
"y": 560,
"wires": [
[]
]
}
]