Skip to content

Get Device Status

Query the current device state of a specified device over a WebSocket connection.

Topic

text
device.status.get

Permission

Required:

text
device:read

Request

json
{
  "type": "request",
  "requestId": "req_status_001",
  "topic": "device.status.get",
  "data": {
    "deviceId": "abc123456789"
  }
}

Request data Schema

FieldTypeRequiredDescription
deviceIdstringYesUnique device identifier

Reply

json
{
  "type": "reply",
  "requestId": "req_status_001",
  "topic": "device.status.get",
  "success": true,
  "data": {
    "deviceId": "abc123456789",
    "name": "YourDeviceName",
    "deviceType": "SM4_T_TH",
    "status": "ONLINE",
    "peripherals": {
      "relays": [
        {
          "index": 1,
          "on": false
        },
        {
          "index": 2,
          "on": false
        },
        {
          "index": 3,
          "on": true
        },
        {
          "index": 4,
          "on": false
        }
      ],
      "digitalInputs": [
        {
          "index": 1,
          "active": false
        },
        {
          "index": 2,
          "active": false
        },
        {
          "index": 3,
          "active": false
        },
        {
          "index": 4,
          "active": false
        }
      ],
      "sensors": [
        {
          "index": 1,
          "type": "TEMP",
          "value": 30.4,
          "unit": "C",
          "status": "ONLINE"
        },
        {
          "index": 2,
          "type": "TEMP",
          "value": 32.6,
          "unit": "C",
          "status": "ONLINE"
        },
        {
          "index": 2,
          "type": "HUMI",
          "value": 54,
          "unit": "%",
          "status": "ONLINE"
        }
      ]
    },
    "stateUpdatedAt": "2026-04-03T00:41:44Z"
  }
}

Rules

  • data directly reuses the Device schema from REST Get Device
  • stateUpdatedAt uses RFC3339 UTC
  • peripherals is the current hardware status snapshot; clients should replace it as a full block

Errors

Possible responses:

  • INVALID_REQUEST
  • AUTH_SCOPE_DENIED
  • DEVICE_NOT_FOUND
  • RATE_LIMITED
  • INTERNAL_ERROR
Docs buildVersion v1.2.19-20260602-174859-60
Copyright © 2026 WLTE