# Turn of a hue light after x minutes

**URL:** <https://discourse.nodered.org/t/turn-of-a-hue-light-after-x-minutes/16281>\
**Category:** General\
**Created:** [3 October 2019 20:52 UTC](https://discourse.nodered.org/t/turn-of-a-hue-light-after-x-minutes/16281 "2019-10-03T20:52:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![JePeSWE](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@JePeSWE](https://discourse.nodered.org/u/JePeSWE)\
**Post date:** [3 October 2019 20:52 UTC](https://discourse.nodered.org/t/turn-of-a-hue-light-after-x-minutes/16281/1 "2019-10-03T20:52:11Z")

</div>

I want to turn of a hue lamp after x minutes using a hue dimmer switch who triggers the lamp on in the first place.  
/Jerry

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [3 October 2019 20:56 UTC](https://discourse.nodered.org/t/turn-of-a-hue-light-after-x-minutes/16281/2 "2019-10-03T20:56:23Z")

</div>

step 1 would be to see if you can detect the switch in NodeRED. Have you looked on [flows.nodered.org](http://flows.nodered.org) to see if there are any nodes that work with the hue switch?

---

<div class="post-metadata">

**Author:** ![JePeSWE](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@JePeSWE](https://discourse.nodered.org/u/JePeSWE)\
**Post date:** [3 October 2019 20:58 UTC](https://discourse.nodered.org/t/turn-of-a-hue-light-after-x-minutes/16281/3 "2019-10-03T20:58:34Z")

</div>

I have this installed:  
node-red-contrib-node-hue  
node-red-contrib-huemagic

---

<div class="post-metadata">

**Author:** ![JePeSWE](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@JePeSWE](https://discourse.nodered.org/u/JePeSWE)\
**Post date:** [3 October 2019 20:59 UTC](https://discourse.nodered.org/t/turn-of-a-hue-light-after-x-minutes/16281/4 "2019-10-03T20:59:13Z")

</div>

The dimmer switch is detected in node-red already

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [3 October 2019 21:01 UTC](https://discourse.nodered.org/t/turn-of-a-hue-light-after-x-minutes/16281/5 "2019-10-03T21:01:04Z")

</div>

then take a look at the delay node  
and the change node to set the payload to the correct “off” message you need to send

---

<div class="post-metadata">

**Author:** ![JePeSWE](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@JePeSWE](https://discourse.nodered.org/u/JePeSWE)\
**Post date:** [3 October 2019 21:06 UTC](https://discourse.nodered.org/t/turn-of-a-hue-light-after-x-minutes/16281/6 "2019-10-03T21:06:38Z")

</div>

Yes, but how may i build the flow, with what kind of nodes to get this to work?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [3 October 2019 21:16 UTC](https://discourse.nodered.org/t/turn-of-a-hue-light-after-x-minutes/16281/7 "2019-10-03T21:16:20Z")

</div>

delay

change

what ever node you can use to control your lights

---

<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 October 2019 06:20 UTC](https://discourse.nodered.org/t/turn-of-a-hue-light-after-x-minutes/16281/8 "2019-10-04T06:20:30Z")

</div>

Alternatively the trigger node may be useful, you can get it to send a message (or no message) immediately, then after a time send another message.
