Appearance
Scheduler
The scheduler runs timed jobs against one or more devices: set shared attributes, send a command, or run a Started rule engine.
When to use
- Daily pump / relay on-off windows
- Periodic setpoint writes
- One-shot deferred commands
- Interval heartbeats / ping commands
- Fire a rule-engine chain on a clock (
scheduledmessage)
Schedule types
| Type | Config |
|---|---|
| once | runAt timestamp (must be future when created/started) |
| cron | 5-field cron + timezone (default tenant zone, often Asia/Kolkata) |
| interval | Every N seconds (minimum 60) |
Actions
| Action | Behavior |
|---|---|
set_shared_attributes | Writes SHARED scope (reboot-safe control path) |
send_command | Device command / RPC payload |
run_engine | Runs one Started rule engine per device (engineId in payload; Message in must accept scheduled) |
UI
- Scheduler —
/scheduler - Create / edit in a modal (no separate
/scheduler/newroute) - Activate / Pause; Completed one-shots stay Completed
- Preview next run while editing
- Last error on the list; Runs drawer for recent history
- Report email schedules stay under Reports
Ops
- Runner ticks every 15s
- Multi-instance safe (
FOR UPDATE SKIP LOCKED) - Kill switch:
SCHEDULER_ENABLED=false - Migrations:
0025_scheduled_jobs.sql,0070_scheduler_run_engine.sql(addsrun_engineto the action CHECK)
