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 other ESP RainMaker features, scheduling has been implemented completely on the node side in the form of a "service". The cloud backend acts as a gateway between the node and the clients (like phone apps).
The complexity of the scheduling feature is hidden beneath a simple C API and abstracted by the phone apps.
Schedules Across Nodes
- Scheduling information is maintained by the nodes, not by the cloud backend. However, it is common to have multiple nodes as part of a single schedule.
- For such schedules, the client uses the same schedule ID across multiple nodes.
- When querying, the client looks for common schedule IDs across all the nodes and displays them together.
A sample payload for creating a schedule across multiple nodes is shown below.
POST on {{base_url}}/v1/user/nodes/params
with payload:
JSON Payload (Toggle 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
}
}
}]
}
}
}]