Last Updated on : 2024-06-29 02:06:47download
Modify the specified linkage rule.
PUT: /v2.0/cloud/scene/rule/{rule_id}
| Parameter name | Type | IN | Required | Description |
|---|---|---|---|---|
| rule_id | String | uri | true | The ID of the specified linkage rule. |
Description of body
| Parameter name | Type | IN | Required | Description |
|---|---|---|---|---|
| space_id | String | true | The ID of the specified space that is associated with the linkage rule. | |
| name | String | false | The name of the specified linkage rule. | |
| decision_expr | String | false | The condition expression. Valid values:
| |
| conditions | List | false | The collection of conditions. | |
| actions | List | false | The collection of actions. | |
| effective_time | EffectiveTime | false | The effective time. |
Description of effective_time
| Parameter name | Type | IN | Required | Description |
|---|---|---|---|---|
| start | String | true | The start time. | |
| end | String | true | The end time. | |
| loops | String | true | The cycle when the specified linkage rule is triggered. The value is a seven-digit number consisting of 0 and 1. 0 means disabled and 1 means enabled. The first digit represents Sunday and the other digits represent Monday to Saturday sequentially. For example, 0011000 represents a scheduled task is executed every Tuesday and Wednesday. | |
| time_zone_id | String | true | The ID of the specified time zone. |
Description of conditions
| Parameter name | Type | IN | Required | Description |
|---|---|---|---|---|
| entity_id | String | true | The object ID of the specified condition. | |
| entity_type | String | true | The object type of the specified condition. Valid values:
| |
| code | Integer | true | The unique code of the specified condition. | |
| expr | Expr | true | The calculation expression. |
Description of actions
| Parameter name | Type | IN | Required | Description |
|---|---|---|---|---|
| entity_id | String | true | The object ID of the specified action. | |
| action_executor | String | true | The object type of the specified action. Valid values:
| |
| executor_property | ExecutorProperty | true | The details of the specified action. |
Description of expr
| Parameter name | Type | IN | Required | Description |
|---|---|---|---|---|
| status_code | String | true | The code of the specified status. This parameter is required when entity_type is device_report. | |
| comparator | String | true | The comparison expression. This parameter is required when entity_type is device_report and weather. Valid values:
| |
| status_value | Object | true | The value of the specified status. This parameter is required when entity_type is device_report. | |
| date | String | false | The date when the specified linkage rule is triggered. | |
| time | String | true | The time when the specified linkage rule is triggered. | |
| loops | String | false | The cycle when the specified linkage rule is triggered. The value is a seven-digit number consisting of 0 and 1. 0 means disabled and 1 means enabled. The first digit represents Sunday and the other digits represent Monday to Saturday sequentially. For example, 0011000 represents a scheduled task is executed every Tuesday and Wednesday. | |
| time_zone_id | String | true | The ID of the specified time zone. | |
| weather_code | String | true | The code of the specified status. This parameter is required when entity_type is weather. | |
| weather_value | Object | true | The value of the specified status. This parameter is required when entity_type is weather. |
Description of executor_property
| Parameter name | Type | IN | Required | Description |
|---|---|---|---|---|
| function_code | String | true | The code of the specified instruction. This parameter is required when action_executor is device_issue or device_group_issue. | |
| function_value | Object | true | The value of the specified instruction. This parameter is required when action_executor is device_issue or device_group_issue. | |
| delay_seconds | Integer | true | The delay time. This parameter is required when action_executor is delay. |
| Parameter name | Type | Description |
|---|---|---|
| result | Boolean | Indicates whether the linkage rule is modified successfully. |
PUT: /v2.0/cloud/scene/rule/***
{
"space_id": "150***",
"name": "Test Scene",
"type": "automation",
"decision_expr": "or",
"effective_time": {
"start": "00:00",
"end": "23:00",
"loops": "1111111",
"timezone_id": "Asia/Shanghai"
},
"conditions": [
{
"code": 1,
"entity_id": "****",
"entity_type": "device_report",
"expr": {
"status_code": "switch_1",
"comparator": "==",
"status_value": true
}
}
],
"actions": [
{
"entity_id": "****",
"action_executor": "device_issue",
"executor_property": {
"function_code": "switch_1",
"function_value": true
}
}
]
}
{
"tid": "****",
"result": true,
"t": 1677741828415,
"success": true
}
For more information, see error code.
For more information, see Limits on API Request Frequency.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback