---
name: "getDeviceDetailsById"
mode: "kit"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.5" }
---

## getDeviceDetailsById

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.5

### 描述

查看单个设备设备详情

### 参数

`Params`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `params` | `QueryGetDeviceDetailsById` | 是 | - | 请求体 |

### 引用对象

##### `type` QueryGetDeviceDetailsById

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `homeId` | `string` | 家庭 id |
| `uuid` | `string` | 设备 uuid |
| `categoryCode` | `string` | 业务分类 code |

##### `interface` PlanInfoDto

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `commodityCode` | `string` | 商品编码 |
| `commodityName` | `string` | 商品名称 |
| `env` | `number` | 环境标识 |
| `instanceId` | `string` | 实例 id（通常为设备 id） |
| `isSubscribe` | `0 \| 1` | 是否订阅商品（0 / 1） |
| `orderNo` | `number` | 排序序号 |
| `planStatus` | `1` | 套餐状态（如使用中） |
| `serviceBeginTime` | `number` | 服务开始时间 |
| `serviceEndTime` | `number` | 服务结束时间 |
| `stockId` | `string` | 库存 id |
| `isCanceled` | `0 \| 1` | 是否已退订（0 / 1） |
| `isAdditional` | `0 \| 1` | 是否加购/附加（0 / 1） |

##### `enum` DeviceBindStatus

| 枚举值 | 实际值 | 描述 |
| --- | --- | --- |
| `DeviceBindStatus.BINDING` | `1` | 已绑定 |
| `DeviceBindStatus.NOT_SUPPORT` | `2` | 不支持 |
| `DeviceBindStatus.NOT_BIND` | `3` | 未绑定 |


### 示例代码

#### 请求示例

```typescript
import { getDeviceDetailsById } from '@tuya-miniapp/cloud-api';

getDeviceDetailsById({
  homeId: '194137',
  uuid: 'vdevo176127325226099',
  categoryCode: 'ipc',
})
  .then((detail) => {
    console.log(detail);
  })
  .catch((err) => {
    console.error(err);
  });
```

#### 返回示例

```json
{
  "uuid": "vdevo176127325226099",
  "name": "示例摄像头",
  "iconUrl": "https://images.example.com/icon.png",
  "online": true
}
```
