定时任务使用指南(手机应用)
about
跨节点定时任务
- 定时任务信息由节点维护,而不是云端后端。但在实际使用中,常常需要多个节点共同构成一个场景。
- 对于这类定时任务,客户端会在多个节点中使用相同的定 时任务 ID。
- 在查询时,客户端会查找所有节点中共有的定时任务 ID,并统一进行展示。
以下有效载荷展示了如何跨多个节点创建场景。
使用以下有效载荷向 {{base_url}}/v1/user/nodes/params 发起 POST 请求:
JSON 载荷(展开/收起)
[{
"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
}
}
}]
}
}
}]