Update Industrial Device

Last Updated on : 2023-06-21 07:13:12download

Update the data of an industrial device that is connected to Tuya's IoT cloud services.

API address

PUT: /v1.1/iot-03/si/devices/{device_code}

Request parameter

Parameter nameTypeINRequiredDescription
device_codeStringuritrueThe code of a specified device.

Description of body

Parameter nameTypeINRequiredDescription
device_nameString trueThe device name.
device_type_codeString trueThe code of a specified device type.
device_model_codeString trueThe code of a specified device model.
customer_codeString falseThe code of a specified customer.
production_timeLong falseThe production time.
batch_numberString falseThe device batch number.
sale_timeLong falseThe sales time.
sale_addressString falseThe detailed sales address.
sale_longitudeString falseThe longitude of a specified sales address.
sale_latitudeString falseThe latitude of a specified sales address.
real_time_positioningBoolean falseIndicates whether the device can be located in real time.
device_propertiesList falseThe special attributes of a specified device.

Description of device_properties

Parameter nameTypeINRequiredDescription
nameString falseThe name of a specified attribute.
codeString falseThe code of a specified attribute.
valueString falseThe value of a specified attribute.

Return parameter

Parameter nameTypeDescription
resultBooleanThe returned result.

Request example

PUT: /v1.1/iot-03/si/devices/C1
{
  "device_name": "Machine Tool",
  "device_type_code": "mac",
  "device_model_code": "mac001",
  "customer_code": "VIP001",
  "production_time": 1637204299000,
  "batch_number": "1",
  "sale_time": 1637204299000,
  "sale_address": "Zhejiang***",
  "sale_longitude": "12***",
  "sale_latitude": "3***",
  "real_time_positioning": true,
  "device_properties": [
    {
      "name": "Height",
      "code": "high",
      "value": "300"
    }
  ]
}

Return example

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

Error code

For more information, see error code.