Modify Scene

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

Modify a scene under a specified home.

API address

PUT: /v1.0/homes/{home_id}/scenes/{scene_id}

Request parameter

Parameter nameTypeINRequiredDescription
home_idStringuritrueThe home ID.
scene_idStringuritrueThe scene ID.

Description of body

Parameter nameTypeINRequiredDescription
backgroundStringbodytrueThe background image.
nameStringbodytrueScene name.
actionsListbodytrueThe list of actions.

Description of actions

Parameter nameTypeINRequiredDescription
entity_idStringbodyfalseThe device ID. The value is required when the API involves a device.
executor_propertyobjectbodytrueThe property of a specified execution action.
action_executorStringbodytrueThe category of a specified execution action. For example, dpIssue and delay.

Return parameter

Parameter nameTypeDescription
resultBooleanThe returned result. true is returned when the operation is successful.

Request example

PUT: /v1.0/homes/242****/scenes/53IYSXI3gEn2**** 
{
  "name": "Test of Adding a Scene",
  "background": "https://images.tuyacn.com/smart/rule/cover/****.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****"
    }
  ]
}

Return example

{
    "tid": "2c1fc5cf7f4511ee82774ab24801****",
    "result": true,
    "t": 1540799929837,
    "success": true
}

Error code

For more information, see error code.