---
name: "getGroupDeviceList"
mode: "kit"
versionRequirements:
  - { name: "DeviceKit", version: "2.4.0" }
  - { name: "@ray-js/ray", version: "0.6.23" }
platform:
  - "iOS"
  - "Android"
async: true
title: "getGroupDeviceList - 获取群组下设备列表"
---

## getGroupDeviceList

> [VERSION] DeviceKit >= 2.4.0 | @ray-js/ray >= 0.6.23

> [PLATFORM] iOS, Android

> ⚡ **支持 Promise 调用** — 不传 success / fail / complete 回调时，该方法返回 Promise。

### 描述

获取群组下设备列表

### 参数

| 属性 | 类型 | 必填 | 默认值 | 最低版本 | 描述 |
| --- | --- | --- | --- | --- | --- |
| `groupId` | `string` | 是 | - | `2.4.0` | 群组id |
| `complete` | `() => void` | 否 | - | - | 接口调用结束的回调函数（调用成功、失败都会执行） |
| `success` | `(params: Object) => void` ↓见下方 | 否 | - | - | 接口调用成功的回调函数 |
| `fail` | `(params: Object) => void` ↓见下方 | 否 | - | - | 接口调用失败的回调函数 |

#### success 回调参数

| 属性 | 类型 | 最低版本 | 描述 |
| --- | --- | --- | --- |
| `groupId` | `string` | `3.3.0` | groupId 群组id |
| `deviceList` | `GroupControlDeviceInfo[]` | `3.3.0` | deviceList 设备列表 |

#### fail 回调参数

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `errorMsg` | `string` | 错误信息 |
| `errorCode` | `string \| number` | 错误码 |
| `innerError` | `Object` | 错误扩展 |

##### fail(params).innerError 的属性

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `errorCode` | `string \| number` | 错误扩展码 |
| `errorMsg` | `string` | 错误扩展信息 |


### 引用对象

##### `interface` GroupControlDeviceInfo

| 属性 | 类型 | 最低版本 | 描述 |
| --- | --- | --- | --- |
| `roomName` | `string` | `7.2.1` | 设备所处房间名 |
| `schema` | `Record<string, any>[]` | `3.3.0` | 产品信息，schema，功能定义都在里面 |
| `dps` | `Record<string, Record<string, any>>` | `3.3.0` | dps 设备的功能点状态，可以根据对应的 dpid 拿到具体的状态值去做业务逻辑 |
| `attribute` | `number` | `3.3.0` | attribute 产品属性定义，在 backend-ng 平台上可查到对应配置，使用二进制位运算的方式进行管理 |
| `baseAttribute` | `number` | `7.2.1` | baseAttribute 基础产品属性定义 |
| `capability` | `number` | `3.3.0` | capability 产品能力值，在 backend-ng 平台上可以查询对应的勾选项，整体业务逻辑会根据该数据进行划分 区分设备类型也可以根据该属性进行调整，按二进制位运算的方式进行管理 |
| `dpName` | `Record<string, string>` | `3.3.0` | dpName 自定义 dp 的名字，通常在面板里会使用到 |
| `ability` | `number` | `3.3.0` | ability 目前业务很少使用，用于区分特殊类型的设备 |
| `icon` | `string` | `3.3.0` | icon 设备的 icon url |
| `devId` | `string` | `3.3.0` | devId 设备的唯一 id |
| `verSw` | `string` | `3.3.0` | verSw 设备固件版本号 |
| `isShare` | `boolean` | `3.3.0` | isShare 是否为分享设备，true 则是分享设备 |
| `bv` | `string` | `3.3.0` | bv 设备的基线版本号 |
| `uuid` | `string` | `3.3.0` | uuid 设备的固件唯一标识 |
| `panelConfig` | `Record<string, Record<string, any>>` | `3.3.0` | panelConfig 产品面板里的配置项，通常在 IoT 平台上可以查看到对应的配置 |
| `activeTime` | `number` | `3.3.0` | activeTime 设备激活时间，时间戳 |
| `devAttribute` | `number` | `3.3.0` | devAttribute 设备的业务能力拓展，二进制位的方式进行运算 |
| `pcc` | `string` | `3.3.0` | pcc Thing自研蓝牙 mesh 产品的分类标识 |
| `nodeId` | `string` | `3.3.0` | nodeId 子设备的短地址 |
| `parentId` | `string` | `3.3.0` | parentId 上级节点 id，子设备/或蓝牙 mesh 设备通常会有该字段，用于内部寻找相关的网关或上级模型来进行业务处理 |
| `category` | `string` | `3.3.0` | category 产品的分类 |
| `standSchemaModel` | `Record<string, any>` | `3.3.0` | standSchemaModel 标准产品功能集定义模型 |
| `productId` | `string` | `3.3.0` | productId 设备对应的产品 id |
| `productVer` | `string` | `7.2.1` | productVer 设备对应的产品的版本号 |
| `bizAttribute` | `number` | `3.3.0` | bizAttribute 业务属性能力 |
| `meshId` | `string` | `3.3.0` | meshId Thing自研的蓝牙 mesh id |
| `sigmeshId` | `string` | `3.3.0` | sigmeshId 当前设备所属行业属性对应的蓝牙 mesh id |
| `meta` | `Record<string, Record<string, any>>` | `3.3.0` | meta 设备自定义配置元属性，用于存放业务数据 |
| `isLocalOnline` | `boolean` | `3.3.0` | isLocalOnline 本地局域网是否在线 |
| `isOnline` | `boolean` | `3.3.0` | isOnline 设备总的在线情况，只要一个情况在线，就是在线，复合在线情况 |
| `isCloudOnline` | `boolean` | `4.21.0` | isCloudOnline 设备云端在线情况 |
| `name` | `string` | `3.3.0` | name 设备名称 |
| `groupId` | `string` | `3.3.0` | groupId |
| `dpCodes` | `Record<string, Record<string, any>>` | `3.3.0` | dpCodes 标准功能集 code |
| `originJson` | `Record<string, Record<string, any>>` | `3.3.0` | 原始 json，业务来不及拓展更新的时候，可以根据这个来获取处理 |
| `devTimezoneId` | `string` | `7.2.1` | 时区信息 |
| `dpsTime` | `Record<string, Record<string, any>>` | `3.3.0` | 设备的功能点执行的时间 |
| `secCategory` | `string` | `4.13.1` | secCategory 二级品类 |
| `latitude` | `string` | `7.2.1` | 设备纬度 |
| `longitude` | `string` | `7.2.1` | 设备经度 |
| `ip` | `string` | `7.2.1` | 设备ip地址 |
| `isVirtualDevice` | `boolean` | `7.2.1` | 是否为虚拟设备 |
| `isZigbeeInstallCode` | `boolean` | `7.2.1` | zigbeeInstallCode to the cloud to mark the gateway with installation code ability |
| `protocolAttribute` | `number` | `7.2.1` | Activate sub-device capability flag. |
| `connectionStatus` | `number` | `7.2.1` | 连接状态，nearby状态 |
| `mac` | `string` | `7.2.1` | 部分设备需要用mac进行唯一识别 ，比如mesh |
| `bluetoothCapability` | `string` | `7.2.1` | 蓝牙的设备能力值，由设备进行上报 |
| `isTripartiteMatter` | `boolean` | `7.2.1` | 是否三方matter设备 |
| `isGW` | `boolean` | `7.2.1` | 是否网关设备 |
| `isSupportGroup` | `boolean` | `7.2.1` | 是否支持群组 |
| `isZigBeeSubDev` | `boolean` | `7.2.1` | 是否zigbee子设备 |
| `cadv` | `string` | `7.2.1` | cadv版本号 |
| `isSupportOTA` | `boolean` | `7.2.1` | 设备是否支持OTA |
| `iconUrl` | `string` | `7.2.1` | 设备图标 |
| `hasWifi` | `boolean` | `7.2.1` | 设备是否有Wi-Fi模块 |
| `switchDp` | `number` | `7.2.1` | 快捷控制dp |
| `switchDps` | `number[]` | `7.2.1` | 快捷控制dp |
| `wifiEnableState` | `number` | `7.2.1` | 设备Wi-Fi模块的状态：1:不可用 2:可用 |
| `configMetas` | `Record<string, Record<string, any>>` | `7.2.1` | 设备产品配置 |
| `isMatter` | `boolean` | `7.2.1` | 是否为matter设备 |
| `isSupportLink` | `boolean` | `7.2.1` | 设备是否支持双控 |
| `isSupportAppleHomeKit` | `boolean` | `7.2.1` | 是否支持将设备添加到苹果家庭中 |
| `attributeString` | `string` | `7.2.1` | attribute 格式化的二进制字符串 产品属性定义，在 backend-ng 平台上可查到对应配置，使用二进制位运算的方式进行管理 |
| `extModuleType` | `number` | `7.2.1` | 设备的扩展模块的类型 0：无扩展模块 1：表示存在扩展模块，即设备为ble+x的设备 2：扩展模块为Wi-Fi模块。即设备为ble+Wi-Fi的设备 |
| `isRelayOpen` | `boolean` | `7.2.1` | mesh设备的relay功能是否开启 |
| `isProxyOpen` | `boolean` | `7.2.1` | mesh设备的proxy功能是否开启 |
| `isSupportProxyAndRelay` | `boolean` | `7.2.1` | mesh设备是否支持proxy和relay功能 |
| `yuNetState` | `number` | `7.2.1` | 设备大禹通道用户启用状态，0-不启用，1-启用 |


### 示例代码

#### 基础调用

```tsx
import { device } from '@ray-js/ray'

const { getGroupDeviceList } = device;

getGroupDeviceList({
  groupId: 'example',
  success: (result) => {
    console.log('getGroupDeviceList success', result);
  },
  fail: (error) => {
    console.log('getGroupDeviceList fail', error.errorMsg);
  },
});
```
