小程序设备详情

Last Updated on : 2023-06-20 13:08:23download

本文介绍小程序设备详情的 API。

接口描述

用于获取设备详情信息,包括拓扑信息、共享信息、固件升级信息

接口地址

GET: /v1.0/device/detail/wx-applet/{device_id}

请求参数

参数名 类型 参数位置 是否必填 说明
device_id String uri true 设备ID

返回参数

参数名 类型 说明
result AppletDeviceRes 设备详情返回值

result 说明

参数名 类型 说明
dev_id String 设备id
uuid String 通用唯一标识码
mac String 局域网地址
runtime_env String 局域网地址
local_key String 设备密钥
name String 设备名称
timezone_id String 时区id
active_time Long 激活时间
icon_url String 设备图片
product_id String 产品id
owner_id String 家庭id
cloud_online Boolean 云端在线状态
virtual Boolean 是否为虚拟设备
dev_key String sigmesh通信加密key
gateway_ver_c_a_d String 主通讯模块三方协作版本
meta String 设备元属性集
base_attribute Long 基础能力标位
protocol_attribute Long 支持接入的协议方式
dev_attribute Integer 设备能力
low_power_modules List 支持低功耗模块列表
skills String Skills
ip String 网际协议地址
lon String 经度
lat String 纬度
device_topo TopoVO 设备拓扑数据
data_point_info DataPointInfoVO 功能点数据
share_info SharedInfoVO 设备共享数据
communication CommunicationVO 通信能力
ota_info OTAInfoVO 固件升级信息

data_point_info 说明

参数名 类型 说明
dps String 功能点及对应数值 (dp点)
dps_time String 功能点执行时间
dp_max_time Long 最近一次dp上报时间,用于低功耗设备区分是否在线(老版本使用)
dp_name String dp自定义名称

ota_info 说明

参数名 类型 说明
support_auto Boolean 是否支持自动升级
ota_upgrade_modes List 支持OTA升级方式
ota_module_map String ota模块信息集

share_info 说明

参数名 类型 说明
is_share Boolean 是否为共享设备

device_topo 说明

参数名 类型 说明
node_id String 设备在mesh中的短地址
mesh_id String mesh网络id
parent_dev_id String 上级设备id

communication 说明

参数名 类型 说明
communication_modes List 通讯方式
connection_status Integer 连接状态
communication_node String 通信节点

communication_modes 说明

参数名 类型 说明
type Integer 通讯类型
pv String 通讯类型

请求示例

GET: /v1.0/device/detail/wx-applet/xxxxtest
{ "dev_id": "6c5827atjdqlxh5n" }

返回示例

{ "result": { "cloud_online": false, "icon_url": "https://images.tuyacn.com/smart/icon/bay1607913062145Fl54/041f7e5e334c7acfb3cb5a8b42319e3b.png", "dev_key": "", "virtual": false, "runtime_env": "pre", "dev_attribute": 0, "local_key": "81d5b8bfe045603c", "owner_id": "36681576", "ip": "", "lon": "", "gateway_ver_c_a_d": "", "uuid": "20411d1e0737cc1c", "mac": "DC234D36F217", "dev_id": "6c5827atjdqlxh5n", "active_time": 1635241336, "data_point_info": { "dp_name": { }, "dps": { "13": 0, "14": 0, "15": 0, "16": "charging", "17": 10, "18": "male", "19": 10, "1": true, "2": false, "3": "free_jump", "4": 0, "5": 0, "7": 0, "8": 0, "9": 0 }, "dp_max_time": 1635244502372, "dps_time": { "13": 1635241336771, "14": 1635241336771, "15": 1635241336771, "16": 1635244502372, "17": 1635241336771, "18": 1635241336771, "19": 1635241336771, "1": 1635242389241, "2": 1635242389241, "3": 1635241336771, "4": 1635241336771, "5": 1635241336771, "7": 1635241336771, "8": 1635241336771, "9": 1635241336771 } }, "base_attribute": 0, "ota_info": { "ota_module_map": { "bluetooth": { "ver_sw": "0.1", "upgrade_status": 0, "bv": "1.0", "cdv": "" }, "mcu": { "ver_sw": "0.1", "upgrade_status": 0, "cdv": "" } }, "support_auto": true }, "product_id": "xx7va6m7", "name": "智能跳绳 4", "timezone_id": "", "communication": { "connection_status": 1, "communication_modes": [ { "pv": "3.3", "type": 3 }, { "pv": "", "type": 0 }, { "pv": "", "type": 1 } ] }, "lat": "" }, "t": 1635252686803, "success": true }

错误码

参考 错误码