Scheduler
The ThingsBoard Scheduler automates periodic tasks on the Edge, like telemetry and attribute updates, RPC commands, and rule chain triggers. It runs locally, so scheduled tasks keep running even when the Edge has no connection to the server.
You can create scheduler events on the server and assign them to the Edge, or, on Edge 4.3 and later, create them directly on the Edge. Both run locally on the Edge.
Configure scheduler events
Section titled “Configure scheduler events”-
On the server, go to Platform > Scheduler.
-
Click Add scheduler event. Enter a Name and, on the Configuration tab, select the Event type, for example Send RPC Request to Device or Update Attributes, and fill in its fields. On the Schedule tab, set the Start time and, if needed, Repeat. Click Create. For all fields, see the Scheduler Event dialog documentation.
-
Go to Edge management > Edges and click the Edge. On the Details tab, click Manage scheduler events, then click Assign to edge (+), select the event, and click Assign.
-
On the Edge, go to Platform > Scheduler to confirm that the event was received. The list shows its Name and Type.
To remove an event from the Edge, open the same list on the server and click Unassign from edge in the row of the event.
To create an event on the Edge instead, go to Platform > Scheduler on the Edge and click Add scheduler event. The dialog is the same. The Edge pushes the event to the server, where it appears under Platform > Scheduler and is assigned to this Edge.
Use case: Smart Irrigation on ThingsBoard Edge
Section titled “Use case: Smart Irrigation on ThingsBoard Edge”The Smart Irrigation solution template shows the Scheduler in a remote deployment. It irrigates fields based on soil moisture readings and fixed schedules, with ThingsBoard Edge running locally so that irrigation continues during network outages.
The solution:
- Irrigates fields twice a day at fixed times.
- Monitors soil moisture, daily water consumption, and irrigation duration in real time.
- Runs locally on ThingsBoard Edge, independent of internet connectivity.
Install the solution template
Section titled “Install the solution template”On the server, go to IoT Hub > Solution Templates, find Smart irrigation, and click Install.
The template creates an Edge and assigns everything it needs to it. To see the assignments, go to Edge management > Edges and click the Edge.
Scheduler configuration
Section titled “Scheduler configuration”On the Details tab of the Edge, click Manage scheduler events to see the assigned events. To view the configuration of an event, open it under Platform > Scheduler:
- The Configuration tab shows the event type, the message type, and the Message body with the parameters of the task.
- The Schedule tab shows when and how often the event runs.
On the Edge, go to Platform > Scheduler to confirm that the events were received.
Rule chain configuration
Section titled “Rule chain configuration”To see the rule chains the template assigned to the Edge, click Manage rule chains on the Details tab of the Edge. The Root column marks the root rule chain of the Edge.
Dashboard
Section titled “Dashboard”The template also assigns a dashboard to the Edge. Open it on the Edge to see soil moisture, water consumption, and irrigation duration.
Benefits
Section titled “Benefits”Running the Scheduler on ThingsBoard Edge:
- Keeps irrigation running in remote locations, even without a connection to the server.
- Saves water by running irrigation on a fixed schedule.
- Reduces manual work through automated event execution.
- Provides real-time soil moisture telemetry even when offline.
Was this helpful?