getDeviceInfo(params: Object)

Requires:
DeviceKit≥1.2.6@ray-js/ray≥0.6.23
Platforms:
iOSAndroid
import { device } from '@ray-js/ray';

const { getDeviceInfo } = device;

// Promise usage
try {
  const res = await getDeviceInfo({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Get device information

Parameters

PropertyTypeRequiredDescription
deviceIdstringYesdeviceId device ID Supports fetching other devices’ information across panels; the current panel can pass the current device’s ID to retrieve it
Nodps
complete() => voidNoCompletion callback (executed on both success and failure)
success(params: Object) => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
success callback parameters
PropertyTypeDescriptionDeviceKit Since
roomNamestringRoom name where the device is locatedv3.6.0
Contains product info, schema, and function definitionsv3.3.0
dps Device DP states; use the corresponding dpid to get specific state values for business logicv3.3.0
attributenumberattribute Product attribute definition. The corresponding configuration can be found on the backend-ng platform; managed via bitwise operations.v3.3.0
baseAttributenumberbaseAttribute Basic product attribute definitionsv3.5.0
capabilitynumbercapability 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.v3.3.0
dpName Custom name of the dp, typically used in the panelv3.3.0
abilitynumberability Seldom used; distinguishes special device typesv3.3.0
iconstringicon Device icon URLv3.3.0
devIdstringdevId Device unique IDv3.3.0
verSwstringverSw Device firmware versionv3.3.0
isSharebooleanisShare Whether the device is shared; true means sharedv3.3.0
bvstringbv Device baseline versionv3.3.0
uuidstringuuid Unique firmware identifierv3.3.0
panelConfig Configuration items in the product panel; usually viewable on the IoT platformv3.3.0
activeTimenumberactiveTime Device activation time, timestampv3.3.0
devAttributenumberdevAttribute Business capability extensions represented with bitwise flagsv3.3.0
pccstringpcc Classification identifier for Thing in-house Bluetooth mesh productsv3.3.0
nodeIdstringnodeId Short address of the sub-devicev3.3.0
parentIdstringparentId Parent node ID; typically present for sub-devices or Bluetooth Mesh devices, used internally to locate the related gateway or upstream model for processingv3.3.0
categorystringcategory Product categoryv3.3.0
standSchemaModel Standard product function set definition modelv3.3.0
productIdstringproductId Product ID of the devicev3.3.0
productVerstringproductVer Product version of the devicev4.3.6
bizAttributenumberbizAttribute Business attribute capabilityv3.3.0
meshIdstringmeshId Bluetooth Mesh ID for the devicev3.3.0
sigmeshIdstring[Deprecated] sigmeshId Bluetooth Mesh ID corresponding to the device's industry attributev3.3.0
meta Custom configuration meta attributes of the device, used to store business datav3.3.0
isLocalOnlinebooleanisLocalOnline Whether the device is online on the local LANv3.3.0
isCloudOnlinebooleanDevice cloud online statusv3.3.0
isOnlinebooleanisOnline Overall online status; if any state is online, the device is considered online (composite online status)v3.3.0
namestringname Device namev3.3.0
groupIdstringgroupId Group ID the device belongs to; empty string when not in a groupv3.3.0
dpCodes Standard function set codev3.3.0
devTimezoneIdstringTime zone informationv3.3.0
Execution time of the device's DPv3.3.0
latitudestringDevice latitudev3.3.0
longitudestringDevice longitudev3.3.0
ipstringDevice IP addressv3.3.0
isVirtualDevicebooleanWhether it is a virtual devicev3.3.0
isZigbeeInstallCodebooleanWhether this is a Zigbee Install Code gatewayv3.3.0
protocolAttributenumberSub-device activation capability flag bitv3.3.0
connectionStatusnumberConnection status, Nearby statusv3.3.0
macstringSome devices require a MAC for unique identification, e.g., Meshv3.3.0
bluetoothCapabilitystringBluetooth device capability value, reported by the devicev3.3.0
isTripartiteMatterbooleanWhether it is a third-party Matter devicev3.6.0
isGWbooleanWhether it is a gateway devicev3.6.0
isSupportGroupbooleanWhether groups are supportedv3.6.0
isZigBeeSubDevbooleanWhether it is a Zigbee sub-devicev3.6.0
cadvstringcadv version numberv3.6.0
isSupportOTAbooleanWhether the device supports OTAv3.6.0
iconUrlstringDevice iconv3.6.0
hasWifibooleanWhether the device has a Wi‑Fi modulev3.6.0
switchDpnumberQuick control dpv3.7.0
switchDpsnumber[]Quick control dpv3.7.0
wifiEnableStatenumberStatus of the device's Wi-Fi module: 1 = Unavailable, 2 = Availablev4.0.0
Device product configurationv4.0.0
isMatterbooleanWhether it is a Matter devicev4.0.0
isSupportLinkbooleanWhether the device supports dual controlv4.0.0
isSupportAppleHomeKitbooleanWhether the device supports being added to Apple Homev4.0.0
attributeStringstringattribute formatted binary string Product attribute definition. The corresponding configuration can be found on the backend-ng platform; managed via bitwise operations.v4.0.0
extModuleTypenumberType 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)v4.3.4
isRelayOpenbooleanWhether the mesh device's relay function is enabledv4.6.1
isProxyOpenbooleanWhether the mesh device's proxy function is enabledv4.6.1
isSupportProxyAndRelaybooleanWhether the mesh device supports proxy and relayv4.6.1
yuNetStatenumberDevice Dayu channel user enable status: 0 = disabled, 1 = enabledv4.11.0
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

device.getDeviceInfo({
  deviceId: "xx",
  dps: { "xx": {} },
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});