Scene Control

Last Updated on : 2021-07-16 07:40:43download

Control scenes by user ID, scene ID, and control commands.

API address

POST: /v1.0/iot-01/voice/users/{uid}/scenes/{scene_id}/commands

Request parameter

Parameter name Type IN Required Description
uid String uri true The user ID.
sceneId String uri true The scene ID.

Description of body

Parameter name Type IN Required Description
interface_name String true The name of the API to be queried.
command String true The command code.

Return parameter

Parameter name Type Description
result Object The returned result.
success Boolean Indicates whether the operation is successful. true: succeeded. false: failed.
t Long The returned 13-bit timestamp.
code Integer The response code. It is empty on success.
msg String The error message that is returned if the request fails. It is empty on success.

Description of result

Parameter name Type Description
message_id String The request identifier.
version String The version number.

Request example

POST: /v1.0/iot-01/voice/users/ay1618816013155*****/scenes/Wn4TxJBCHcoh****/commands
{ "scene_id": "Wn4TxJBCHcoh****", "uid": "ay1618816013155*****", "interface_name": " Tuya.SmartHome.PowerstateController", "command": "TurnOn" }

Return example

{ "result": { "message_id": "b5e281b0-433b-44d4-ab7f-bb971e1a69fa", "version": "V1.0" }, "t": 1620987268824, "success": true }

Error code

For more information, see error code.