Can you cancel a trigger node?


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?



From the Trigger nodes Info panel

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



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)



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



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

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.




@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!