创建场景联动
本地
本地
POST
http://127.0.0.1:9999/api/v1/scene_automations
{
"name": "111122222",
"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"
}
],
[
{
"trigger_conditions_type": "20",
"execution_time": "2024-04-10T15:13:29+08:00",
"expiration_time": 5
}
],
[
{
"trigger_conditions_type": "21",
"task_type": "HOUR",
"params": "22:00+08:00",
"expiration_time": 5
}
],
[
{
"trigger_conditions_type": "21",
"task_type": "DAY",
"params": "11:22:00+08:00",
"expiration_time": 60
}
],
[
{
"trigger_conditions_type": "21",
"task_type": "WEEK",
"params": "123|11:22:00+07:00",
"expiration_time": 1440
}
],
[
{
"trigger_conditions_type": "21",
"task_type": "MONTH",
"params": "12T11:22:00+08:00",
"expiration_time": 60
}
]
],
"actions": [
{
"action_type": "10",
"action_target": "设备id",
"action_param_type": "telemetry",
"action_param": "temperature",
"action_value": "20"
},
{
"action_type": "11",
"action_target": "设备配置id",
"action_param_type": "telemetry",
"action_param": "temperature",
"action_value": "20"
},
{
"action_type": "20",
"action_target": "场景id"
},
{
"action_type": "30",
"action_target": "告警id"
}
]
}
20- 单次定时
21- 重复定时
22- 时间范围
10- 设备ID
11- 设备配置ID
说明 | action_param_type | action_param | action_value |
---|---|---|---|
遥测 | telemetry | {"xxx":2} | |
属性 | attribute | {"xxx":"50"} | |
命令 | command | {"method":"ReSet","params":{"switch":1,"light":"close"}} | |
自定义遥测 | c_telemetry | {"xxx":2} | |
自定义属性 | c_attribute | {"xxx":2} | |
自定义命令 | c_command | {"method":"switch1","params":{"false":0}} |
请求参数
Header 参数
x-token
string
可选
默认值:
{{x-token}}
Body 参数application/json
示例代码
返回响应
修改于 2024-06-27 13:30:08