Send reset to a trigger node

Hello
i do check for a device if the ping is false i got a Telegram Message!
because i don't like to get every 30Second a Message i have added a trigger Node to wait 180min.

I have a manual inject Node with the msg.reset and true this will reset the trigger Node.

i would like to have a "switch?" if ping time is >1 the the trigger should be reseted

how should this be done?

have a nice day
vinc

Not sure if I fully understand your question, but have you looked at a 'delay' node set to rate limit, instead of a 'trigger' node?
Then you will only get 1 alert in any time period that you wish.

delat

merci @Paul-Reed
my trigger node do the same - but with a inject node you can brake this delay.

imagine you ping a device (all 30s) - device is out of service - so i would get all 30sec a Telegram Information.
So I add inbetween the trigger node and then it wait 180min for the next message.
but with the inject i could brak it.
So now i would liket to have a Node (if ping result over 1 (so it is not false) then reset the trigger for the delay

[{"id":"b049c594.349ec8","type":"trigger","z":"3f0aa6a1.315e4a","name":"","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"180","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":770,"y":1460,"wires":[[]]},{"id":"d9a7a266.81204","type":"inject","z":"3f0aa6a1.315e4a","name":"Reset Trigger","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":550,"y":1380,"wires":[["b049c594.349ec8"]]}]

You can use a Switch to check for ping OK and then feed that into a Change node to set msg.reset, as in the flow below.
If you already have a Switch node to detect the ping failed and use that to start the trigger then you can probably use the Otherwise case in the switch rather than use another Switch

[{"id":"d0954c1a.20d1a8","type":"change","z":"84405ff5.25fa6","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":1500,"wires":[["a56c70a4.88947"]]},{"id":"7ee9d6b6.565368","type":"switch","z":"84405ff5.25fa6","name":"ping ok?","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":120,"y":1500,"wires":[["d0954c1a.20d1a8"]]}]

@Colin
thanks a lot - more then perfect!
i did add the information to my switch and added your change Node and it works perfect.
device is off i got a telegram Message telling me then wait 3h.
as soon changed the battery i comes back to life and the trigger node is resetted.
Merci
vinc

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.