Trigger External Conditions

Last Updated on : 2023-12-07 03:33:54download

Trigger external conditions to run an automation scene in the specified home.

API address

POST: /v1.0/homes/{home_id}/automations/{automation_id}/conditions/trigger

Request parameter

Parameter nameTypeINRequiredDescription
home_idStringuritrueThe ID of the user's home.
automation_idStringuritrueThe ID of the specified automation scene.

Description of body

Parameter nameTypeINRequiredDescription
entity_idStringbodytrueThe ID of the specified external condition.
displayJSONbodytrueThe condition that triggers an automation scene.

Description of display

Parameter nameTypeINRequiredDescription
codeStringbodytrueThe statusCode of the specified device.
valueStringbodytrueThe value of the specified code.

Return parameter

Parameter nameTypeDescription
resultBooleanIndicates whether the scene is triggered successfully. true is returned when the operation is successful.

Request example

POST: /v1.0/homes/242****/automations/53IYSXI3gEn2w***/conditions/trigger
[
  {
    "entity_id": "c9a5a524-d973-4b59-9390-0dcda0f17***",
    "display": {
      "code": "test",
      "value": "test"
    }
  }
]

Return example

{
    "result": true,
    "t": 1541072348540,
    "success": true
}

Error code

For more information, see error code.