# Icons under delay node

**URL:** <https://discourse.nodered.org/t/icons-under-delay-node/82318>\
**Category:** General\
**Created:** [25 October 2023 03:32 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318 "2023-10-25T03:32:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![tibmeister](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tibmeister/32/84071_2.png) [@tibmeister](https://discourse.nodered.org/u/tibmeister)\
**Post date:** [25 October 2023 03:32 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/1 "2023-10-25T03:32:32Z")

</div>

This may sound like a dumb question, but the docs don't answer this for me. I have two delay nodes, both set to a random delay of 7 ~ 27 minutes. When the flow runs and hits these, one has a blue square with the number 3 under it, the other has a blue square with a number 1 under it. What exactly does these numbers mean???

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 October 2023 05:38 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/2 "2023-10-25T05:38:37Z")

</div>

3 means there are 3 queued (delayed) messages.

---

<div class="post-metadata">

**Author:** ![tibmeister](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tibmeister/32/84071_2.png) [@tibmeister](https://discourse.nodered.org/u/tibmeister)\
**Post date:** [25 October 2023 15:21 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/3 "2023-10-25T15:21:26Z")

</div>

Interesting, I wouldn't actually expect to have any queued messages in this case, but ok. Is there a way to tell what the current random delay value is? In this example, is there a way to tell if the current delay is 7 minutes, 15 minutes, etc?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [25 October 2023 16:08 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/4 "2023-10-25T16:08:47Z")

</div>

Unfortunately not ☹

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [25 October 2023 16:17 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/5 "2023-10-25T16:17:28Z")

</div>

> [@tibmeister](#):
>
> Interesting, I wouldn't actually expect to have any queued messages in this case

Having a random delay between 7~27 minutes - you should expect at the minimum, a 7 minute delayed/queued message. a delayed message, will also be in the count you see, until its time has elapsed.

> [@tibmeister](#):
>
> is there a way to tell if the current delay is 7 minutes, 15 minutes, etc?

Mmm...

If this is critical to your operation, you can get close, but it's not perfect.  
This will spit out the **last** delay that was set.

Given enough time, it can be improved I'm sure.  
The bottom output is the message to state what delay time was used for the incoming message (its delivered before the payload its self)

```auto
[{"id":"15d578429f65a96d","type":"subflow","name":"Delay","info":"","category":"","in":[{"x":85,"y":70,"wires":[{"id":"ad078c22a00752a9"}]}],"out":[{"x":725,"y":65,"wires":[{"id":"aa35cd79e9e79663","port":0}]},{"x":725,"y":170,"wires":[{"id":"2866b8177211025b","port":0}]}],"env":[{"name":"Min","type":"num","value":""},{"name":"Max","type":"num","value":""}],"meta":{},"color":"#3FADB5","icon":"node-red/timer.svg"},{"id":"ad078c22a00752a9","type":"function","z":"15d578429f65a96d","name":"Gen Rand Delay","func":"msg.delay = Math.floor(Math.random() * env.get(\"Max\")) + env.get(\"Min\");\n\nlet DelayStatus = {\n lastDelay:msg.delay\n}\n\nnode.send([msg,{payload:DelayStatus}])","outputs":2,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":250,"y":70,"wires":[["aa35cd79e9e79663"],["2866b8177211025b"]]},{"id":"aa35cd79e9e79663","type":"delay","z":"15d578429f65a96d","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":485,"y":65,"wires":[[]]},{"id":"2866b8177211025b","type":"junction","z":"15d578429f65a96d","x":450,"y":170,"wires":[[]]},{"id":"b1cc4c5dfefe297a","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"daa32dd9a0f6a262","type":"subflow:15d578429f65a96d","z":"b1cc4c5dfefe297a","name":"","env":[{"name":"Min","value":"1000","type":"num"},{"name":"Max","value":"5000","type":"num"}],"x":335,"y":155,"wires":[["a32b70e1cc1a8319"],["68de76d29ae0f090"]]},{"id":"aa292295b271ddbd","type":"inject","z":"b1cc4c5dfefe297a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":165,"y":155,"wires":[["daa32dd9a0f6a262"]]},{"id":"68de76d29ae0f090","type":"debug","z":"b1cc4c5dfefe297a","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":570,"y":170,"wires":[]},{"id":"a32b70e1cc1a8319","type":"debug","z":"b1cc4c5dfefe297a","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":570,"y":125,"wires":[]}]

```

> [@cymplecy](#):
>
> Unfortunately not ☹

I do enjoy a challenge 😄

---

<div class="post-metadata">

**Author:** ![tibmeister](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tibmeister/32/84071_2.png) [@tibmeister](https://discourse.nodered.org/u/tibmeister)\
**Post date:** [26 October 2023 00:37 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/6 "2023-10-26T00:37:06Z")

</div>

So I say I'm surprised that I see more than one message in the queue due to the way I have the flow setup, unless I fundamentally misunderstand how a loop node works.  
Below is a screenshot of the flow, and I only allow one message to get through from the BigTimer, then I block those messages after that until I change the state of the flow.loop\_running variable to false. The reason is I found that when the BigTimer would trigger every minute, it caused the loop node to "reset". So unless the loop node is generating it's own messages somehow, I really don't expect more than a single message in the loop ever. Of course, I have a misunderstanding with the conditional portion on the loop node so maybe this is a bigger misunderstanding of the node overall.  
It's not critical to get the current delay, just makes troubleshooting easier I suppose.

 ![Screenshot 2023-10-25 193329](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/c/7cc6e4f80bb4fd2299aeac437251fd216e9fc9cd.png)

---

<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:** [26 October 2023 11:20 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/7 "2023-10-26T11:20:55Z")

</div>

> [@tibmeister](#):
>
> So I say I'm surprised that I see more than one message in the queue due to the way I have the flow setup

It is easy enough to check by adding a debug node on the input and output so you can track the messages.

---

<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:** [26 October 2023 11:25 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/8 "2023-10-26T11:25:18Z")

</div>

> [@tibmeister](#):
>
> unless I fundamentally misunderstand how a loop node works

It is very unusual to need a loop node, there are usually better ways of solving the problem.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [26 October 2023 11:29 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/9 "2023-10-26T11:29:44Z")

</div>

These loops are most likely the culprit.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [26 October 2023 11:54 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/10 "2023-10-26T11:54:59Z")

</div>

The OP has opened another thread on their basic loop problem

> [@Fundamental misunderstanding of the loop node](https://discourse.nodered.org/t/fundamental-misunderstanding-of-the-loop-node/82341/6):
>
> OK so a couple of things here - most people will not have the Home Assistant nodes installed (i think i am one of the few on here that do) so you are better off asking questions in the Node Red subforum of the HA forums. (Not because we are rude but because most people do not want to pollute their systems with all the HA nodes and the baggage that they bring.) How long is the proposed check time for turning on and off (whatever it is you are controlling) Usually to do this i would use a trigge…

---

<div class="post-metadata">

**Author:** ![tibmeister](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tibmeister/32/84071_2.png) [@tibmeister](https://discourse.nodered.org/u/tibmeister)\
**Post date:** [27 October 2023 00:23 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/11 "2023-10-27T00:23:26Z")

</div>

Yeah, this one was going off topic so opened another thread on the different topic. I think I got the answer I was looking for originally. Thank you.

---

<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:** [26 December 2023 00:24 UTC](https://discourse.nodered.org/t/icons-under-delay-node/82318/12 "2023-12-26T00:24:24Z")

</div>

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