Timer and scheduling parts let you add time-based logic to your Configurator flows without writing code. These are software-only parts — no hardware wiring required. They run inside Node-RED on your Raspberry Pi and control when and how often signals pass between sensors, controllers, and actuators.
LoopString includes six timer parts, organized into three categories: parts that delay or throttle existing signals, parts that generate new signals on a schedule, and parts that filter signals based on time of day.
Part Overview
Part | Category | Self-Triggered | Input | Output | Description |
|---|---|---|---|---|---|
Delay Timer | Timer | No | Any message | Same message (delayed) | Delays passthrough by configurable duration |
Rate Limiter | Timer | No | Any message | Same message (throttled) | Limits throughput to N msgs per interval |
Interval Timer | Timer | Yes | — | Boolean true | Fires at fixed interval (clock source) |
Countdown Timer | Timer | No | Start/stop/reset | Boolean true at completion | One-shot countdown with control commands |
Cron Scheduler | Timer | Yes | — | Boolean true | Fires on cron schedule (e.g., 6 AM daily) |
Time Range Gate | Timer | No | Any message | Pass or block | Passes messages only within time window |
Self-triggered means the part generates its own messages and does not need an upstream connection. The Interval Timer and Cron Scheduler start firing automatically when the flow is deployed.
Delay Timer
Delays an incoming message by a configurable duration before passing it through unchanged. Uses the built-in Node-RED delay node.
When to Use
- Stagger relay activations so multiple devices do not start simultaneously and cause a current spike.
- Add a cool-down period after a sensor threshold crossing before triggering an alert.
- Delay an actuator command to give a system time to stabilize.
Configuration
Delay Duration — How long to hold each message before forwarding. Default is 5000 ms (5 seconds). Minimum is 100 ms.
Display Units — Whether the duration is displayed in seconds or minutes. This only affects the display in the Configurator UI; the underlying value is always stored in milliseconds.
Wiring
- Add a Delay Timer to your room in the flow editor.
- Wire the output of any upstream part (sensor, controller, or another timer) to the delay input.
- Wire the delay output to the downstream part (actuator, controller, or logger).
- Set the delay duration.
- Deploy.
The delay passes through whatever signal type it receives — if a sensor sends a number, the output is the same number, just delayed.
Rate Limiter
Limits message throughput to a maximum rate. Messages arriving faster than the limit are either dropped or queued. Uses the built-in Node-RED delay node in rate-limit mode.
When to Use
- Throttle a fast sensor (reading every second) before writing to Firebase to reduce costs.
- Prevent actuator chatter from a noisy controller output.
- Smooth bursty event sources like motion sensors or limit switches.
Configuration
Rate — Maximum messages allowed per time unit. Default is 1.
Per — Time unit: Second, Minute, or Hour.
Drop Excess Messages — When enabled (default), messages exceeding the rate are silently discarded. When disabled, excess messages are queued and delivered at the configured rate. Dropping is usually preferred for sensor data; queuing is better for actuator commands where every command matters.
Wiring
Same pattern as the Delay Timer — wire it inline between any two parts. The rate limiter passes through the original signal type unchanged.
Interval Timer
Fires a boolean true message at a fixed interval. This is a signal source — it generates its own messages and does not need an upstream connection.
When to Use
- Trigger a relay to pulse on and off at regular intervals (irrigation cycling).
- Create a heartbeat signal that periodically activates a downstream check.
- Drive a sensor poll cycle for on-demand sensors.
Configuration
Interval — Time between each trigger, in seconds. Default is 60 seconds. Minimum is 1 second.
Wiring
- Add an Interval Timer to your room.
- Wire the output to any downstream part — typically an actuator or controller.
- Set the interval.
- Deploy.
The timer starts firing immediately after deploy. There is no start/stop control — it runs continuously as long as the flow is active.
Countdown Timer
Starts a countdown when triggered and emits true when the countdown completes. Supports start, stop, and reset via input messages. Requires the node-red-contrib-countdown package, which is automatically installed on your Pi during deploy.
When to Use
- Hold a relay open for exactly 5 minutes (irrigation run time), then close it.
- Delay a shutdown sequence by a fixed duration after a trigger event.
- Implement a timed soak or dwell step in a multi-stage process.
Configuration
Duration — Countdown duration in seconds. Default is 300 (5 minutes). Minimum is 1 second.
Display Units — Seconds, Minutes, or Hours. Controls how the duration is displayed in the UI.
Wiring
- Add a Countdown Timer to your room.
- Wire a boolean signal (from a sensor, controller, or another timer) to the countdown input. Sending
truestarts the countdown; sendingfalsestops it. - Wire the countdown output to the downstream actuator or controller. The output emits
truewhen the countdown expires. - Deploy.
Start/Stop/Reset Behavior
- Start: Send
trueto the input. The countdown begins from the configured duration. - Stop: Send
falseto the input. The countdown pauses. - Reset: Starting a new countdown while one is already running restarts from the full duration.
Cron Scheduler
Fires a boolean true message on a cron schedule. Uses the built-in Node-RED inject node with crontab support. This is a signal source — no upstream connection needed.
When to Use
- Turn grow lights on at 6 AM and off at 10 PM (photoperiod schedule). Use two Cron Schedulers — one for on, one for off — wired to the same relay.
- Run a daily irrigation cycle at a specific time.
- Trigger a weekly calibration check or maintenance reminder.
Configuration
Cron Expression — A standard 5-field cron expression: minute hour day-of-month month day-of-week. Default is 0 6 * * * (6:00 AM daily).
Quick Preset (reference) — A dropdown with common patterns for reference. The preset does not automatically fill the cron expression — use it as a guide and type the expression manually.
Cron Expression Guide
Expression | Schedule | Example Use |
|---|---|---|
* * * * * | Every minute | Testing only |
*/15 * * * * | Every 15 minutes | Frequent sensor checks |
0 * * * * | Every hour | Hourly data rollups |
0 6 * * * | Daily at 6:00 AM | Morning grow light on |
0 22 * * * | Daily at 10:00 PM | Evening grow light off |
0 8 * * 1-5 | Weekdays at 8:00 AM | Business-hours automation |
0 */2 * * * | Every 2 hours | Periodic irrigation |
0 0 1 * * | 1st of month at midnight | Monthly maintenance reminder |
The five fields are: minute (0–59), hour (0–23), day of month (1–31), month (1–12), day of week (0–6, where 0 is Sunday).
Use * for "every", */N for "every N", and commas for multiple values.
Wiring
- Add a Cron Scheduler to your room.
- Wire the output to a downstream actuator, controller, or time-range gate.
- Enter your cron expression.
- Deploy.
The schedule uses the Pi's local system clock. Make sure your Pi's timezone is set correctly.
Time Range Gate
Passes or blocks incoming messages based on the current time of day. Messages arriving within the configured window pass through; messages outside the window are silently dropped. Uses a function node — no extra packages needed.
When to Use
- Only allow grow-light relay commands during the photoperiod window (6 AM to 10 PM).
- Suppress alert notifications during nighttime hours.
- Restrict irrigation to business hours.
Configuration
Start Hour — Hour of day the gate opens (0–23). Default is 6 (6 AM).
Start Minute — Minute past the hour. Default is 0.
End Hour — Hour of day the gate closes (0–23). Default is 18 (6 PM).
End Minute — Minute past the hour. Default is 0.
The gate supports overnight ranges. If the start time is later than the end time (e.g., start 22:00, end 06:00), the gate passes messages from 10 PM through midnight to 6 AM. This is useful for night-only cooling or overnight irrigation.
Wiring
- Add a Time Range Gate to your room.
- Wire an upstream signal (boolean from a controller, timer, or sensor) to the gate input.
- Wire the gate output to the downstream actuator or controller.
- Set the time window.
- Deploy.
Messages arriving outside the window are silently dropped — the downstream part simply receives nothing.
Use Cases
Grow Light Photoperiod (18/6 Schedule)
A cannabis grow tent needs lights on for 18 hours and off for 6 hours daily.
Parts used: Cron Scheduler (on at 6 AM), Cron Scheduler (off at midnight), relay actuator for the grow light.
Wire the "on" scheduler to the relay with a true payload. Wire the "off" scheduler to the same relay — or use a single Cron Scheduler at 6 AM wired through a Time Range Gate (6:00–0:00) to the relay.
Irrigation Cycling (15 Minutes Every 4 Hours)
A greenhouse runs drip irrigation for 15 minutes every 4 hours during daylight.
Parts used: Interval Timer (every 14400 seconds = 4 hours), Countdown Timer (900 seconds = 15 minutes), Time Range Gate (6 AM–8 PM), solenoid valve actuator.
Wire: Interval Timer → Time Range Gate → Countdown Timer → Solenoid Valve. The interval fires every 4 hours; the time gate blocks nighttime triggers; the countdown holds the valve open for 15 minutes, then closes it.
Staggered Relay Start
A brewery has three heating elements on a 16-relay HAT. Starting all three simultaneously trips the circuit breaker.
Parts used: Hysteresis controller (fires when temp drops), Delay Timer (0 ms for relay 1, 5000 ms for relay 2, 10000 ms for relay 3).
Wire the controller output to three Delay Timers with staggered durations. Each timer feeds one relay channel. The elements start 5 seconds apart.
Troubleshooting
The cron scheduler is not firing at the expected time
The cron schedule uses the Raspberry Pi's system clock and timezone. If the Pi's timezone is set to UTC but you expect local time, the schedule will be offset. Check with timedatectl on the Pi and set the correct timezone with sudo timedatectl set-timezone Your/Timezone.
The time range gate blocks everything
Verify that the start and end times define the window you intend. The gate passes messages when the current time is within the range. If Start Hour is 18 and End Hour is 6, the gate passes messages from 6 PM to 6 AM (overnight). If you intended 6 AM to 6 PM, swap the values.
The countdown timer does not restart
The countdown requires a true boolean input to start. If the upstream part sends a number or an object instead of a boolean, the countdown will not trigger. Add a function node to convert the signal: msg.payload = true; return msg;
The delay timer is adding too much latency
Reduce the delay duration. For sensor data pipelines, consider using a Rate Limiter instead — it controls throughput without adding latency to every message.
Known Issues and Limitations
No persistent state across Pi reboots — All timer states (countdown progress, interval timing) reset when the Pi restarts or the flow is redeployed. Countdowns in progress will restart from the beginning.
Cron expression is not auto-populated from presets — The Quick Preset dropdown is a reference guide only. You must manually type the cron expression. This is a known UX limitation.
Time Range Gate uses Pi local time — The gate evaluates against the Pi's system clock. If the Pi clock drifts or the timezone changes, the gate window shifts accordingly.
Countdown timer requires node-red-contrib-countdown — This package is automatically installed during deploy, but if the Pi has no internet access during deploy, the installation will fail. Pre-install the package via SSH if deploying to an offline Pi.
Related Documentation
For scheduled automation rules configured from the dashboard (without the Configurator), see Scheduled Automation.
For wiring timer outputs to relays and actuators, see Actuators.
For PID and hysteresis controllers that timer parts commonly feed into, see PID Controllers and Hysteresis Controllers.