# Set a command to delay notification

**URL:** <https://discourse.nodered.org/t/set-a-command-to-delay-notification/72448>\
**Category:** General\
**Created:** [20 December 2022 07:44 UTC](https://discourse.nodered.org/t/set-a-command-to-delay-notification/72448 "2022-12-20T07:44:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![HHUBS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hhubs/32/72904_2.png) [@HHUBS](https://discourse.nodered.org/u/HHUBS)\
**Post date:** [20 December 2022 07:44 UTC](https://discourse.nodered.org/t/set-a-command-to-delay-notification/72448/1 "2022-12-20T07:44:39Z")

</div>

I'm new to node red and I'm setting up notifications on of camera when someone is detected. This is the setup below:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/0/700fbceed2614fbcc7bfeb8998f9f83d8b830716.png)

This is the notification (ignore the pic and message, it's just an inject node)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/e/5ecc48244d7c3e7898b81a2d4d6194c7be735509.jpeg)

The setup is by default delayed by 2 min per notification. However, I sometimes need to set the notification for 10 min or ignore for whole day. How can I do that?

I need to somehow "switch" the output to the 10minute delay node but I'm getting a no message error.

---

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [20 December 2022 08:05 UTC](https://discourse.nodered.org/t/set-a-command-to-delay-notification/72448/2 "2022-12-20T08:05:15Z")

</div>

The "switch" (!) node is here for that. Based on conditions, you can send the message to different outputs.  
What is/are the conditions to use 2 min. / 10 min. / day for the delay?  
Describe the conditions in the switch node and done.

---

<div class="post-metadata">

**Author:** ![HHUBS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hhubs/32/72904_2.png) [@HHUBS](https://discourse.nodered.org/u/HHUBS)\
**Post date:** [20 December 2022 12:50 UTC](https://discourse.nodered.org/t/set-a-command-to-delay-notification/72448/3 "2022-12-20T12:50:15Z")

</div>

There is no condition. It will be a "command". When I click the "Delay for 10 min" in the inline keyboard, it should "switch" to the 10min delay node like this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/a/9a4e5d1f79204d89f018eff4fd7f788969d25eda.png)

I don't know how to work on this with the callback query.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/4/b4abfb73a96c2e8e12913ea9ec3f6bcea8475227.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [20 December 2022 13:04 UTC](https://discourse.nodered.org/t/set-a-command-to-delay-notification/72448/4 "2022-12-20T13:04:15Z")

</div>

Could you have 3 keyboard buttons (no delay, 10mins, 24hr). You could then convert what ever button is pressed to a time delay in milliseconds and set it to msg.delay. Then before the notification node have a trigger node which delay is set by msg.delay. Or similar

---

<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:** [18 February 2023 13:04 UTC](https://discourse.nodered.org/t/set-a-command-to-delay-notification/72448/5 "2023-02-18T13:04:36Z")

</div>

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