Skip to main content

Control Devices by Traits

POST 

/devices/trait/execute

Control devices by traits. You can perform the following operations:

  • Update device attributes (such as switch, temperature, etc. For functionCode and traitCode, please refer to the /devices/definitions interface)
  • Reconnect device to a new room (functionCode="EndpointLabel", traitCode="EndpointRoom")
  • Rename device (functionCode="EndpointLabel", traitCode="EndpointName")

Request

Responses

Request succeeded. However, it does not mean all trait values were set successfully.
A code value of 0 indicates that at least some operations succeeded; a non-zero code indicates all failed.
If data is present, it indicates the set of traits that failed to be set; if not, all traits were set successfully.