English
English
简体中文
Contact Us
Register
Log In

Query Automation List

Last Updated on : 2023-09-15 01:52:10download

Based on the home ID, query a list of automation scenes in the specified home.

API address

GET: /v1.0/homes/{home_id}/automations

Request parameter

Parameter nameTypeINRequiredDescription
home_idStringuritrueThe home ID.

Return parameter

Parameter nameTypeDescription
resultListThe returned result.

Description of result

Parameter nameTypeDescription
automation_idStringThe ID of the specified automation scene.
nameStringThe name of the specified automation scene.
backgroundStringThe background image.
preconditionsListThe precondition.
conditionsListThe linkage condition.
actionsListThe executed actions.
match_typeIntegerIndicates the matching types. Valid values:
  • 1: Trigger an action when any condition is met.
  • 2: Trigger an action when all the conditions are met.
condition_ruleStringThe custom condition rule.
enabledBooleanIndicates whether to enable a rule.

Description of preconditions

Parameter nameTypeDescription
idStringThe condition ID.
cond_typeStringThe type of condition.
displayStringShows the conditions.

Description of conditions

Parameter nameTypeDescription
entity_typeIntegerThe type of condition.
entity_idStringThe entity ID. It could be a device ID, weather, or temperature.
displayStringShows the conditions.
order_numIntegerThe sequence.

Description of actions

Parameter nameTypeDescription
entity_idStringThe entity ID. It could be a device ID, weather, or temperature.
executor_propertyStringThe property that triggers an action.
action_executorStringThe type of the action.

Request example

GET: /v1.0/homes/242****/automations

Return example

{
    "result":[
        {
            "actions":[
                {
                   "action_executor":"delay",
                   "executor_property":{
                    "hours":"0",
                    "minutes": "0",
                    "seconds": "5"
                   }
                
                },
                {
                    "action_executor":"dpIssue",
                    "entity_id":"vdevo157259825422***",
                    "executor_property":{
                        "switch_1":true
                    }
                },
              	{
                    "action_executor":"externalAction",
                    "executor_property":{
                    	// Subject to your customization
                    }
                 
                }
            ],
            "automation_id":"p2aWOkEOe2RzA***",
            "background":"https://images.tuyacn.com/smart/rule/cover/bedr***.png",
            "conditions":[
                {
                    "display":{
                        "code":"switch_1",
                        "operator":"==",
                        "value":true
                    },
                    "entity_id":"vdevo157259825422***",
                    "entity_type":1,
                    "order_num":1
                }
            ],
            "enabled": true,
            "status": "1",
            "match_type":1,
            "name":"Automation Test"
        },
        {
            "automation_id":"L07BQVabdqwFP***",
            "background":"https://images.tuyacn.com/smart/rule/cover/hou***.png",
            "conditions":[
                {
                    "display":{
                        "code":"battery_percentage",
                        "operator":"<",
                        "value":255
                    },
                    "entity_id":"vdevo156958314001***",
                    "entity_type":1,
                    "order_num":1
                },
                {
                    "display":{
                        "code":"mode",
                        "operator":"==",
                        "value":1
                    },
                    "entity_id":"weqszcaokqlmlkmlcanqklwokl***",
                    "entity_type":15,
                    "order_num":2
                }
            ],
            "enabled": true,
            "match_type":1,
            "name":"Automation Test 1"
        }
    ],
    "success":true,
    "t":1572936751228
}


Error code

For more information, see error code.