上报测点信息(HTTP)

上报测点数据使用的topic与MQTT协议一致,即/sys/{productKey}/{deviceKey}/thing/measurepoint/post

上报数据的完整URL格式为https://{HTTP_Broker_URL}/topic/sys/{productKey}/{deviceKey}/thing/measurepoint/post。其中:

  • {productKey}为设备的product key。
  • {deviceKey}为设备的device key。

上报数据请求示例

POST /topic/sys/{ProductKey}/{DeviceKey}/thing/measurepoint/post HTTP/1.1
Host: {HTTP_Broker_URL}
Query-Parameter: sessionId={SessionId}
Content-Type: application/json
body:
{
    "id":"123",
    "version":"1.0",
    "params":{
        "measurepoints":{
            "Power":{
                "value":1,
                "quality":9
            },
            "temp":1.02,
            "branchCurr":[
                "1.02",
                "2.02",
                "7.93"
            ]
        },
        "time":123456
    },
    "method":"thing.measurepoint.post"
}

返回结果示例

body:
{
    "id":"123",
    "code":200,
    "data":{}
}

以上示例中,各参数的说明以及结果返回码信息,参考基于MQTT的设备连接的上报单个测点信息的参数说明和结果返回码。