设备接入 IOTDA-配置设备影子预期数据:请求示例

时间:2024-06-28 09:24:58

请求示例

  • 配置设备影子预期数据,temperature的期望值为60。

    PUT https://{endpoint}/v5/iot/{project_id}/devices/{device_id}/shadow
    
    {
      "shadow" : [ {
        "service_id" : "WaterMeter",
        "desired" : {
          "temperature" : "60"
        },
        "version" : 1
      } ]
    }
  • 删除设备影子预期数据,将设备影子中属性temperature的期望值删除。

    PUT https://{endpoint}/v5/iot/{project_id}/devices/{device_id}/shadow
    
    {
      "shadow" : [ {
        "service_id" : "WaterMeter",
        "desired" : {
          "temperature" : null
        },
        "version" : 2
      } ]
    }
support.huaweicloud.com/api-iothub/iot_06_v5_0072.html