# Delay message until a specific time

**URL:** <https://discourse.nodered.org/t/delay-message-until-a-specific-time/13667>\
**Category:** General\
**Created:** [24 July 2019 19:55 UTC](https://discourse.nodered.org/t/delay-message-until-a-specific-time/13667 "2019-07-24T19:55:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pendlet](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pendlet/32/10397_2.png) [@pendlet](https://discourse.nodered.org/u/pendlet)\
**Post date:** [24 July 2019 19:55 UTC](https://discourse.nodered.org/t/delay-message-until-a-specific-time/13667/1 "2019-07-24T19:55:02Z")

</div>

I am trying to delay a message in my sequence until a certain time of day. I thought i would be a bale to use the delay node to have it hold the message payload it receives until a certain time is reached, but i don't see an option to put in a specific time. Is this the right node? So for example don't send the message any further until 8 am and when 8 am happens the message is then sent on to the next node.

Thanks  
Tim

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [24 July 2019 20:02 UTC](https://discourse.nodered.org/t/delay-message-until-a-specific-time/13667/2 "2019-07-24T20:02:38Z")

</div>

You could probably achieve this using a join node set up without a count or timeout defined. Have an inject node set to fire off a message with the msg.complete property set to true and the join node will fire off a merged payload of all it's received since the last msg.complete. If you want discrete messages, you could probably merge the messages into an array in the join node, but then pass the resulting array through a split node.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [24 July 2019 20:19 UTC](https://discourse.nodered.org/t/delay-message-until-a-specific-time/13667/3 "2019-07-24T20:19:26Z")

</div>

Another way to think about the `delaying until specific time` problem

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/aef24f5b2a8680339b709f19aec3acf7599b3b3f.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:** [24 July 2019 20:41 UTC](https://discourse.nodered.org/t/delay-message-until-a-specific-time/13667/4 "2019-07-24T20:41:44Z")

</div>

You could possibly use node-red-contrib-queue-gate with an inject node and a trigger node to open the gate at the appropriate time and close it again a short while later. Then any messages queued between openings will be released at that time.

---

<div class="post-metadata">

**Author:** ![pendlet](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pendlet/32/10397_2.png) [@pendlet](https://discourse.nodered.org/u/pendlet)\
**Post date:** [24 July 2019 22:31 UTC](https://discourse.nodered.org/t/delay-message-until-a-specific-time/13667/5 "2019-07-24T22:31:04Z")

</div>

Thanks for the suggestions. I will look in to the queue gate node and see what i can do. I am really surprised that the delay node was not able to do what i wanted and think it should be something they should look at adding. Not sure if that is feasible or not but i think it would be useful.

Thanks  
Tim

---

<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:** [24 July 2019 23:16 UTC](https://discourse.nodered.org/t/delay-message-until-a-specific-time/13667/6 "2019-07-24T23:16:57Z")

</div>

You can also check the other side: trigger the message at a specific time (if feasible).

---

<div class="post-metadata">

**Author:** ![pendlet](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pendlet/32/10397_2.png) [@pendlet](https://discourse.nodered.org/u/pendlet)\
**Post date:** [25 July 2019 00:58 UTC](https://discourse.nodered.org/t/delay-message-until-a-specific-time/13667/7 "2019-07-25T00:58:28Z")

</div>

The trigger is coming from a home assistant event node that lets me know when certain appliances are finished. (Washer, Dry, Dishwasher etc..) Its setup to let me know over my google minis when it is completed but only between the hours of 0700 and 2230. What i want to do is if it finishes outside those hours have it wait till 0800 and then announce the messages. I also looked at wait until node but it also does not have a time feature but would be another node i could see having this feature.

---

<div class="post-metadata">

**Author:** ![pendlet](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pendlet/32/10397_2.png) [@pendlet](https://discourse.nodered.org/u/pendlet)\
**Post date:** [25 July 2019 02:00 UTC](https://discourse.nodered.org/t/delay-message-until-a-specific-time/13667/8 "2019-07-25T02:00:52Z")

</div>

So i figured this out. It is the wait until node that i needed. I had to add a sensor in home assistant set to the current time and then i was able to compare that state (time) to the time i wanted it to pass data. Now it works like i wanted.

[{"id":"cd5efc38.c7345","type":"time-range-switch","z":"42d0008f.7b00a","name":"","lat":"38.3007","lon":"-76.50496","startTime":"07:00","endTime":"22:30","startOffset":0,"endOffset":0,"x":379,"y":123,"wires":[,["1e038743.170c19","85ae0be0.a7aaa8"]]}]

 ![wait-until](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/ffad5cc759912015b4b0aa974da976bfc3ad4fa8.jpeg)

Thanks again.
