Bind Scene

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

This API applies to scene switch devices. The scene switches have corresponding switch buttons, and each switch button has the specified instructions. With this API operation, the specified switch instruction can be bound with a scene, that is, the scene switch is associated with the scene. After the binding is successful, the scene can be directly triggered through the API of sending an instruction.

API address

POST: /v1.0/devices/{device_id}/scenes/{scene_id}

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe device ID bound with the scene.
scene_idStringuritrueThe scene ID.

Description of body

Parameter nameTypeINRequiredDescription
codeStringbodytrueThe code of a standard instruction.
valueStringbodytrueThe input parameter range of the specified instruction.

Return parameter

Parameter nameTypeDescription
resultBooleanThe returned result.

Request example

POST: /v1.0/devices/6c294c2ad22e4fac2f7qb***/scenes/000***4ecd
{
  "code": "scene_1",
  "value": "scene"
}

Return example

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

Error code

For more information, see error code.