Query Devices in Home

Last Updated on : 2023-11-23 05:55:35download

Based on the home ID, query a list of devices in the specified home.

API address

GET: /v1.0/homes/{home_id}/devices

Request parameter

Parameter nameTypeINRequiredDescription
home_idLonguritrueThe home ID.

Return parameter

Parameter nameTypeDescription
resultListThe returned result.

Description of result

Parameter nameTypeDescription
idStringThe device ID.
uuidStringThe universally unique identifier (UUID) of the specified device.
uidStringThe user ID.
biz_typeIntegerThe application bizType.
nameStringThe device name.
time_zoneStringThe time zone.
ipStringThe IP address of the specified device.
local_keyStringThe secret key.
subBooleanIndicates whether it is a sub-device. Valid values:
  • true: yes.
  • false: no.
modelStringThe product model.
create_timeLongThe time when the device was first paired.
update_timeLongThe time when the device status was last updated.
active_timeLongThe time when the device was last paired.
statusListThe status of the specified device data point.
owner_idStringThe ID of the device owner.
product_idStringThe product ID.
product_nameStringThe product name.
categoryStringThe product category.
iconStringThe URL of the device icon.
onlineBooleanIndicates whether the device is online. Valid values:
  • true: The device is online.
  • false: The device is offline.
node_idStringThe node ID. When sub is true, this field applies to a sub-device.
latStringThe latitude.

Description of status

Parameter nameTypeDescription
codeStringThe code of the specified data point.
valueObjectThe value of the specified data point.

Request example

GET: /v1.0/homes/3196002/devices

Return example

{
    "tid": "cbe7c5807d3811eeaf40161d72836dc2",
    "result": [
        {
            "sub": false,
            "create_time": 1669898482,
            "local_key": "47b69****04f952",
            "owner_id": "16968315",
            "biz_type": 0,
            "ip": "",
            "icon": "smart/icon/ay1550298204274iXb1I/ce28b24ac1bf8f9b1beba4fadc37e***.png",
            "lon": "120.2961",
            "time_zone": "+08:00",
            "product_name": "Fingerbot Plus",
            "uuid": "tuyaa****f514d253",
            "active_time": 1669898482,
            "uid": "ay15913****50677KZlj2",
            "update_time": 1699339271,
            "product_id": "yii****7zh",
            "name": "Fingerbot Plus",
            "online": true,
            "model": "ADFB0301",
            "id": "6cf0ca9****ab76bfjntj",
            "category": "szjqr",
            "lat": "30.3663",
            "status": [
                {
                    "code": "switch",
                    "value": true
                },
                {
                    "code": "mode",
                    "value": "click"
                },
                {
                    "code": "arm_down_percent",
                    "value": 96
                }
            ]
        },
        {
            "sub": false,
            "create_time": 1669898437,
            "local_key": "bf69a****7e54779",
            "owner_id": "16****315",
            "biz_type": 0,
            "ip": "220.191.122.216",
            "icon": "smart/icon/ay1562803410690AUgvL/165491159782534db9***.png",
            "lon": "120.2655",
            "time_zone": "+08:00",
            "product_name": "Bluetooth Mesh Gateway",
            "uuid": "133530a****4bfc92fc",
            "active_time": 1669898437,
            "uid": "ay1591****0677KZlj2",
            "update_time": 1699061536,
            "product_id": "nowfs****fqwzudwr",
            "name": "Bluetooth Mesh Gateway",
            "online": true,
            "model": "JMWBG1",
            "id": "6c9f204****8cff47egj6w",
            "category": "wg2",
            "lat": "30.2210",
            "status": [
            ]
        }
    ],
    "t": 1699339338983,
    "success": true
}

Error code

For more information, see error code.