Query Environmental Indicators of Devices

Last Updated on : 2023-06-15 05:40:46

Based on the asset ID, query the statistical data of various environmental indicators of the devices under the specified asset for the past seven days.

API address

GET: /v1.0/iot-03/assets/{asset_id}/devices/environment-statistics

Request parameter

Parameter name Type IN Required Description
asset_id String uri true The asset ID.
last_row_key String query false The last row key.

Return parameter

Parameter name Type Description
result DeviceEnvironmentStatisticsRes

Description of result

Parameter name Type Description
asset_name String The asset name.
devices List The list of devices.
last_row_key String The row key of the last piece of data on each page.
has_next Boolean Specifies whether to return the next page.

Description of devices

Parameter name Type Description
device_id String The device ID.
statistics_data List The statistical data.

Description of statistics_data

Parameter name Type Description
date String The statistical date.
values List The list of data points.

Description of values

Parameter name Type Description
code String The code of a specified indicator.
types List The list of statistical types.

Description of types

Parameter name Type Description
type String The statistical type, including avg, min, and max.
value String The statistical value.
unit String The unit of the statistical value.

Request example

GET: GET /v1.0/iot-03/assets/19237****74234/devices/environment-statistics?last_row_key=ad2fsw2dw

Return example

{ "result": { "last_row_key": "vdevo162676686854434", "devices": [ { "device_id": "6ce2041044d859508c****", "statistics_data": [ { "date": "20210721", "values": [ { "types": [ { "type": "avg", "unit": "", "value": "25.54" } ], "code": "bright_value" } ] }, { "date": "20210720", "values": [ { "types": [ { "type": "avg", "unit": "", "value": "29.55" } ], "code": "bright_value" } ] }, { "date": "20210719", "values": [ { "types": [ { "type": "avg", "unit": "", "value": "55.06" } ], "code": "bright_value" } ] } ] }, { "device_id": "6c41f233a8812ba234****", "statistics_data": [ { "date": "20210721", "values": [ { "types": [ { "type": "avg", "unit": "", "value": "1.46" } ], "code": "bright_value" } ] }, { "date": "20210720", "values": [ { "types": [ { "type": "avg", "unit": "", "value": "26.42" } ], "code": "bright_value" } ] }, { "date": "20210719", "values": [ { "types": [ { "type": "avg", "unit": "", "value": "118.33" } ], "code": "bright_value" } ] } ] } ], "asset_name": "Office", "has_next": false }, "t": 1626835082945, "success": true }

Error code

For more information, see error code.