---
name: "SmartGroupModel.onDeviceOnlineStatusUpdate"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.5.0" }
title: "onDeviceOnlineStatusUpdate"
---

## SmartGroupModel.onDeviceOnlineStatusUpdate

> [VERSION] @ray-js/panel-sdk >= 1.5.0

> 💡 In a group-device environment, onDeviceOnlineStatusUpdate will normally not fire because groups currently have no online-status change event.

### Description

Listen for smart group online status changes

### Parameters

`(listener: Function)`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `(data: OnlineStatusChanged) => number` | Yes | Event callback that receives parameters containing device online status and related information |

### Return Value

None


### Referenced Types

##### `type` OnlineStatusChanged

Device online/offline status change event callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `online` | `boolean` | Online status |
| `deviceId` | `string` | Device ID |
| `onlineType` | `number` | Device online type (reserved for future use) Wi-Fi online             1 << 0 Local online             1 << 1 Bluetooth LE online      1 << 2 Bluetooth LE mesh online 1 << 3 |


### Examples

#### Example

```typescript
const id = group.onDeviceOnlineStatusUpdate((data) => {
  console.log('Online status changed:', data);
});
// Unsubscribe when needed
group.offDeviceOnlineStatusUpdate(id);
```
