Add Scenes

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

Add scenes to the specified home.

API address

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

Request parameter

Parameter nameTypeINRequiredDescription
home_idStringuritrueThe home ID.

Return parameter

Parameter nameTypeDescription
resultStringThe returned result.

Request example

POST: /v1.0/homes/242****/scenes
{
  "name": "Test of Adding Scenes",
  "background": "https://images.tuyacn.com/smart/rule/cover/sp***.png",
  "actions": [
    {
      "executor_property": {
        "hours": "0",
        "minutes": "0",
        "seconds": "5"
      },
      "action_executor": "delay"
    },
    {
      "executor_property": {
        "work_mode": "scene_2"
      },
      "action_executor": "dpIssue",
      "entity_id": "0120090568c63a89****"
    },
    {
      "action_executor": "ruleDisable",
      "entity_id": "AYJV2hh3eqm3****"
    },
    {
      "action_executor": "ruleEnable",
      "entity_id": "AYJV2hh3eqm3****"
    }
  ]
}

Return example

{
    "result": "53IYSXI3gEn2****",
    "t": 1541072348540,
    "success": true
}

Error code

For more information, see error code.