更新时间:2023-01-12 09:18:39下载pdf
内置系统模板推荐,包含部分动态模板。
| 请求方式 | API | 描述 |
|---|---|---|
| GET | /v1.0/iot-02/smart/template-generate/t1 | 生成设备自动开关场景动态模板 |
| GET | /v1.0/iot-02/smart/template-generate/t2 | 生成设备亮度调节场景动态模板 |
功能描述
生成设备自动开关场景-动态模板。
接口地址
GET /v1.0/iot-02/smart/template-generate/t1
请求参数
| 参数名 | 类型 | 参数类型 | 说明 | 是否必需 |
|---|---|---|---|---|
| roomId | String | body | 空间 ID | 是 |
| pid | String | body | 产品 ID | 否 |
| deviceName | String | body | 设备名称 | 否 |
| devicePurpose | String | body | 设备用途 | 否 |
| anyMatch | boolean | body | true:任意匹配false:全部匹配 |
否 |
| switchLed | boolean | body | true:开false:关 |
是 |
返回参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | Integer | 响应码(详情见错误码章节),成功时为空 |
| success | Boolean | 是否成功,true:成功,false:失败 |
| msg | String | 请求失败的信息,成功时为空 |
| t | Long | 返回时间戳,13 位 |
| result | Object | 返回结果 |
result参数说明
String //生成的场景联动ID
请求示例
{
"devicePurpose": "atmosphereLighting",
"pid": "sosdczdl",
"switchLed": true,
"deviceName": "xxxxxx",
"anyMatch": true
}
响应示例
FmMICDM7JtFuUIBC
功能描述
生成设备亮度调节场景-动态模板。
接口地址
GET /v1.0/iot-02/smart/template-generate/t2
请求参数
| 参数名 | 类型 | 参数类型 | 说明 | 是否必需 |
|---|---|---|---|---|
| roomId | String | body | 空间 ID | 是 |
| pid | String | body | 产品 ID | 否 |
| deviceName | String | body | 设备名称 | 否 |
| devicePurpose | String | body | 设备用途 | 否 |
| anyMatch | boolean | body | true:任意匹配false:全部匹配 |
否 |
| brightValue | int | body | 亮度值 | 是 |
返回参数
同上
请求示例
{
"brightValue": 500,
"pid": "sosdczdl",
"deviceName": "xxxxxxxx",
"anyMatch": true
}
以下为该接口常见的业务异常。更多的异常错误,参考 全局错误码。
| 错误码 | 说明 |
|---|---|
| 500 | 系统错误 |
| 1106 | 非法权限 |
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈