# Trigger node bogus delay

**URL:** https://discourse.nodered.org/t/trigger-node-bogus-delay/26069
**Category:** General
**Created:** [4 May 2020 14:17 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069 "2020-05-04T14:17:38Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 14:17 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/1 "2020-05-04T14:17:39Z")

</div>

This is my first real-world flow and I've already got an issue 🙄 The problem is that the trigger node delays the first message by 7 seconds instead of passing it through directly. It handles intervening messages and the delay for the "off" as I expect. What the heck am I missing?

 ![Screenshot_2020-05-04_07-51-12](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/7/d7da67c6fc76bbb6696c40f3452f1d2c6ba63d71.png) ![Screenshot_2020-05-04_07-51-33](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/9/798b21d385d460d177006ccd1ec98f88aa8cda7a.png)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [4 May 2020 15:31 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/2 "2020-05-04T15:31:14Z")

</div>

connect an `inject` node to the `trigger` node and test it. It works for me.

Is it possible that the hall Motion node is sending multiple messages????

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 15:35 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/3 "2020-05-04T15:35:14Z")

</div>

Thank you, @zenofmud, for the quick response.

I'll try that... after I take my dog to the groomer. She gets done today, I have to wait another month!

The motion sensor does indeed send multiple messages but not more often than about 10 seconds. I _think_ the trigger node handles that properly.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [4 May 2020 15:36 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/4 "2020-05-04T15:36:38Z")

</div>

put a devug node on the sensor (give another name) so you can verify how often messages are coming thru.

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 16:18 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/5 "2020-05-04T16:18:32Z")

</div>

> [@zenofmud](#):
>
> devug node on the sensor

How can I get closer to the sensor than the MQTT input node?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [4 May 2020 16:37 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/6 "2020-05-04T16:37:37Z")

</div>

oops never mind i missed that  
So at  
7:35:01 - a msg 'true' came from the mqtt node and seven seconds later at  
7:35:08 - a 'false' msg came from the mqtt node.from, then at  
7:35:08 - a 'true' msg leaves the trigger node and at  
7:35:23 - a 'false' msg leaves the trigger node

Are you setting a msg.topic?  
Please change the debug nodes to display the complete msg object.

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 16:44 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/7 "2020-05-04T16:44:53Z")

</div>

> [@zenofmud](#):
>
> setting a msg.topic?

The only "topic" field anywhere here is the MQTT subscription topic.

Here is the current flow and the output from the debug nodes. I'll post the results of injecting in a moment.

 ![Screenshot_2020-05-04_10-41-50](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/7/37f1a702153c6fdd85c21eecba8b6a66b0cb4b7b.png)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [4 May 2020 16:52 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/8 "2020-05-04T16:52:15Z")

</div>

Please do this. add an` inject` connected to a` change` node. In the` change` node move 'reset' to msg.reset. Connect the `change` node to the `trigger` node and test.

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 16:55 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/9 "2020-05-04T16:55:41Z")

</div>

Here I clicked inject True once and waited 3 minutes and nothing has come out of the trigger node. What I expect to happen is that any True passes though the trigger immediately and starts the 15 second timer (which is restarted buy all subsequent True or False input) and when the timer expires the trigger node spits out a false.

 ![Screenshot_2020-05-04_10-49-41](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f1f2e6d8bf506c890c54089eedf9e7a751187e9b.png)  
You're getting ahead of me. I'll add the change node after the next test, which is injecting a False and seeing what happens.

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 16:58 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/10 "2020-05-04T16:58:46Z")

</div>

Hmmm, injecting a False one time gives the exact behavior I desire...but why?

 ![Screenshot_2020-05-04_10-56-59](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/1075cc9ec45284616425708e5118d20d89a5fd33.png)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [4 May 2020 16:59 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/11 "2020-05-04T16:59:42Z")

</div>

try adding a reset as I asked in my prior post.

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 17:01 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/12 "2020-05-04T17:01:52Z")

</div>

Clearly, the trigger node does not operate according to what I gleaned from the sidebar notes.

I'll add the change node now but which inject to you want as it's input? T or F?

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 17:07 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/13 "2020-05-04T17:07:52Z")

</div>

Is this what you want in the change node? ![Screenshot_2020-05-04_11-06-57](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/b/8bc35f7918f267cd2f57c995ac291726a23528f8.png)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [4 May 2020 17:10 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/14 "2020-05-04T17:10:10Z")

</div>

![Screen Shot 2020-05-04 at 1.09.53 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/f/3f269989e3e3663749e13dacf5f103d1740a7d00.png)

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 17:12 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/15 "2020-05-04T17:12:50Z")

</div>

Thanks. Done. What should the inject node send? payload (string) reset?

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 17:20 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/16 "2020-05-04T17:20:44Z")

</div>

Tried my guess and that's not right.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [4 May 2020 17:24 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/17 "2020-05-04T17:24:19Z")

</div>

I just realized that you reset the trigger is the incoming msg is equal to 'true'.  
So the sensor sends a true and the debug IN displays the msg and it is sent to the trigger and the trigger is reset.  
Now a false comes along, the debug displays it and sends it to the trigger and the trigger sends out 'true' (because that is what you told it to do) and when the timer expires, the trigger sends out a 'false'

So t is doing wat you have told it to do. Now the question is 'What do you want to do?"

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 17:28 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/18 "2020-05-04T17:28:56Z")

</div>

I want a True coming from the MQTT input to pass immediately to the MQTT out and start the 15 sec countdown leading to a False being sent to the MQTT out. Any intervening T or F should reset the countdown to 15 sec.

This is a simple motion lighting flow. I'm testing with 15 sec but will change that to like 5 minutes when it does what I want.

---

<div class="post-metadata">

### Author: ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)
#### Post date: [4 May 2020 17:30 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/19 "2020-05-04T17:30:39Z")

</div>

I actually expected to find an example in this forum but did not.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [4 May 2020 17:37 UTC](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069/20 "2020-05-04T17:37:39Z")

</div>

I have a session with my grandson for the next hour so I'll be off line till then

[Next page](https://discourse.nodered.org/t/trigger-node-bogus-delay/26069.md?page=2)
