Last Updated on : 2021-11-26 02:54:56download
Get the details of a scene template based on the scene template ID.
GET: /v1.0/iot-03/scene-templates/{template_id}
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
template_id | Long | uri | true | The ID of a specified scene template. |
Parameter name | Type | Description |
---|---|---|
result | SceneTemplateRes | The returned result. |
Description of result
Parameter name | Type | Description |
---|---|---|
name | String | The name of a specified scene template. |
desc | String | The description of a specified scene template. |
dsl | Object | The rule language of a specified scene template. |
preconditions | Object | The preconditions of a specified scene template. |
Description of preconditions
Parameter name | Type | Description |
---|---|---|
trigger_type | String | The type of trigger. Valid value: timeCheck . |
trigger_rule | Object | The precondition trigger rule. See the details of trigger_rule . |
Description of dsl
Parameter name | Type | Description |
---|---|---|
conditions | List | The list of scene template conditions. |
conditions_rule | String | The condition matching rules of scene templates. Valid values:
|
actions | List | The list of scene template actions. |
Description of conditions
Parameter name | Type | Description |
---|---|---|
trigger_type | String | The condition trigger type. Valid values:
|
trigger_id | String | The condition trigger ID. When trigger_type is categoryReport , trigger_id is the category ID.When trigger_type is timer , trigger_id is set to timer .When trigger_type is weather , trigger_id is set to the city ID. |
trigger_rule | Object | The condition trigger rule. See the details of trigger_rule in conditions . |
rule_num | Integer | The trigger condition number, used for custom condition calculation of the matching rule. The value ranges from 1 to the number of conditions, and cannot be repeated. |
Description of actions
Parameter name | Type | Description |
---|---|---|
execution_type | String | The execution type. Valid values:
|
execution_rule | Object | The execution rule. See the details of execution_rule . |
GET: /v1.0/iot-03/scene-templates/18*****8
{
"result": {
"preconditions": {
"trigger_rule": {
"timer_format": "00:00-23:59 * * 0,1,2,3,4,5,6 *"
},
"trigger_type": "timeCheck"
},
"name": "Linkage Template",
"dsl": {
"conditions_rule": "or",
"conditions": [
{
"rule_num": 1,
"trigger_rule": {
"status_code": "switch_led",
"status_value": true,
"comparator": "=="
},
"trigger_id": "dj",
"trigger_type": "categoryReport"
}
],
"actions": [
{
"execution_rule": {
"execution_id": "fskg",
"function_value": true,
"function_code": "switch_fan"
},
"execution_type": "categoryIssue"
}
]
},
"desc": "The second template"
},
"t": 1636613445945,
"success": true
}
For more information, see error code.
trigger_rule
in conditions
trigger_type
is categoryReport
:Parameter name | Type | Description | Required |
---|---|---|---|
status_code | String | The device instruction. | Yes |
comparator | String | The comparator. | Yes |
status_value | Object | The device instruction value. | Yes |
trigger_type
is timer
:Parameter name | Type | Description | Required |
---|---|---|---|
timer_format | String | The scheduled trigger time. Two formats are supported.
|
Yes |
trigger_type
is weather
:Parameter name | Type | Description | Required |
---|---|---|---|
weather_code | String | The weather code. | Yes |
comparator | String | The comparator. | Yes |
weather_value | Object | The value of the weather code. | Yes |
execution_rule
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 |
execution_type
is categoryIssue
:Parameter name | Type | Description | Required |
---|---|---|---|
execution_id | String | The ID of a specified category. | Yes |
function_code | String | The instruction code of a category. | Yes |
function_value | Object | The instruction value of a category. | Yes |
trigger_rule
in preconditions
Parameter name | Type | Description | Required |
---|---|---|---|
timer_format | String | The timer format. The format is: [hour:min]-[hour:min] [day of month] [month] [day of week] [year]. For example, 9:30-18:00 * * 0,1,2,3,4,5,6 * (9:30 am to 6:00 pm every week) | Yes |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback