---
name: "getDeviceInfo"
mode: "kit"
versionRequirements:
  - { name: "DeviceKit", version: "1.2.6" }
  - { name: "@ray-js/ray", version: "0.6.23" }
platform:
  - "iOS"
  - "Android"
async: true
---

## getDeviceInfo

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

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Get device information

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `deviceId` | `string` | Yes | - | `4.11.0` | deviceId device ID Supports fetching other devices’ information across panels; the current panel can pass the current device’s ID to retrieve it |
| `dps` | `Record<string, Record<string, any>>` | No | - | `4.11.0` | dps |
| `complete` | `() => void` | No | - | - | Completion callback (executed on both success and failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `roomName` | `string` | `3.6.0` | Room name where the device is located |
| `schema` | `Record<string, any>[]` | `3.3.0` | Contains product info, schema, and function definitions |
| `dps` | `Record<string, Record<string, any>>` | `3.3.0` | dps Device DP states; use the corresponding dpid to get specific state values for business logic |
| `attribute` | `number` | `3.3.0` | attribute Product attribute definition. The corresponding configuration can be found on the backend-ng platform; managed via bitwise operations. |
| `baseAttribute` | `number` | `3.5.0` | baseAttribute Basic product attribute definitions |
| `capability` | `number` | `3.3.0` | capability Product capability value. On the backend-ng platform you can query the corresponding selections; overall business logic is partitioned based on this data. Device types can also be adjusted based on this attribute; managed using bitwise operations. |
| `dpName` | `Record<string, string>` | `3.3.0` | dpName Custom name of the dp, typically used in the panel |
| `ability` | `number` | `3.3.0` | ability Seldom used; distinguishes special device types |
| `icon` | `string` | `3.3.0` | icon Device icon URL |
| `devId` | `string` | `3.3.0` | devId Device unique ID |
| `verSw` | `string` | `3.3.0` | verSw Device firmware version |
| `isShare` | `boolean` | `3.3.0` | isShare Whether the device is shared; true means shared |
| `bv` | `string` | `3.3.0` | bv Device baseline version |
| `uuid` | `string` | `3.3.0` | uuid Unique firmware identifier |
| `panelConfig` | `Record<string, Record<string, any>>` | `3.3.0` | panelConfig Configuration items in the product panel; usually viewable on the IoT platform |
| `activeTime` | `number` | `3.3.0` | activeTime Device activation time, timestamp |
| `devAttribute` | `number` | `3.3.0` | devAttribute Business capability extensions represented with bitwise flags |
| `pcc` | `string` | `3.3.0` | pcc Classification identifier for Thing in-house Bluetooth mesh products |
| `nodeId` | `string` | `3.3.0` | nodeId Short address of the sub-device |
| `parentId` | `string` | `3.3.0` | parentId Parent node ID; typically present for sub-devices or Bluetooth Mesh devices, used internally to locate the related gateway or upstream model for processing |
| `category` | `string` | `3.3.0` | category Product category |
| `standSchemaModel` | `Record<string, any>` | `3.3.0` | standSchemaModel Standard product function set definition model |
| `productId` | `string` | `3.3.0` | productId Product ID of the device |
| `productVer` | `string` | `4.3.6` | productVer Product version of the device |
| `bizAttribute` | `number` | `3.3.0` | bizAttribute Business attribute capability |
| `meshId` | `string` | `3.3.0` | meshId Bluetooth Mesh ID for the device |
| `sigmeshId` | `string` | `3.3.0` | [Deprecated] sigmeshId Bluetooth Mesh ID corresponding to the device's industry attribute |
| `meta` | `Record<string, Record<string, any>>` | `3.3.0` | meta Custom configuration meta attributes of the device, used to store business data |
| `isLocalOnline` | `boolean` | `3.3.0` | isLocalOnline Whether the device is online on the local LAN |
| `isCloudOnline` | `boolean` | `3.3.0` | Device cloud online status |
| `isOnline` | `boolean` | `3.3.0` | isOnline Overall online status; if any state is online, the device is considered online (composite online status) |
| `name` | `string` | `3.3.0` | name Device name |
| `groupId` | `string` | `3.3.0` | groupId Group ID the device belongs to; empty string when not in a group |
| `dpCodes` | `Record<string, Record<string, any>>` | `3.3.0` | dpCodes Standard function set code |
| `devTimezoneId` | `string` | `3.3.0` | Time zone information |
| `dpsTime` | `Record<string, Record<string, any>>` | `3.3.0` | Execution time of the device's DP |
| `latitude` | `string` | `3.3.0` | Device latitude |
| `longitude` | `string` | `3.3.0` | Device longitude |
| `ip` | `string` | `3.3.0` | Device IP address |
| `isVirtualDevice` | `boolean` | `3.3.0` | Whether it is a virtual device |
| `isZigbeeInstallCode` | `boolean` | `3.3.0` | Whether this is a Zigbee Install Code gateway |
| `protocolAttribute` | `number` | `3.3.0` | Sub-device activation capability flag bit |
| `connectionStatus` | `number` | `3.3.0` | Connection status, Nearby status |
| `mac` | `string` | `3.3.0` | Some devices require a MAC for unique identification, e.g., Mesh |
| `bluetoothCapability` | `string` | `3.3.0` | Bluetooth device capability value, reported by the device |
| `isTripartiteMatter` | `boolean` | `3.6.0` | Whether it is a third-party Matter device |
| `isGW` | `boolean` | `3.6.0` | Whether it is a gateway device |
| `isSupportGroup` | `boolean` | `3.6.0` | Whether groups are supported |
| `isZigBeeSubDev` | `boolean` | `3.6.0` | Whether it is a Zigbee sub-device |
| `cadv` | `string` | `3.6.0` | cadv version number |
| `isSupportOTA` | `boolean` | `3.6.0` | Whether the device supports OTA |
| `iconUrl` | `string` | `3.6.0` | Device icon |
| `hasWifi` | `boolean` | `3.6.0` | Whether the device has a Wi‑Fi module |
| `switchDp` | `number` | `3.7.0` | Quick control dp |
| `switchDps` | `number[]` | `3.7.0` | Quick control dp |
| `wifiEnableState` | `number` | `4.0.0` | Status of the device's Wi-Fi module: 1 = Unavailable, 2 = Available |
| `configMetas` | `Record<string, Record<string, any>>` | `4.0.0` | Device product configuration |
| `isMatter` | `boolean` | `4.0.0` | Whether it is a Matter device |
| `isSupportLink` | `boolean` | `4.0.0` | Whether the device supports dual control |
| `isSupportAppleHomeKit` | `boolean` | `4.0.0` | Whether the device supports being added to Apple Home |
| `attributeString` | `string` | `4.0.0` | attribute formatted binary string Product attribute definition. The corresponding configuration can be found on the backend-ng platform; managed via bitwise operations. |
| `extModuleType` | `number` | `4.3.4` | Type of the device's expansion module 0: No expansion module 1: An expansion module exists (device is BLE+X) 2: Expansion module is a Wi-Fi module (device is BLE+Wi-Fi) |
| `isRelayOpen` | `boolean` | `4.6.1` | Whether the mesh device's relay function is enabled |
| `isProxyOpen` | `boolean` | `4.6.1` | Whether the mesh device's proxy function is enabled |
| `isSupportProxyAndRelay` | `boolean` | `4.6.1` | Whether the mesh device supports proxy and relay |
| `yuNetState` | `number` | `4.11.0` | Device Dayu channel user enable status: 0 = disabled, 1 = enabled |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Error extension code |
| `errorMsg` | `string` | Error extension message |


### Examples

#### Basic usage

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

const { getDeviceInfo } = device;

getDeviceInfo({
  deviceId: 'device_001',
  success: (result) => {
    console.log('getDeviceInfo success', result);
  },
  fail: (error) => {
    console.log('getDeviceInfo fail', error.errorMsg);
  },
});
```
