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. In the form, Cron format is the cron expression (it becomes the address name) and Value is the number emitted at each tick (default 1). The form only accepts a number: to emit a text, a JSON object or a function, create the address first, then edit its Cron value cell in the address grid (it opens a code editor).
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 register at fixed times
A route always writes the value emitted by its source to its destination: routing a cron address directly to %M1 would write 1 into the register every 15 minutes. There is no route type read. To read a device on a schedule:
0,15,30,45 * * * * (value 1).$lastPoll.0,15,30,45 * * * * → $lastPoll (type value) with this source value function:function(value, sourceAdr, destAdr, options){
this.readValue('%M1', function(){}); // ask the Modbus driver to read the register now
return value;
}
Example: Send a daily status email
0 8 * * 1-5 (weekdays at 8 AM), then enter the text "Daily status report" in its Cron value cell.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 or 7 = Sunday — or sun … sat)
│ │ │ │ │
* * * * *
A 6-field expression is also accepted, with the seconds first: */10 * * * * * fires every 10 seconds.
| 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 |
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) |
@annually,@reboot,@every <duration>and 7-field expressions pass the name validation but are not supported by the scheduler: the address is created and never fires.
| 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.
To alternate between 0 and 1 at each tick:
function(previous) {
return previous ? 0 : 1;
}
When Value is empty, the address emits 1.
| Property | Value |
|---|---|
| Readable | No |
| Writable | No — a value written to a cron address is not delivered. Change the emitted value with the Cron value column (json.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 |
Every hour, all day |
Route both → an Internal address whose source value function reads %M1 (see the first example of section 1.3). A direct route to %M1 would write 1 into the register.
| Address | Value | Description |
|---|---|---|
0 8 * * 1-5 |
"Daily status report" |
Weekdays at 8:00 AM |
Enter the text in the Cron value cell of the address grid (the Value field of the insert form only accepts numbers).
Route → admin@company.com (SMTP address). In the Trigger of the route, untick refresh and gateway, so that the e-mail is not sent again when a gateway restarts or reconnects (see Routes, section 2.3).
Daily CSV files do not need the Cron driver: the CSV driver creates its files with its own File Cron parameter and sends them with the routes created by its Transfer CSV files button.
| 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 * * 0,6 |
20 |
Weekends 9 AM: comfort mode |
0 22 * * 0,6 |
16 |
Weekends 10 PM: eco mode |
Route all → %bac:local/analogValue:1 (BACnet setpoint).
cannot schedule <expression> - <reason> means the scheduler rejected the expression (see the field ranges in section 3.1). Each tick is logged as fired '<expression>' <value>.(previousValue || 0) + 1).