Skip to main content

Scheduling Usage Guide (Phone Apps)

about

The Internet of Things (IoT) primarily involves devices connected to the Internet, enabling data exchange such as telemetry and commands. However, many applications require automation where devices can operate independently.

In line with the rest of the ESP RainMaker features, scheduling has been implemented completely on the node side in the form of a "service". The cloud backend just acts as a gateway between the node and the clients (like Phone apps).

The entire complexity of the scheduling feature is hidden beneath a simple C API and also abstracted out by the phone apps.

  • To learn more about scheduling, click here.
  • For the usage of scheduling on the firmware, click here.

Schedules Across Nodes

  • As we have seen, scheduling information is maintained by the nodes, and not by the cloud backend. However, it is a common requirement to have multiple nodes as part of a single schedule.
  • For such schedules, the client uses the same schedule ID across multiple nodes.
  • Even while querying, it looks for common schedule IDs across all the nodes and shows them together.

A sample payload for creating a schedule across multiple nodes is as shown below:

POST on {{base_url}}/v1/user/nodes/params with payload:

JSON Payload (Click to view)
[{
"node_id": "<nodeid_1>",
"payload": {
"Schedule": {
"Schedules": [{
"name": "Evening",
"id": "8D36",
"operation": "add",
"triggers": [{
"d": 31,
"m": 1110
}],
"action": {
"Light": {
"power": true
}
}
}]
}
}
}, {
"node_id": "<nodeid_2>",
"payload": {
"Schedule": {
"Schedules": [{
"name": "Evening",
"operation": "add",
"id": "8D36",
"triggers": [{
"d": 31,
"m": 1110
}],
"action": {
"Light": {
"power": false
}
}
}]
}
}
}]

On this page