---
name: "getZigbeeLocalGroupDeviceList"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.2" }
title: "getZigbeeLocalGroupDeviceList - 获取可以加入 Zigbee 遥控器群组的设备列表"
---

## getZigbeeLocalGroupDeviceList

> [VERSION] @ray-js/ray >= 1.5.2

### 描述

获取可以加入 Zigbee 遥控器群组的设备列表

### 参数

`Params`

| 参数 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `params` | `IGetZigbeeLocalGroupDeviceList` | 是 | 请求参数 |

### 返回值

类型: `Promise<IZigbeeLocalGroupDevice[]>`

设备列表数组，每个元素包含 productId、devId、devOnline、devName 等设备信息

##### IZigbeeLocalGroupDevice

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `productId` | `string` | 设备产品 id |
| `devId` | `string` | 设备 id |
| `devOnline` | `boolean` | 设备在线状态 |
| `devName` | `string` | 设备名称 |
| `iconUrl` | `string` | 设备背景图片 |
| `checked` | `boolean` | 是否选中 |
| `nodeId` | `string` | 如果是子设备，会返回子设备对应的 nodeId |
| `gwId` | `string` | 网关 id |
| `gwName` | `string` | 网关名称 |
| `gwOnline` | `boolean` | 网关是否在线 |

### 引用对象

##### `interface` IGetZigbeeLocalGroupDeviceList

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `devId` | `string` | 遥控器的设备 ID |
| `meshId` | `string` | 遥控器的网关 id |
| `categoryCode` | `string` | 分组 Code，遥控器可支持多个群组，与 localId 匹配范围为 7001-7008； localId 为云端分配，步长为 8，因此一个遥控器内部最多支持关联 8 个群组，localId 为初始值依次+1，与之匹配的 categoryCode 从 7001 依次 +1。 可以通过 getZigbeeLocalGroupRelation 获取 |
| `homeId` | `string` | 家庭 id，可以通过 getCurrentHomeInfo 获取 |


### 示例代码

#### 基础用法

```ts
import { getZigbeeLocalGroupDeviceList } from '@ray-js/ray';

getZigbeeLocalGroupDeviceList({
  devId: 'your_device_id',
  meshId: 'gateway_mesh_id',
  categoryCode: '7001',
  homeId: 'your_home_id',
}).then((response) => {
  console.log('设备列表:', response);
}).catch((err) => {
  console.error(err);
});
```
