Query Real-Time Environmental Indicators of Devices

Last Updated on : 2023-06-21 07:12:56download

Get the real-time data of environmental indicators of devices under the specified asset by asset ID, and display the data on multiple pages.

API address

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

Request parameter

Parameter nameTypeINRequiredDescription
asset_idStringuritrueThe asset ID.
last_row_keyStringqueryfalseThe device ID in the last entry on each page.

Return parameter

Parameter nameTypeDescription
resultEnvMonitorStatusRes

Description of result

Parameter nameTypeDescription
asset_nameStringThe asset name.
last_row_keyStringThe row key of the last piece of data on each page.
has_nextBooleanSpecifies whether to return the next page.
devicesListThe list of devices.

Description of devices

Parameter nameTypeDescription
device_idStringThe device ID.
statusListThe list of status.

Description of status

Parameter nameTypeDescription
codeStringThe code of a specified indicator.
valueStringThe indicator values.
unitStringThe unit of the indicator values.

Request example

GET: /v1.0/iot-03/assets/12389312***/devices/environment-status

Return example

{
    "result": {
        "last_row_key": "vdevo162676686854434",
        "devices": [
            {
                "device_id": "6ce2041044d859508c****",
                "status": [
                    {
                        "code": "bright_value",
                        "unit": "",
                        "value": "34"
                    }
                ]
            },
            {
                "device_id": "vdevo162676656009566",
                "status": [
                    {
                        "code": "co2_value",
                        "unit": "ppm",
                        "value": "0"
                    },
                    {
                        "code": "temp_current",
                        "unit": "℃",
                        "value": "-400"
                    },
                    {
                        "code": "pm25_value",
                        "unit": "",
                        "value": "0"
                    },
                    {
                        "code": "voc_value",
                        "unit": "ppm",
                        "value": "0"
                    },
                    {
                        "code": "ch2o_value",
                        "unit": "",
                        "value": "0"
                    }
                ]
            },
            {
                "device_id": "vdevo162676686854434",
                "status": [
                    {
                        "code": "temp_current",
                        "unit": "℃",
                        "value": "-400"
                    }
                ]
            },
            {
                "device_id": "vdevo162676653996073",
                "status": [
                    {
                        "code": "pm25_value",
                        "unit": "",
                        "value": "0"
                    },
                    {
                        "code": "temp_current",
                        "unit": "℃",
                        "value": "-400"
                    },
                    {
                        "code": "ch2o_value",
                        "unit": "ppm",
                        "value": "0"
                    },
                    {
                        "code": "voc_value",
                        "unit": "ppm",
                        "value": "0"
                    },
                    {
                        "code": "co2_value",
                        "unit": "ppm",
                        "value": "0"
                    }
                ]
            },
            {
                "device_id": "vdevo162676656689062",
                "status": [
                    {
                        "code": "bright_value",
                        "unit": "lux",
                        "value": "0"
                    }
                ]
            },
            {
                "device_id": "6c41f233a8812ba234****",
                "status": [
                    {
                        "code": "bright_value",
                        "unit": "",
                        "value": "4"
                    }
                ]
            },
            {
                "device_id": "vdevo162676653274517",
                "status": [
                    {
                        "code": "ch2o_value",
                        "unit": "ppm",
                        "value": "0"
                    },
                    {
                        "code": "temp_current",
                        "unit": "ppm",
                        "value": "-400"
                    },
                    {
                        "code": "humidity_current",
                        "unit": "%",
                        "value": "0"
                    },
                    {
                        "code": "pm25_value",
                        "unit": "ppm",
                        "value": "0"
                    },
                    {
                        "code": "voc_value",
                        "unit": "ppm",
                        "value": "0"
                    },
                    {
                        "code": "co2_value",
                        "unit": "ppm",
                        "value": "0"
                    }
                ]
            }
        ],
        "asset_name": "Office",
        "has_next": false
    },
    "t": 1626835152733,
    "success": true
}

Error code

For more information, see error code.