Extreme simple watchdog
This is my extreme simple watchdog.
In my application is necessary a alert if my sensor stop send data. This flow was write using only 2 delay nodes. After first data coming from, the first delay trigger the second delay. If other messages are arriving in time configured nothing happens. If not new data is received in time configured in second delay node, alert is send.
Hope this example can help you!
[{"id":"7a09f4c641c7a6fb","type":"tab","label":"Simple Watchdog","disabled":false,"info":"","env":[]},{"id":"d5c3811634ec7656","type":"trigger","z":"7a09f4c641c7a6fb","name":"Watchdog","op1":"","op2":"Watchdog alert message","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"98765","bytopic":"all","topic":"topic","outputs":2,"x":620,"y":220,"wires":[[],["98f7fb7abacfaf68","a1a8abebb4260391"]]},{"id":"98f7fb7abacfaf68","type":"trigger","z":"7a09f4c641c7a6fb","name":"Watchdog init","op1":"98765","op2":"Watchdog init","op1type":"num","op2type":"str","duration":"100","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":620,"y":120,"wires":[["d5c3811634ec7656"],["d5c3811634ec7656"]]},{"id":"89d3b8833763c479","type":"inject","z":"7a09f4c641c7a6fb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"/data/monitor","payload":"407","payloadType":"num","x":360,"y":120,"wires":[["98f7fb7abacfaf68"]]},{"id":"a1a8abebb4260391","type":"debug","z":"7a09f4c641c7a6fb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":220,"wires":[]},{"id":"611c5de753f09290","type":"inject","z":"7a09f4c641c7a6fb","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"98765","payloadType":"str","x":390,"y":220,"wires":[["d5c3811634ec7656"]]},{"id":"12b012f79be8eace","type":"comment","z":"7a09f4c641c7a6fb","name":"Data input","info":"","x":340,"y":80,"wires":[]},{"id":"53dead0e2b1a6484","type":"comment","z":"7a09f4c641c7a6fb","name":"Reset timer only for test purpose","info":"","x":310,"y":180,"wires":[]}]