Modify Automation

Last Updated on : 2023-12-07 03:33:55

Used to modify automation scenarios.

API address

PUT: /v1.0/homes/{home_id}/automations/{automation_id}

Request parameter

Parameter nameTypeINRequiredDescription
home_idStringuritrueFamily ID
automation_idStringuritrueAutomation ID
bodyString falseRequest message body

Return parameter

Parameter nameTypeDescription
resultBooleanExecution result:
  • true: Successful execution
  • false: Execution failed

Request example

PUT: /v1.0/homes/242****/automations/53IYSXI3gEn2****
{
  "actions": [
    {
      "action_executor": "dpIssue",
      "entity_id": "vdevo157259825422309",
      "executor_property": {
        "switch_1": true
      }
    }
  ],
  "background": "https://images.tuyacn.com/smart/rule/cover/bedroom.png",
  "conditions": [
    {
      "display": {
        "code": "switch_1",
        "operator": "==",
        "value": true
      },
      "entity_id": "vdevo157259825422309",
      "entity_type ": 1,
      "order_num": 1
    }
  ],
  "match_type": 1,
  "name": "Test Automation"
}

Return example

true

Error code

For more information, see error code.