场景使用指南(手机应用)
about
使用指南
跨节点场景
- 如上所述,场景信息由节点维护,而不是云端后端。但在实际使用中,常常需要多个节点共同构成一个场景。
- 对于这类场景,客户端会在多个节点中使用相同的场景 ID。
- 在查询时,客户端会查找所有节点中共有的场景 ID,并统一进行展示。
以下有效载荷展示了如何跨多个节点创建场景。
使用以下有效载荷向 {{base_url}}/v1/user/nodes/params
发起 POST 请求:
JSON 载荷(展开/收起)
[{
"node_id": "<nodeid_1>",
"payload": {
"Scenes": {
"Scenes": [{
"name": "Night1",
"operation": "add",
"id": "1112",
"action": {
"Light": {
"Power": true,
"Hue": 280
}
}
}]
}
}
}, {
"node_id": "<nodeid_2>",
"payload": {
"Scenes": {
"Scenes": [{
"name": "Night1",
"operation": "add",
"id": "1112",
"action": {
"Switch": {
"Power": true
}
}
}]
}
}
}]