# Time scheduled light sequence

**URL:** <https://discourse.nodered.org/t/time-scheduled-light-sequence/9606>\
**Category:** General\
**Created:** [30 March 2019 11:16 UTC](https://discourse.nodered.org/t/time-scheduled-light-sequence/9606 "2019-03-30T11:16:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Ben](https://discourse.nodered.org/u/Ben)\
**Post date:** [30 March 2019 11:16 UTC](https://discourse.nodered.org/t/time-scheduled-light-sequence/9606/1 "2019-03-30T11:16:46Z")

</div>

![Node-RED%20light%20sequence](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3fe0efe085012c7beb634ce922594eb9f15d7b68.jpeg)

Hello, im still pretty new to Node-RED and hoped maybe someone with a bit more experience could help me with a problem im trying to solve.

I have made a light sequence combined with a audio clip. Timestamp is set to go in a continuing loop and once the sequence is finished it restarts, this all works out fine.

My problem is that I want to combine the light and sound sequence with for example the Big Timer or Timeswitch nodes, but I cant figure out how. My goal is to have the sequence start at 09:00 and stop at 18:00 every day. Anyone got an idea about how to set this up?

---

<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:** [30 March 2019 11:23 UTC](https://discourse.nodered.org/t/time-scheduled-light-sequence/9606/2 "2019-03-30T11:23:31Z")

</div>

Take a look at this flow in the cookbook  
[https://cookbook.nodered.org/basic/route-on-context](https://cookbook.nodered.org/basic/route-on-context)

set a value if it’s within the time you want to play (eg true / false) and then use a switch that only passes the message on if your context value is true

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [30 March 2019 15:18 UTC](https://discourse.nodered.org/t/time-scheduled-light-sequence/9606/3 "2019-03-30T15:18:12Z")

</div>

@Ben, you could also take a look at `node-red-contrib-time-range-switch`. I think it does what you want.

---

<div class="post-metadata">

**Author:** ![Ben](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Ben](https://discourse.nodered.org/u/Ben)\
**Post date:** [3 April 2019 15:25 UTC](https://discourse.nodered.org/t/time-scheduled-light-sequence/9606/4 "2019-04-03T15:25:59Z")

</div>

Thanks for the feedback and quick replies. Tried both solutions and now it works like i wanted it to!
