Updated on 2023-02-16 GMT+08:00

Gateway Reporting Device Properties in Batches

Function

This API is used by a gateway to report property data of multiple child devices in batches to the platform.

For differences between property reporting and message reporting, see Message Communications Overview.

A gateway can report the properties of a maximum of 100 child devices in each batch. If the number of child devices exceeds 100, you are advised to report their properties in different batches.

Topic

Upstream: $oc/devices/{device_id}/sys/gateway/sub_devices/properties/report

Parameters

Parameter

Mandatory or Optional

Type

Description

devices

Mandatory

List<DeviceProperty>

Indicates the device data.

DeviceService structure

Parameter

Mandatory or Optional

Type

Description

device_id

Mandatory

String

Identifies a device.

services

Mandatory

List<ServiceProperty>

Indicates a list of device services.

ServiceProperty structure

Parameter

Mandatory or Optional

Type

Description

service_id

Mandatory

String

Identifies a service of the device.

properties

Mandatory

Object

Indicates the property list of the device service. Multiple property parameters can be defined in the product model associated with the device.

event_time

Optional

String

Indicates the UTC time when the device collects data. The value is in the format of yyyyMMdd'T'HHmmss'Z' or yyyy-MM-dd'T'HH:mm:ss.SSS'Z', for example, 20161219T114920Z or 2020-08-12T12:12:12.333Z.

If this parameter is not carried in the reported data or is in incorrect format, the time when the platform receives the data is used.

Example

Topic: $oc/devices/{device_id}/sys/gateway/sub_devices/properties/report
Data format:
{ 
    "devices":[ 
        { 
            "device_id":"bf40f0c4-4022-41c6-a201-c5133122054a", 
            "services":[ 
                { 
                    "service_id":"analog", 
                    "properties":{ 
                        "PhV_phsA":"1", 
                        "PhV_phsB":"2" 
                    }, 
                    "event_time":"20190606T121212Z" 
                }
            ] 
        }, 
        { 
            "device_id":"42aa08ea-84c1-4025-a7b2-c1f6efe547c2", 
            "services":[ 
                { 
                    "service_id":"analog", 
                    "properties":{ 
                        "PhV_phsA":"3", 
                        "PhV_phsB":"5" 
                    }, 
                    "event_time":"20190606T121212Z" 
                }, 
                { 
                    "service_id":"parameter", 
                    "properties":{ 
                        "Load":"6", 
                        "ImbA_strVal":"8" 
                    }, 
                    "event_time":"20190606T121212Z" 
                } 
            ] 
        } 
    ] 
}