修改场景联动
本地
本地
PUT
http://127.0.0.1:9999/api/v1/scene_automations
请求参数
Header 参数
x-token
string
可选
默认值:
{{x-token}}
Body 参数application/json
object {0}
示例
{
"id": "59e6fab9-448f-26bb-b608-3566b716ff72",
"name": "222",
"description": "xxx",
"enabled": "Y",
"trigger_condition_groups": [
[
{
"trigger_conditions_type": "10",
"trigger_source": "设备id",
"trigger_param_type": "TEL",
"trigger_param": "temperature",
"trigger_operator": ">",
"trigger_value": "20"
}
],
[
{
"trigger_conditions_type": "11",
"trigger_source": "设备配置id",
"trigger_param_type": "TEL",
"trigger_param": "temperature",
"trigger_operator": ">",
"trigger_value": "20"
},
{
"trigger_conditions_type": "22",
"trigger_value": "137|22:01:00+08:00|23:00:00+08:00"
}
],
[
{
"execution_time": "2024-04-01T11:22:00Z",
"expiration_time": "2024-04-01T11:22:00Z"
}
],
[
{
"//": "时间条件-重复-东八区每小时22分0秒",
"task_type": "HOUR",
"params": "22:00+08:00"
}
],
[
{
"task_type": "DAY",
"params": "11:22:00+08:00"
}
],
[
{
"task_type": "WEEK",
"params": "123|11:22:00+07:00"
}
],
[
{
"task_type": "MONTH",
"params": "12T11:22:00+08:00"
}
]
],
"actions": [
{
"action_type": "10",
"action_target": "设备id",
"action_param_type": "TEL",
"action_param": "temperature",
"action_value": "20"
},
{
"action_type": "11",
"action_target": "设备配置id",
"action_param_type": "TEL",
"action_param": "temperature",
"action_value": "20"
},
{
"action_type": "20",
"action_target": "场景id"
},
{
"action_type": "30",
"action_target": "告警id"
}
]
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PUT 'http://127.0.0.1:9999/api/v1/scene_automations' \
--header 'x-token: {{x-token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":"59e6fab9-448f-26bb-b608-3566b716ff72",
"name": "222",
"description": "xxx",
"enabled": "Y",
"trigger_condition_groups": [
[
{
"trigger_conditions_type": "10",
"trigger_source": "设备id",
"trigger_param_type": "TEL",
"trigger_param": "temperature",
"trigger_operator": ">",
"trigger_value": "20"
}
],
[
{
"trigger_conditions_type": "11",
"trigger_source": "设备配置id",
"trigger_param_type": "TEL",
"trigger_param": "temperature",
"trigger_operator": ">",
"trigger_value": "20"
},
{
"trigger_conditions_type": "22",
"trigger_value": "137|22:01:00+08:00|23:00:00+08:00"
}
],
[
{
"execution_time": "2024-04-01T11:22:00Z",
"expiration_time": "2024-04-01T11:22:00Z"
}
],
[
{
"//": "时间条件-重复-东八区每小时22分0秒",
"task_type": "HOUR",
"params": "22:00+08:00"
}
],
[
{
"task_type": "DAY",
"params": "11:22:00+08:00"
}
],
[
{
"task_type": "WEEK",
"params": "123|11:22:00+07:00"
}
],
[
{
"task_type": "MONTH",
"params": "12T11:22:00+08:00"
}
]
],
"actions": [
{
"action_type": "10",
"action_target": "设备id",
"action_param_type": "TEL",
"action_param": "temperature",
"action_value": "20"
},
{
"action_type": "11",
"action_target": "设备配置id",
"action_param_type": "TEL",
"action_param": "temperature",
"action_value": "20"
},
{
"action_type": "20",
"action_target": "场景id"
},
{
"action_type": "30",
"action_target": "告警id"
}
]
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
data
object
必需
scene_automation_id
string
必需
示例
{
"code": 200,
"message": "update scene automations successfully",
"data": {
"scene_automation_id": "59e6fab9-448f-26bb-b608-3566b716ff72"
}
}
修改于 2025-03-25 03:03:16