# Beginner: creating and using a time slot "table"

**URL:** <https://discourse.nodered.org/t/beginner-creating-and-using-a-time-slot-table/89420>\
**Category:** General\
**Created:** [11 July 2024 09:40 UTC](https://discourse.nodered.org/t/beginner-creating-and-using-a-time-slot-table/89420 "2024-07-11T09:40:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rthorntn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rthorntn/32/88534_2.png) [@rthorntn](https://discourse.nodered.org/u/rthorntn)\
**Post date:** [11 July 2024 09:40 UTC](https://discourse.nodered.org/t/beginner-creating-and-using-a-time-slot-table/89420/1 "2024-07-11T09:40:52Z")

</div>

Hi,

Please help me find a solution, I'd like to inject a (5 minute) slot requirement and time period (maximum of 24 hours) to node-red say:

22 slots between 21:00 and 06:00

And have that converted into 5 minute time slots so 108 slots:

Slot 1 - 21:00:00 - 21:04:59  
Slot 2 - 21:05:00 - 21:09:59  
....  
Slot 108 - tomorrow 05:55:00 - 05:59:59

Then a function chooses 22 of the 108 slots, so basically a slot every 25 minutes:

Slot 1  
Slot 6  
Slot 11  
...  
Then when a new slot starts send a start message and when it ends a stop message.

When a start message is received, wait 20 seconds then check a condition and if it fails try the next 5 minute slot:

Slot 1 (21:00:00 - 21:04:59) check at 21:00:20 it fails so wait and then try slot 2 (21:05:20) it passes, so send an immediate 'on' message and a subsequent 'off' message at 21:09:59. Next check slot 6 (21:25:20)... rinse... repeat...

Thanks for taking a look.

Cheers.  
Richard

---

<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:** [9 October 2024 09:41 UTC](https://discourse.nodered.org/t/beginner-creating-and-using-a-time-slot-table/89420/2 "2024-10-09T09:41:14Z")

</div>

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