场景管理API
获取场景列表
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | []Object<result> | Body | 返回结果 |
result说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| scene_id | String | Body | 场景ID |
| scene_name | String | Body | 场景名称 |
| is_auto | Boolean | Body | 判断是否可以自动化 true:是 false:否 |
| enable_auto | Boolean | Body | 判断是否启用自动化 true:启用 false:禁用 |
| manual | Boolean | Body | 判断是否可以手动触发 true:是 false:否 |
| scene_entity_id | String | Body | 场景实体ID |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_scene_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db",
"scene_name": "my scene",
"is_auto": true,
"enable_auto": true,
"manual": true,
"scene_entity_id": "es8b5a73f8dd84abaa94dcs248be49b0d2"
}
]
}
失败返回示例
见 接口失败返回
获取场景信息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scene_id | String | Body | 是 | 场景ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object<result> | Body | 返回结果 |
result说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| scene_name | String | Body | 场景名称 |
| is_auto | Boolean | Body | 判断是否可以自动化 true:是 false:否 |
| manual | Boolean | Body | 判断是否可以手动触发 true:是 false:否 |
| scene_entity_id | String | Body | 场景实体ID |
| triggers | []Object<trigger> | Body | 触发器信息 |
| conditions | []Object<condition> | Body | 条件信息 |
| actions | []Object<action> | Body | 动作信息 |
trigger说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| trigger_config | String | Body | 触发器配置,见 场景触发器配置 |
| device_id | String | Body | 设备ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力类型 |
| trigger_type | String | Body | 触发器类型,见 场景触发器配置 |
| attribute | Object | Body | 附加属性,见 标准物模型 |
condition说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| condition_config | String | Body | 条件配置,见 场景条件配置 |
| device_id | String | Body | 设备ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力类型 |
| condition_type | String | Body | 条件类型,见 场景条件配置 |
| attribute | Object | Body | 附加属性,见 标准物模型 |
action说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| action_config | String | Body | 动作配置,见 场景动作配置 |
| device_id | String | Body | 设备ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力类型 |
| action_type | String | Body | 动作类型,见 场景动作配置 |
| attribute | Object | Body | 附加属性,见 标准物模型 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_name": "my scene",
"is_auto": true,
"manual": true,
"scene_entity_id": "es8b5a73f8dd84abaa94dcs248be49b0d2",
"triggers": [
{
"trigger_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea1",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec1",
"ability_type": "switch",
"trigger_type": "turned_on"
}
],
"conditions": [
{
"condition_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea2",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec2",
"ability_type": "switch",
"condition_type": "is_on"
}
],
"actions": [
{
"action_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea3",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec3",
"ability_type": "switch",
"action_type": "turn_on"
}
]
}
]
}
失败返回示例
见 接口失败返回
获取设备触发器列表
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| device_id | String | Body | 否 | 设备ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | []Object<result> | Body | 返回结果 |
result说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| device_name | String | Body | 设备名称 |
| device_type | String | Body | 设备类型 |
| device_id | String | Body | 设备ID |
| triggers | []Object<trigger> | Body | 触发器信息 |
trigger说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| trigger_config | String | Body | 触发器配置,见 场景触发器配置 |
| device_id | String | Body | 设备ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力类型 |
| trigger_type | String | Body | 触发器类型,见 场景触发器配置 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_device_trigger_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"device_name": "My Device",
"device_type": "Switch",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"triggers": [
{
"trigger_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec7",
"ability_type": "switch",
"trigger_type": "turned_on"
}
]
}
]
}
失败返回示例
见 接口失败返回
获取设备条件列表
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| device_id | String | Body | 否 | 设备ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | []Object<result> | Body | 返回结果 |
result说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| device_name | String | Body | 设备名称 |
| device_type | String | Body | 设备类型 |
| device_id | String | Body | 设备ID |
| conditions | []Object<condition> | Body | 条件信息 |
condition说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| condition_config | String | Body | 条件配置,见 场景条件配置 |
| device_id | String | Body | 设备ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力类型 |
| condition_type | String | Body | 条件类型,见 场景条件配置 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_device_condition_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"device_name": "My Device",
"device_type": "Switch",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"conditions": [
{
"condition_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec7",
"ability_type": "switch",
"condition_type": "is_on"
}
]
}
]
}
失败返回示例
见 接口失败返回
获取设备动作列表
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| device_id | String | Body | 否 | 设备ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | []Object<result> | Body | 返回结果 |
result说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| device_name | String | Body | 设备名称 |
| device_type | String | Body | 设备类型 |
| device_id | String | Body | 设备ID |
| actions | []Object<action> | Body | 动作信息 |
action说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| action_config | String | Body | 动作配置,见 场景动作配置 |
| device_id | String | Body | 设备ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力类型 |
| action_type | String | Body | 动作类型,见 场景动作配置 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_device_action_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"device_name": "My Device",
"device_type": "Switch",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"actions": [
{
"action_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec7",
"ability_type": "switch",
"action_type": "turn_on"
}
]
}
]
}
失败返回示例
见 接口失败返回
创建场景信息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scene_name | String | Body | 是 | 场景名称 |
| manual | Boolean | Body | 是 | 判断是否可以手动触发 true:是 false:否 |
| triggers | []Object<trigger> | Body | 是 | 触发器信息 |
| conditions | []Object<condition> | Body | 是 | 条件信息 |
| actions | []Object<action> | Body | 是 | 动作信息 |
trigger说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| trigger_config | String | Body | 是 | 触发器配置,见 场景触发器配置 |
| device_id | String | Body | 否 | 设备ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力类型 |
| trigger_type | String | Body | 否 | 触发器类型,见 场景触发器配置 |
| attribute | Object | Body | 否 | 附加属性,见 标准物模型 |
condition说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| condition_config | String | Body | 是 | 条件配置,见 场景条件配置 |
| device_id | String | Body | 否 | 设备ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力类型 |
| condition_type | String | Body | 否 | 条件类型,见 场景条件配置 |
| attribute | Object | Body | 否 | 附加属性,见 标准物模型 |
action说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| action_config | String | Body | 是 | 动作配置,见 场景动作配置 |
| device_id | String | Body | 否 | 设备ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力类型 |
| action_type | String | Body | 否 | 动作类型,见 场景动作配置 |
| attribute | Object | Body | 否 | 附加属性,见 标准物模型 |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "create_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"scene_name": "test",
"manual": true,
"triggers": [
{
"trigger_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea1",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec1",
"ability_type": "switch",
"trigger_type": "turned_on"
}
],
"conditions": [
{
"condition_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea2",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec2",
"ability_type": "switch",
"condition_type": "is_on"
}
],
"actions": [
{
"action_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea3",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec3",
"ability_type": "switch",
"action_type": "turn_on"
}
]
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回
更新场景信息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scene_id | String | Body | 是 | 场景ID |
| scene_name | String | Body | 是 | 场景名称 |
| manual | Boolean | Body | 是 | 判断是否可以手动触发 true:是 false:否 |
| triggers | []Object<trigger> | Body | 是 | 触发器信息 |
| conditions | []Object<condition> | Body | 是 | 条件信息 |
| actions | []Object<action> | Body | 是 | 动作信息 |
trigger说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| trigger_config | String | Body | 是 | 触发器配置,见 场景触发器配置 |
| device_id | String | Body | 否 | 设备ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力类型 |
| trigger_type | String | Body | 否 | 触发器类型,见 场景触发器配置 |
| attribute | Object | Body | 否 | 附加属性,见 标准物模型 |
condition说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| condition_config | String | Body | 是 | 条件配置,见 场景条件配置 |
| device_id | String | Body | 否 | 设备ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力类型 |
| condition_type | String | Body | 否 | 条件类型,见 场景条件配置 |
| attribute | Object | Body | 否 | 附加属性,见 标准物模型 |
action说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| action_config | String | Body | 是 | 动作配置,见 场景动作配置 |
| device_id | String | Body | 否 | 设备ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力类型 |
| action_type | String | Body | 否 | 动作类型,见 场景动作配置 |
| attribute | Object | Body | 否 | 附加属性,见 标准物模型 |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "update_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"scene_id": "sr31adc223cc4b3bedb6bd4742dedcfa5",
"manual": true,
"scene_name": "test",
"triggers": [
{
"trigger_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea1",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec1",
"ability_type": "switch",
"trigger_type": "turned_on"
}
],
"conditions": [
{
"condition_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea2",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec2",
"ability_type": "switch",
"condition_type": "is_on"
}
],
"actions": [
{
"action_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea3",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec3",
"ability_type": "switch",
"action_type": "turn_on"
}
]
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回
删除场景信息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scene_id | String | Body | 是 | 场景ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "delete_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回
批量删除场景信息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scenes | []Object<scene> | Body | 是 | 场景信息 |
scene说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| scene_id | String | Body | 是 | 场景ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "batch_delete_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"scenes": [
{
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db"
}
]
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回
手动触发场景
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| scene_entity_id | String | Body | 是 | 场景实体ID |
| residence_id | String | Body | 是 | 住宅ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "manual_trigger_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_entity_id": "e3b5a73f8dd84abaa94dcs248be49b0db",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回
批量手动触发场景
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scenes | []Object<scene> | Body | 是 | 场景信息 |
scene说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| scene_entity_id | String | Body | 是 | 场景实体ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "batch_manual_trigger_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scenes": [
{
"scene_entity_id": "e3b5a73f8dd84abaa94dcs248be49b0db"
}
],
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回
启用自动化场景
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| scene_entity_id | String | Body | 是 | 场景实体ID |
| residence_id | String | Body | 是 | 住宅ID |
| enable_auto | Boolean | Body | 是 | 判断是否启用自动化 true:启用 false:禁用 |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "enable_auto_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_entity_id": "e3b5a73f8dd84abaa94dcs248be49b0db",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"enable_auto": true
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回
批量启用自动化场景
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scenes | []Object<scene> | Body | 是 | 场景信息 |
scene说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| scene_entity_id | String | Body | 是 | 场景实体ID |
| enable_auto | Boolean | Body | 是 | 判断是否启用自动化 true:启用 false:禁用 |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "batch_enable_auto_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scenes": [
{
"scene_entity_id": "e3b5a73f8dd84abaa94dcs248be49b0db",
"enable_auto": true
}
],
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回
获取场景历史记录
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scene_id | String | Body | 是 | 场景ID |
| page_size | Integer | Body | 是 | 每页数量 |
| page_index | Integer | Body | 是 | 当前页数 |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | []Object<result> | Body | 返回结果 |
result说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| scene_record_id | String | Body | 场景记录ID |
| scene_id | String | Body | 场景ID |
| scene_name | String | Body | 场景名称 |
| trigger_scene | Boolean | Body | 判断场景执行是否成功 true:成功 false:失败 |
| start_time | String | Body | 开始时间,UTC |
| finish_time | String | Body | 结束时间,UTC |
| manual | Boolean | Body | 判断是否是手动触发 true:是 false:否 |
| detail | Object<detail> | Body | 详细信息 |
detail说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| space_name | String | Body | 空间名称 |
| space_id | String | Body | 空间ID |
| device_name | String | Body | 设备名称 |
| device_id | String | Body | 设备ID |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_scene_history",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"page_size": 1,
"page_index": 1,
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_record_id": "r8b5a73f8dd84abaa94dcs248be49b0d1",
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db",
"scene_name": "my scene",
"trigger_scene": true,
"start_time": "2024-01-16 13:32:43",
"finish_time": "2024-01-16 13:32:45",
"manual": false,
"detail": {
"space_name": "kitchen",
"space_id": "ss8b5a73f8dd84abaa94dcs248be49b0d",
"device_name": "co",
"device_id": "dr8b5a73f8dd84abaa94dcs248be49b0d"
}
}
]
}
失败返回示例
见 接口失败返回
删除场景历史记录
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| scene_record_id | String | Body | 是 | 场景记录ID |
| residence_id | String | Body | 是 | 住宅ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "delete_scene_history",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_record_id": "r7b5a73f8dd84abaa94dcs248be49b5dh",
"residence_id": "r4b5a73f8dd84abaa94dcs248be49b0db"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回
批量删除场景历史记录
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| scene_records | []Object<scene_record> | Body | 是 | 场景记录信息 |
| residence_id | String | Body | 是 | 住宅ID |
scene_record说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| scene_record_id | String | Body | 是 | 场景记录ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "batch_delete_scene_history",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_records": [
{
"scene_record_id": "r7b5a73f8dd84abaa94dcs248be49b5dh"
}
],
"residence_id": "r4b5a73f8dd84abaa94dcs248be49b0db"
}
}
成功返回示例
状态码:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回