Last Updated on : 2023-07-06 08:27:18download
Add tap-to-run scenes of different actions. The maximum number of actions is 50
.
POST: /v2.0/iot-03/scenes
Description of body
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
name | String | true | The name of a specified tap-to-run scene. | |
dsl | SceneDsl | true | The language of tap-to-run rules. |
Description of dsl
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
actions | List | true | The list of tap-to-run actions. |
Description of actions
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
execution_type | String | true | The execution type.
| |
execution_rule | Object | true | The execution rule. See the details of execution_rule . |
Parameter name | Type | Description |
---|---|---|
result | String | The ID of a tap-to-run scene. |
POST: /v2.0/iot-03/scenes
{
"name": "This is a tap-to-run",
"dsl": {
"actions": [
{
"execution_type": "delay",
"execution_rule": {
"delay_seconds": 60
}
},
{
"execution_type": "deviceIssue",
"execution_rule": {
"execution_id": "vdevo16292691746****",
"function_code": "bright_value",
"function_value": 20
}
},
{
"execution_type": "deviceGroupIssue",
"execution_rule": {
"execution_id": "144790134147200****",
"function_code": "switch_1",
"function_value": true
}
}
]
}
}
{
"result": "OrVvumqZ6G0g****",
"t": 1635845369037,
"success": true
}
For more information, see error code.
execution_rule
When execution_type
is delay
:
Parameter name | Type | Description | Required |
---|---|---|---|
delay_seconds | Long | The delay time. The value range is 1 to 5 × 60 × 60. Unit: second. | Yes |
When execution_type
is deviceIssue
or deviceGroupIssue
:
Parameter name | Type | Description | Required |
---|---|---|---|
execution_id | String | The ID of a specified device or device group. | Yes |
function_code | String | The instruction code of a device or device group. | Yes |
function_value | Object | The instruction value of a device or device group. | Yes |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback