# Can you cancel a trigger node?

**URL:** https://discourse.nodered.org/t/can-you-cancel-a-trigger-node/712
**Category:** General
**Created:** [9 June 2018 12:44 UTC](https://discourse.nodered.org/t/can-you-cancel-a-trigger-node/712 "2018-06-09T12:44:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![fahrvergnuugen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fahrvergnuugen/32/818_2.png) [@fahrvergnuugen](https://discourse.nodered.org/u/fahrvergnuugen)
#### Post date: [9 June 2018 12:44 UTC](https://discourse.nodered.org/t/can-you-cancel-a-trigger-node/712/1 "2018-06-09T12:44:36Z")

</div>

I’m using a trigger node as a timer for my basement lights so that they automatically shut off after X minutes. I have three inputs which trigger the lights to turn on (two light switches and a motion detector). If any of the inputs fires, the trigger timer resets - this effectively allows occupancy detection because the motion detector will keep reseting the X minute timer as long as it detects something.

Now I want to make it possible to disable the trigger by double tapping one of the light switches on.

In order to do so, first I need to detect a double tap of the switch (the switches are sending MQTT messages into node-red).

Then I have to be able to disable the trigger which has already begun counting down from the first on command.

Is this doable with the builtin nodes? Or do I need to write my own function?

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [9 June 2018 12:47 UTC](https://discourse.nodered.org/t/can-you-cancel-a-trigger-node/712/2 "2018-06-09T12:47:39Z")

</div>

From the Trigger nodes Info panel

> reset  
> If a message is received with this property, any timeout or repeat currently in progress will be cleared and no message triggered.

---

<div class="post-metadata">

### Author: ![fahrvergnuugen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fahrvergnuugen/32/818_2.png) [@fahrvergnuugen](https://discourse.nodered.org/u/fahrvergnuugen)
#### Post date: [9 June 2018 13:03 UTC](https://discourse.nodered.org/t/can-you-cancel-a-trigger-node/712/3 "2018-06-09T13:03:56Z")

</div>

Maybe I’m not using the reset correctly - when I send a reset to it, the count down timer just resets. It still fires after the timeout. (that’s actually what I expected reset to do)

---

<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: [9 June 2018 13:39 UTC](https://discourse.nodered.org/t/can-you-cancel-a-trigger-node/712/4 "2018-06-09T13:39:51Z")

</div>

Can you feed your reset message into a debug node and paste the result here so we can see what you are sending.

---

<div class="post-metadata">

### Author: ![davidcgu](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@davidcgu](https://discourse.nodered.org/u/davidcgu)
#### Post date: [9 June 2018 14:07 UTC](https://discourse.nodered.org/t/can-you-cancel-a-trigger-node/712/5 "2018-06-09T14:07:46Z")

</div>

Take a look on this, is really great for the lights:

> **[node-red-contrib-smartswitch](https://flows.nodered.org/node/node-red-contrib-smartswitch)**
>
> A smartswitch node for node-red

As note can handle at once on/off and timer triggers

Regarding the trigger node I was looking for one where the time can be set by a msg in order to have some flexibility, instead of fixed time, I know there is bigtimes, but wordering if there is soemthing much simple.

Regards

---

<div class="post-metadata">

### Author: ![fahrvergnuugen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fahrvergnuugen/32/818_2.png) [@fahrvergnuugen](https://discourse.nodered.org/u/fahrvergnuugen)
#### Post date: [9 June 2018 14:44 UTC](https://discourse.nodered.org/t/can-you-cancel-a-trigger-node/712/6 "2018-06-09T14:44:08Z")

</div>

@Colin @ukmoose - You were right. The reset does cancel the trigger - not reset the timer as I thought. I just had the wrong property set and also had a misunderstanding of what the intended behavior was.

Thank you!
