# Door sensor light turn on after off. But if the light was on and open the door don't want to turn off

**URL:** <https://discourse.nodered.org/t/door-sensor-light-turn-on-after-off-but-if-the-light-was-on-and-open-the-door-dont-want-to-turn-off/32346>\
**Category:** General\
**Created:** [2 September 2020 12:34 UTC](https://discourse.nodered.org/t/door-sensor-light-turn-on-after-off-but-if-the-light-was-on-and-open-the-door-dont-want-to-turn-off/32346 "2020-09-02T12:34:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spider7611](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spider7611/32/20762_2.png) [@spider7611](https://discourse.nodered.org/u/spider7611)\
**Post date:** [2 September 2020 12:34 UTC](https://discourse.nodered.org/t/door-sensor-light-turn-on-after-off-but-if-the-light-was-on-and-open-the-door-dont-want-to-turn-off/32346/1 "2020-09-02T12:34:51Z")

</div>

Hi,

Please help, I don't know how to solve this:

So have a door sensor and a light.  
If the door opening the light is turned on and after 4 minutes turn off auto. If I open again before the 4 minutes expire the trigger extended delay and wait another 4 minutes It is ok.

 ![NodeRedDoorLight](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/7/f75fbf95e4087f671844002780b7bb3bb5486eea.jpeg)

But I want that if this light turned on manually and after open the door don't need to turn off the light after 4 minutes. So I need that check the light state and if it on for more than 4 minutes stop trigger to turn off.

---

<div class="post-metadata">

**Author:** ![wzbfyb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wzbfyb/32/26730_2.png) [@wzbfyb](https://discourse.nodered.org/u/wzbfyb)\
**Post date:** [2 September 2020 18:47 UTC](https://discourse.nodered.org/t/door-sensor-light-turn-on-after-off-but-if-the-light-was-on-and-open-the-door-dont-want-to-turn-off/32346/2 "2020-09-02T18:47:13Z")

</div>

Check the State Node, you can track the State of lights and sensors, makes it way easier to realize such szenarios

---

<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:** [1 November 2020 18:47 UTC](https://discourse.nodered.org/t/door-sensor-light-turn-on-after-off-but-if-the-light-was-on-and-open-the-door-dont-want-to-turn-off/32346/3 "2020-11-01T18:47:14Z")

</div>

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