# Disable when a certain message arrives

**URL:** <https://discourse.nodered.org/t/disable-when-a-certain-message-arrives/17501>\
**Category:** General\
**Created:** [4 November 2019 20:23 UTC](https://discourse.nodered.org/t/disable-when-a-certain-message-arrives/17501 "2019-11-04T20:23:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![4integration](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/4integration/32/68504_2.png) [@4integration](https://discourse.nodered.org/u/4integration)\
**Post date:** [4 November 2019 20:23 UTC](https://discourse.nodered.org/t/disable-when-a-certain-message-arrives/17501/1 "2019-11-04T20:23:41Z")

</div>

HI,

I have a Node-RED flow deployed looking like below

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1216b737fd66f25a83c4f2ad89b7cfb23354d25e.png)

On the HTTP input node I receives triggers from my video surveillance system (motion detection) and to notify activity via pushover or email depending on the query parameter received.  
In some cases, like when outdoor lights are switched on/off this triggers the video to detect a motion.

I control the lights via home automation and I would like to send a HTTP request to this node before the lights turns ON/OFF and ignore the other HTTP requests for e.g. 10 sec and hence avoid the false notifications.

How can this be done with Node-RED?

/ Joacim

---

<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:** [4 November 2019 22:03 UTC](https://discourse.nodered.org/t/disable-when-a-certain-message-arrives/17501/2 "2019-11-04T22:03:26Z")

</div>

Have a look at node-red-contrib-simple-gate which can be used to block messages, then use a Trigger node to send the block message to the gate, then the release message a defined time later.

---

<div class="post-metadata">

**Author:** ![4integration](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/4integration/32/68504_2.png) [@4integration](https://discourse.nodered.org/u/4integration)\
**Post date:** [6 November 2019 19:29 UTC](https://discourse.nodered.org/t/disable-when-a-certain-message-arrives/17501/3 "2019-11-06T19:29:16Z")

</div>

Thanks @Colin will check that out

---

<div class="post-metadata">

**Author:** ![4integration](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/4integration/32/68504_2.png) [@4integration](https://discourse.nodered.org/u/4integration)\
**Post date:** [20 November 2019 17:02 UTC](https://discourse.nodered.org/t/disable-when-a-certain-message-arrives/17501/4 "2019-11-20T17:02:58Z")

</div>

I have tried out the node-red-contrib-simple-gate and can close the gate for 10 sec via three ways:

1. A http request to "Stop Video Notification"
2. A dashboard button
3. After an video event occured  
The gate starts after 10 sec via trigger nodes.

The flow looks like:

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

However I think the switch isn't working all the time (calling all outputs that fulfills the statement.  
The switch node has the following statements:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/73a2bbe0162d0886026a9ef15675d6f43f45aabc.png)

Do you see any "mistakes" in my thinking of the flow?

(a few extra debug nodes now)

---

<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:** [20 November 2019 17:12 UTC](https://discourse.nodered.org/t/disable-when-a-certain-message-arrives/17501/5 "2019-11-20T17:12:21Z")

</div>

Maybe the values in the switch should be numerical and not strings?

---

<div class="post-metadata">

**Author:** ![4integration](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/4integration/32/68504_2.png) [@4integration](https://discourse.nodered.org/u/4integration)\
**Post date:** [20 November 2019 19:07 UTC](https://discourse.nodered.org/t/disable-when-a-certain-message-arrives/17501/6 "2019-11-20T19:07:59Z")

</div>

Thanks, I have changed to that and will see if that works better.  
/ Joacim - a newbie on Node-RED
