# Node for block between time

**URL:** <https://discourse.nodered.org/t/node-for-block-between-time/23531>\
**Category:** General\
**Created:** [23 March 2020 20:10 UTC](https://discourse.nodered.org/t/node-for-block-between-time/23531 "2020-03-23T20:10:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![corin.corvus](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@corin.corvus](https://discourse.nodered.org/u/corin.corvus)\
**Post date:** [23 March 2020 20:10 UTC](https://discourse.nodered.org/t/node-for-block-between-time/23531/1 "2020-03-23T20:10:21Z")

</div>

Hi,

i motion sensors for my Lightsystem Hue. In the floor and Kitchen are motion sensors. They react and switch on and off the light. I use Switches for my Rooms too. The Flow disable the motion sensors by click "on, dim up and down" and enable the Sensors by click "off".

Now i want to block this commands and disable the sensors between 7AM and 20PM for example, while the rooms are bright enough.

The Dimmer Switch sends "msg.payload.name = on, off, dim up, dim down  
I simply add a switch with this options and the second switch delete all and add a boolean false or true to msg.payload to the sensors.

May you have any Node or similar to solve this? Timecheck node is not good enough. other time nodes are only start a flow. i dont know how i can solve it with functions.

Screens:

 ![2020-03-23 21_05_24-Window](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/4/a4c5eaa863bfc32c0ae24d49cca1f166ef809416.jpeg)

---

<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:** [23 March 2020 20:23 UTC](https://discourse.nodered.org/t/node-for-block-between-time/23531/2 "2020-03-23T20:23:17Z")

</div>

Have a look at node-red-contrib-simple-gate, that can be used to block or allow through messages using a gating signal. You can use something like node-red-contrib-cron-plus (or a function node) to generate the pass/block signal.

---

<div class="post-metadata">

**Author:** ![corin.corvus](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@corin.corvus](https://discourse.nodered.org/u/corin.corvus)\
**Post date:** [23 March 2020 20:52 UTC](https://discourse.nodered.org/t/node-for-block-between-time/23531/3 "2020-03-23T20:52:50Z")

</div>

Hi,

thank you it works with crons and injects.!

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1e2ad99c3644b7f4d7085f53cff65d84450d729a.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:** [23 March 2020 21:26 UTC](https://discourse.nodered.org/t/node-for-block-between-time/23531/4 "2020-03-23T21:26:58Z")

</div>

If you put a gate before the Switch node I think you would only need one.

---

<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:** [6 April 2020 21:27 UTC](https://discourse.nodered.org/t/node-for-block-between-time/23531/5 "2020-04-06T21:27:02Z")

</div>

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