Set Circuit Switch

Last Updated on : 2022-04-07 08:16:03

Send a command of setting a circuit switch to a circuit breaker. On receiving the command, the circuit breaker will set the circuit switch.

API address

POST: /v1.0/electric-energy/{device_id}/actions/switch

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe ID of a Tuya device.

Description of body

Parameter nameTypeINRequiredDescription
switch_enableBoolean trueSet the status of a specified circuit switch. Valid values:
  • true: Close the switch.
  • false: Open the switch.

Return parameter

Parameter nameTypeDescription
resultCmdIssueResultResponseThe returned result.

Description of result

Parameter nameTypeDescription
snStringThe ID of a specified command record.

Request example

POST: /v1.0/electric-energy/6ce****/actions/switch
  "switchEnable": true

Return example

    "result": {
        "sn": "133****"
    "t": 1561456817168,
    "success": true

Error code

For more information, see error code.