# DELAY node - feature request

**URL:** https://discourse.nodered.org/t/delay-node-feature-request/24488
**Category:** Feature Requests
**Created:** [8 April 2020 22:42 UTC](https://discourse.nodered.org/t/delay-node-feature-request/24488 "2020-04-08T22:42:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [8 April 2020 22:42 UTC](https://discourse.nodered.org/t/delay-node-feature-request/24488/1 "2020-04-08T22:42:26Z")

</div>

As is, the `delay` node can accept variable delays in the `msg.delay` part of the message.

All nice.

I've found a place where it _falls short_:

Say I have it set to `rate limit`.  
It limits the rate but the **fixed** value I enter.

't would be nice if `msg.delay` also had control on that part of the node's working.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [9 April 2020 05:43 UTC](https://discourse.nodered.org/t/delay-node-feature-request/24488/2 "2020-04-09T05:43:38Z")

</div>

This is a flow (bit of a mash up) that does what I want, but it is a bit convoluted in getting the job done.

```auto
[{"id":"ddfa9b52.558568","type":"change","z":"b4f1ccd4.5e8d1","name":"","rules":[{"t":"set","p":"delay","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":1580,"wires":[[]]},{"id":"e8522a1f.4c89b8","type":"inject","z":"b4f1ccd4.5e8d1","name":"","topic":"","payload":"Dummy message","payloadType":"str","repeat":"0.5","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":1730,"wires":[["4aa07069.702ae"]]},{"id":"dd2d9210.f02b","type":"change","z":"b4f1ccd4.5e8d1","name":"","rules":[{"t":"set","p":"delay","pt":"msg","to":"delay","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":1660,"wires":[["5c3db77e.000528","f688c6c7.32d258"]]},{"id":"25308454.b65f24","type":"inject","z":"b4f1ccd4.5e8d1","name":"","topic":"","payload":"5000","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":1500,"wires":[["ddfa9b52.558568"]]},{"id":"661b9c82.68d25c","type":"inject","z":"b4f1ccd4.5e8d1","name":"","topic":"","payload":"8000","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":1540,"wires":[["ddfa9b52.558568"]]},{"id":"1857a94c.3c856f","type":"inject","z":"b4f1ccd4.5e8d1","name":"","topic":"","payload":"2000","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":1460,"wires":[["ddfa9b52.558568"]]},{"id":"c7221256.3f9b48","type":"inject","z":"b4f1ccd4.5e8d1","name":"","topic":"","payload":"200","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":1420,"wires":[["ddfa9b52.558568"]]},{"id":"4aa07069.702ae","type":"function","z":"b4f1ccd4.5e8d1","name":"One only V2","func":"var full = context.get(\"FULL\") || 0;\nif (msg.topic == \"GATE\")\n{\n //\n if (msg.payload == \"FULL\")\n {\n // Allow all messages\n context.set(\"FULL\", 1);\n context.set(\"ALLOW\",1);\n node.status({fill: \"green\",text:\"FULL\"});\n return;\n } else\n if (msg.payload == \"CLOSE\")\n {\n // Stop messages\n context.set(\"FULL\", 0);\n context.set(\"ALLOW\",0);\n node.status({});\n return;\n } else\n //\n {\n context.set(\"ALLOW\",1);\n node.status({fill: \"green\",text:\"ONE\"});\n return;\n }\n}\nif (context.get(\"ALLOW\") == 1)\n{\n //\n if (full == 0)\n {\n context.set(\"ALLOW\",0);\n node.status({});\n return msg;\n } else\n return msg;\n}\n\n","outputs":1,"noerr":0,"x":360,"y":1730,"wires":[["dd2d9210.f02b","5dd92347.e5d984"]]},{"id":"5dd92347.e5d984","type":"debug","z":"b4f1ccd4.5e8d1","name":"OUTPUT","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":570,"y":1730,"wires":[]},{"id":"5c3db77e.000528","type":"delay","z":"b4f1ccd4.5e8d1","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":420,"y":1660,"wires":[["7ea55c15.2ef5e4"]]},{"id":"7ea55c15.2ef5e4","type":"change","z":"b4f1ccd4.5e8d1","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"GATE","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"ONE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":1660,"wires":[["4aa07069.702ae","148e1988.c1e116"]]},{"id":"ce21a708.c723a","type":"inject","z":"b4f1ccd4.5e8d1","name":"Start up","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":550,"y":1610,"wires":[["7ea55c15.2ef5e4"]]}]

```

---

<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: [9 April 2020 10:50 UTC](https://discourse.nodered.org/t/delay-node-feature-request/24488/3 "2020-04-09T10:50:21Z")

</div>

JFI see here for previous discussion on it

> [@Variable Rate Limit using Delay Node?](https://discourse.nodered.org/t/variable-rate-limit-using-delay-node/18935):
>
> Using the normal Delay node, you can use msg.delay to overwrite the preset value, and dynamically change it based on what you're doing. Is there an option to do something similar with the Rate Limit side of the Delay node? I am trying to set up a camera motion detection notification system, in which you would be able to dynamically change how often you get messages. So for example, I would have an input\_number slider in home assistant, from 0-60. And I would like to use that number to set a li…

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [9 April 2020 10:52 UTC](https://discourse.nodered.org/t/delay-node-feature-request/24488/4 "2020-04-09T10:52:57Z")

</div>

I did get something like that but a bit smaller.

But gee it was messy.

And I am still not 100% sure it did/would work.

I'll look now.

---

<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: [8 June 2020 11:06 UTC](https://discourse.nodered.org/t/delay-node-feature-request/24488/5 "2020-06-08T11:06:23Z")

</div>

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