# Send reset to a trigger node

**URL:** <https://discourse.nodered.org/t/send-reset-to-a-trigger-node/44669>\
**Category:** General\
**Created:** [24 April 2021 19:20 UTC](https://discourse.nodered.org/t/send-reset-to-a-trigger-node/44669 "2021-04-24T19:20:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [24 April 2021 19:20 UTC](https://discourse.nodered.org/t/send-reset-to-a-trigger-node/44669/1 "2021-04-24T19:20:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [24 April 2021 19:28 UTC](https://discourse.nodered.org/t/send-reset-to-a-trigger-node/44669/2 "2021-04-24T19:28:48Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/1/c152235f4fa405ca8b317262341b251697c0ba4d.jpeg)

---

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [25 April 2021 09:06 UTC](https://discourse.nodered.org/t/send-reset-to-a-trigger-node/44669/3 "2021-04-25T09:06:56Z")

</div>

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

```auto
[{"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"]]}]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 April 2021 10:28 UTC](https://discourse.nodered.org/t/send-reset-to-a-trigger-node/44669/4 "2021-04-25T10:28:32Z")

</div>

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

```auto
[{"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"]]}]

```

---

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [25 April 2021 10:54 UTC](https://discourse.nodered.org/t/send-reset-to-a-trigger-node/44669/5 "2021-04-25T10:54:50Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 May 2021 10:55 UTC](https://discourse.nodered.org/t/send-reset-to-a-trigger-node/44669/6 "2021-05-09T10:55:04Z")

</div>

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