Skip to content

读取设备状态回复

更新时间:

用于设备端收到平台下发的读取属性指令后进行回复。

前提

  • 平台调用 API 接口发送读取属性指令到设备。

  • 设备已连接,连接详情参见设备上线

Topic

/{productId}/{deviceId}/properties/read/reply

方向:上行

上行Body

json
{
  "messageId":"下发body中的messageId",
  "deviceId":"设备id",
  "properties":{
    "下行body属性标识":"属性值"
  } ,
  "success":true
}
{
  "messageId":"下发body中的messageId",
  "deviceId":"设备id",
  "properties":{
    "下行body属性标识":"属性值"
  } ,
  "success":true
}

请求结果

平台记录的设备属性值显示为设备回复值。

示例

  1. 设备端收到平台下发的读取属性指令。

Topic: /testMQTT/one/properties/read

方向:下行(平台下发)

json
{
  "headers":{
    "deviceName":"one",
    "productName":"testMQTT",
    "productId":"testMQTT",
    "_uid":"AYmwg4H2-Cnkb4JQfWy1nO4j-RDyOVQX",
    "creatorId":"1199596756811550720",
    "traceparent":"00-9cadced9ef7acc7b5ee92247e24cff06-7cbee56572962fb4-01"
  },
  "messageId":"1686313972204158977",
  "deviceId":"one",
  "timestamp":1690883555829,
  "properties":["real_state_ram_usage_rate"],
  "messageType":"READ_PROPERTY"
}
{
  "headers":{
    "deviceName":"one",
    "productName":"testMQTT",
    "productId":"testMQTT",
    "_uid":"AYmwg4H2-Cnkb4JQfWy1nO4j-RDyOVQX",
    "creatorId":"1199596756811550720",
    "traceparent":"00-9cadced9ef7acc7b5ee92247e24cff06-7cbee56572962fb4-01"
  },
  "messageId":"1686313972204158977",
  "deviceId":"one",
  "timestamp":1690883555829,
  "properties":["real_state_ram_usage_rate"],
  "messageType":"READ_PROPERTY"
}
  1. 设备端进行回复。

Topic: /testMQTT/one/properties/read/reply

方向:上行

json
{
  "messageId":"1686626764239482881",
  "deviceId":"one",
  "properties":{
    "real_state_ram_usage_rate":"100"
  },
  "success":true
}
{
  "messageId":"1686626764239482881",
  "deviceId":"one",
  "properties":{
    "real_state_ram_usage_rate":"100"
  },
  "success":true
}