更新时间:2023-07-06 08:27:16下载pdf
本文介绍添加一键执行的 API。
可添加不同类型动作的一键执行。动作个数上限 50 个。
POST: /v2.0/iot-03/scenes
body 说明
| 参数名 | 类型 | 参数位置 | 是否必填 | 说明 |
|---|---|---|---|---|
| name | String | true | 一键执行名称 | |
| dsl | SceneDsl | true | 一键执行规则语言 |
dsl 说明
| 参数名 | 类型 | 参数位置 | 是否必填 | 说明 |
|---|---|---|---|---|
| actions | List | true | 一键执行动作列表 |
actions 说明
| 参数名 | 类型 | 参数位置 | 是否必填 | 说明 |
|---|---|---|---|---|
| execution_type | String | true | 执行类型:
| |
| execution_rule | Object | true | 执行规则。见execution_rule详细说明。 |
| 参数名 | 类型 | 说明 |
|---|---|---|
| result | String | 一键执行 ID |
POST: /v2.0/iot-03/scenes
{
"name": "这是一个一键执行",
"dsl": {
"actions": [
{
"execution_type": "delay",
"execution_rule": {
"delay_seconds": 60
}
},
{
"execution_type": "deviceIssue",
"execution_rule": {
"execution_id": "vdevo16292691746****",
"function_code": "bright_value",
"function_value": 20
}
},
{
"execution_type": "deviceGroupIssue",
"execution_rule": {
"execution_id": "144790134147200****",
"function_code": "switch_1",
"function_value": true
}
}
]
}
}
{
"result": "OrVvumqZ6G0g****",
"t": 1635845369037,
"success": true
}
参考 错误码。
当 execution_type 为 delay 时:
| 参数名 | 类型 | 说明 | 必填 |
|---|---|---|---|
| delay_seconds | Long | 延时时间,取值范围 1~5 * 60 * 60,单位:秒 | 是 |
当 execution_type 为 deviceIssue 或 deviceGroupIssue 时:
| 参数名 | 类型 | 说明 | 必填 |
|---|---|---|---|
| execution_id | String | 设备或设备群组 ID | 是 |
| function_code | String | 设备或设备群组指令码 | 是 |
| function_value | Object | 设备或设备群组指令值 | 是 |
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈