UNPKG

node-red-contrib-error-on-timeout

Version:

Node that triggers an error if a message is not received within the configured time frame. Also has an output for "late" messages.

339 lines 8.59 kB
[ { "id": "28dc95d3c7277382", "type": "error-on-timeout", "z": "522f5c47f0da8e89", "timeout": "50", "verbose": true, "x": 1020, "y": 200, "wires": [ [ "e2c0bc275a670468" ], [ "bb418bef82822c9f" ], [ "820763696da44a13" ] ] }, { "id": "e2c0bc275a670468", "type": "debug", "z": "522f5c47f0da8e89", "name": "error-on-timeout Success", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1410, "y": 160, "wires": [] }, { "id": "bb418bef82822c9f", "type": "debug", "z": "522f5c47f0da8e89", "name": "error-on-timeout Timeout", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1410, "y": 200, "wires": [] }, { "id": "820763696da44a13", "type": "debug", "z": "522f5c47f0da8e89", "name": "error-on-timeout Late", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1400, "y": 240, "wires": [] }, { "id": "f9b071bfcb1c8c8c", "type": "group", "z": "522f5c47f0da8e89", "name": "Normal operation", "style": { "fill": "#e3f3d3", "label": true, "color": "#000000" }, "nodes": [ "f0cfe8f236e09cb4", "7c520d82165b672a", "a9ea4065d35224a2", "ccc6e1a0fdeb85c4" ], "env": [], "x": 74, "y": 79, "w": 752, "h": 162 }, { "id": "f0cfe8f236e09cb4", "type": "function", "z": "522f5c47f0da8e89", "g": "f9b071bfcb1c8c8c", "name": "Set eot_trigger flag with delay between 50 and 60ms", "func": "function randomIntFromInterval(min, max) { // min and max included \n return Math.floor(Math.random() * (max - min + 1) + min)\n}\n\nmsg.eot_trigger = true;\nmsg.eot_timeout = randomIntFromInterval(50,60);\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 600, "y": 120, "wires": [ [ "28dc95d3c7277382" ] ] }, { "id": "7c520d82165b672a", "type": "function", "z": "522f5c47f0da8e89", "g": "f9b071bfcb1c8c8c", "name": "Set eot_input flag", "func": "msg.eot_input = true;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 490, "y": 200, "wires": [ [ "ccc6e1a0fdeb85c4" ] ] }, { "id": "a9ea4065d35224a2", "type": "inject", "z": "522f5c47f0da8e89", "g": "f9b071bfcb1c8c8c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "demo", "payloadType": "date", "x": 200, "y": 120, "wires": [ [ "f0cfe8f236e09cb4", "7c520d82165b672a" ] ] }, { "id": "ccc6e1a0fdeb85c4", "type": "delay", "z": "522f5c47f0da8e89", "g": "f9b071bfcb1c8c8c", "name": "", "pauseType": "delay", "timeout": "50", "timeoutUnits": "milliseconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "allowrate": false, "outputs": 1, "x": 710, "y": 200, "wires": [ [ "28dc95d3c7277382" ] ] }, { "id": "95f805e584b2d478", "type": "group", "z": "522f5c47f0da8e89", "name": "Trigger verbose messages due to flow errors ", "style": { "label": true, "fill": "#ffbfbf", "color": "#000000" }, "nodes": [ "8dd1f6134b332c7f", "0c5a63857f35c196", "709e421689876b2f", "0a6827d7231ffede", "e6347a8fff996d09" ], "env": [], "x": 74, "y": 259, "w": 752, "h": 262 }, { "id": "8dd1f6134b332c7f", "type": "inject", "z": "522f5c47f0da8e89", "g": "95f805e584b2d478", "name": "Trigger verbose message", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payloadType": "date", "x": 690, "y": 480, "wires": [ [ "28dc95d3c7277382" ] ] }, { "id": "0c5a63857f35c196", "type": "inject", "z": "522f5c47f0da8e89", "g": "95f805e584b2d478", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "demo", "payloadType": "date", "x": 200, "y": 300, "wires": [ [ "709e421689876b2f", "0a6827d7231ffede" ] ] }, { "id": "709e421689876b2f", "type": "function", "z": "522f5c47f0da8e89", "g": "95f805e584b2d478", "name": "Set eot_trigger flag with delay between 50 and 60ms", "func": "function randomIntFromInterval(min, max) { // min and max included \n return Math.floor(Math.random() * (max - min + 1) + min)\n}\n\nmsg.eot_trigger = true;\nmsg.eot_timeout = randomIntFromInterval(50,60);\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 600, "y": 300, "wires": [ [ "28dc95d3c7277382" ] ] }, { "id": "0a6827d7231ffede", "type": "function", "z": "522f5c47f0da8e89", "g": "95f805e584b2d478", "name": "Dont set eot_input flag", "func": "\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 500, "y": 380, "wires": [ [ "e6347a8fff996d09" ] ] }, { "id": "e6347a8fff996d09", "type": "delay", "z": "522f5c47f0da8e89", "g": "95f805e584b2d478", "name": "", "pauseType": "delay", "timeout": "50", "timeoutUnits": "milliseconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "allowrate": false, "outputs": 1, "x": 730, "y": 380, "wires": [ [ "28dc95d3c7277382" ] ] } ]