The Cron driver provides scheduled task execution for the Weble universal gateway. It uses the standard cron expression format to define time-based schedules. At each scheduled time, the cron address emits a configurable value that can trigger routes — enabling time-based automation without any external system.
The Cron driver is essential for:
The key concept is simple: the address name is the cron expression, and at each scheduled tick, the address emits its configured value. This value can then be routed to any destination address on any protocol.
Create a new gateway and select the Cron driver. The configuration is minimal — only a Name and optional Description.
Insert a new address. The address name is the cron expression that defines the schedule. The Cron value field defines what value is emitted at each tick (default: 1).
For example, to emit the value 1 every minute:
* * * * *1To emit the value 42 every day at 8:00 AM:
0 8 * * *42The real power of the Cron driver comes from combining it with routes. Create a route with the cron address as the source and any other address as the destination.
Example: Read a Modbus sensor every 15 minutes
0,15,30,45 * * * * with value 1.0,15,30,45 * * * * → %M1 (Modbus register).Example: Send a daily status email
0 8 * * 1-5 (weekdays at 8 AM) with value "Daily status report".0 8 * * 1-5 → admin@company.com (SMTP address).Example: Switch HVAC mode between day and night
0 7 * * 1-5 with value 21 (day setpoint).0 19 * * 1-5 with value 18 (night setpoint).%bac:local/analogValue:1.
| Label | JSON Key | Description |
|---|---|---|
| Name | name | A descriptive name for this Cron gateway instance. |
| Cluster ID | cluster | Cluster identifier (integer). Use 0 for single-gateway setups. |
| Description | description | Optional description. |
{
}
The Cron gateway has no protocol-specific configuration — all the logic is in the addresses.
The address name is the cron expression. The standard cron format uses 5 fields:
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * *
| Character | Meaning | Example |
|---|---|---|
* |
Every value | * * * * * = every minute |
, |
Multiple values | 0,30 * * * * = at minute 0 and 30 |
- |
Range | 0 9-17 * * * = every hour from 9 to 17 |
/ |
Step | */5 * * * * = every 5 minutes |
| Expression | Equivalent | Description |
|---|---|---|
@yearly / @annually |
0 0 1 1 * |
Once a year (January 1st, midnight) |
@monthly |
0 0 1 * * |
Once a month (1st day, midnight) |
@weekly |
0 0 * * 0 |
Once a week (Sunday, midnight) |
@daily |
0 0 * * * |
Once a day (midnight) |
@hourly |
0 * * * * |
Once an hour (at minute 0) |
| Cron expression | Schedule |
|---|---|
* * * * * |
Every minute |
*/5 * * * * |
Every 5 minutes |
*/15 * * * * |
Every 15 minutes |
0 * * * * |
Every hour (at minute 0) |
0 8 * * * |
Every day at 8:00 AM |
0 0 * * * |
Every day at midnight |
0 8 * * 1-5 |
Weekdays at 8:00 AM |
0 8,12,18 * * * |
Every day at 8 AM, noon, and 6 PM |
30 6 * * 1 |
Every Monday at 6:30 AM |
0 0 1 * * |
First day of every month at midnight |
0 0 1 1 * |
January 1st at midnight |
| Label | JSON Key | Description |
|---|---|---|
| Cron format | name | The cron expression defining the schedule (see section 3.1). |
| Value | value | The value emitted at each scheduled tick. Default: 1. Can be a number, a string, or a JSON object. Can also be a JavaScript function that receives the previous value and returns the new value. |
| Description | description | Optional description. |
The Value field is also editable directly in the grid column Cron value.
The Value field can be set to a JavaScript function for dynamic behavior. The function receives the previous value as argument and returns the new value:
function(previousValue) {
return (previousValue || 0) + 1;
}
This example creates an incrementing counter that increases by 1 at each cron tick.
| Property | Value |
|---|---|
| Readable | No |
| Writable | Yes (writing changes the emitted value) |
| Routable | Yes |
| Loggable | Yes |
Read energy meters every 15 minutes during business hours, and once per hour at night:
| Address | Value | Description |
|---|---|---|
*/15 8-18 * * 1-5 |
1 |
Weekdays 8-18h: every 15 min |
0 * * * * |
1 |
All other hours: every hour |
Route both → %M1 (type: read).
| Address | Value | Description |
|---|---|---|
0 0 * * * |
1 |
Every day at midnight |
Route → $triggerExport (Internal address) → route to CSV driver export trigger.
| Address | Value | Description |
|---|---|---|
0 7 * * 1-5 |
21 |
Weekdays 7 AM: comfort mode |
0 19 * * 1-5 |
18 |
Weekdays 7 PM: eco mode |
0 9 * * 6-7 |
20 |
Weekends 9 AM: comfort mode |
0 22 * * 6-7 |
16 |
Weekends 10 PM: eco mode |
Route all → %bac:local/analogValue:1 (BACnet setpoint).
| Property | Value |
|---|---|
| Address regex | Standard cron (5-7 fields), @yearly, @monthly, @weekly, @daily, @hourly, @reboot, or @every <duration> |
| Readable | No |
| Writable | Yes (the address name must match the cron regex) |
| Events | Emits newValue on each cron tick with the configured json.value |
The json.value field can be a JavaScript function receiving the previous value:
// Incrementing counter
function(previousValue) {
return (previousValue || 0) + 1;
}
// Toggle between 0 and 1
function(prev) {
return prev ? 0 : 1;
}
If json.value is undefined or null, the emitted value defaults to 1.
driverMethods.read — the driver is purely event-driven