Query Automation List

Last Updated on : 2024-01-11 05:55:16download

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

{
    "tid": "ba2a6a487d3a11ee82c7664ef4d3e193",
    "result": [
        {
            "enabled": true,
            "automation_id": "rQdsfx****sDO6ON",
            "background": "",
            "preconditions": [
            ],
            "name": "Control the Light Based on Weather",
            "match_type": 1,
            "conditions": [
                {
                    "display": {
                        "code": "condition",
                        "operator": "==",
                        "value": "sunny"
                    },
                    "entity_id": "100180366****73213",
                    "entity_type": 3,
                    "order_num": 1
                }
            ],
            "actions": [
                {
                    "entity_id": "6856054****62e90e",
                    "executor_property": {
                        "bright_value": 25
                    },
                    "action_executor": "dpIssue"
                }
            ]
        }
    ],
    "t": 1699340168087,
    "success": true
}

Error code

For more information, see error code.