English
English
简体中文
Contact Us
Register
Log In

Add Automation Scenes

Last Updated on : 2023-09-15 01:51:20download

Add automation scenes to the specified home.

API address

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

Request parameter

Parameter nameTypeINRequiredDescription
home_idStringuritrueThe home ID.

Return parameter

Parameter nameTypeDescription
resultStringThe returned result.

Request example

POST: /v1.0/homes/242****/automations
{
  "conditions": [
    {
      "display": {
        "code": "switch_1",
        "operator": "==",
        "value": true
      },
      "entity_id": "vdevo15725982542****",
      "entity_type": 1,
      "order_num": 1
    }
  ],
  "actions": [
    {
      "action_executor": "delay",
      "executor_property": {
        "hours": "0",
        "minutes": "0",
        "seconds": "5"
      }
    },
    {
      "action_executor": "dpIssue",
      "entity_id": "vdevo15725982542****",
      "executor_property": {
        "switch_1": true
      }
    }
  ],
  "background": "https://images.tuyacn.com/smart/rule/cover/bedr***.png",
  "match_type": 1,
  "name": "Automation Test"
}

Return example

{
    "preconditions": [
        {
            "display": {
                "start": "10:00",
                "loops": "0010000",
                "timezone_id": "Asia/Shanghai",
                "end": "12:00"
            },
            "cond_type": "timeCheck"
        }
    ]
}

Error code

For more information, see error code.