设备物模型属性为可写状态,用于设备端收到平台下发的修改属性指令后进行回复。
前提
平台调用 API 接口发送修改属性指令到设备。
设备已连接,连接详情参见设备上线。
Topic
/{productId}/{deviceId}/properties/write/reply
方向:上行
上行Body
json
{
"messageId":"下发body中的messageId",
"properties":{
"下行body属性标识":"属性值"
},
"success":true
}
{
"messageId":"下发body中的messageId",
"properties":{
"下行body属性标识":"属性值"
},
"success":true
}
请求结果
平台记录的设备属性值显示为设备回复值。
示例
- 设备端收到平台下发的读取属性指令。
Topic: /testMQTT/one/properties/write
方向:下行(平台下发)
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"
}
- 设备端进行回复。
Topic: /testMQTT/one/properties/write/reply
方向:上行
json
{
"messageId":"1701486524030324737",
"properties":{
"number":1
},
"success":true,
"timestamp": 1694500864325
}
{
"messageId":"1701486524030324737",
"properties":{
"number":1
},
"success":true,
"timestamp": 1694500864325
}
修改成功后,显示在平台的运行状态页面