Skip to content

Get Device State

Fetches the latest state of a single device. The server actively refreshes the device before responding. If the device is offline, the response contains the state from the last time it was online.

Use this endpoint when the caller explicitly needs the newest state for one device. For dashboards, bulk lists, and background sync, prefer List Devices.

Rate Limit

DimensionRuleOn Limit
Real-time refresh per deviceMaximum 1 request per 10 secondsReturns 429 RATE_LIMITED with Retry-After

Endpoint

http
GET /wlte/v1/devices/{deviceId}

Authorization Requirements

ScopeRequiredDescription
device:readYesRead the current state of a single device

Request

Full URL:

http
GET {baseUrl}/wlte/v1/devices/{deviceId}

Request headers:

http
Authorization: Bearer {accessToken}
Accept: application/json

Path parameters:

ParameterTypeRequiredRule
deviceIdstringYesMust not be empty

Success Response

HTTP status:

text
200 OK

Response body:

json
{
  "code": "SUCCESS",
  "message": "OK.",
  "requestId": "req_001",
  "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-29T10:28:45.258Z"
  }
}

Response Rules

  • When the device is online, the response reflects the state after the current refresh
  • When the device is offline, the response contains the state from the last time it was online; status is OFFLINE and stateUpdatedAt reflects the last update time
  • A single sensor interface may return multiple measurement types at the same index. Use index + type as the composite key

Response data Schema

FieldTypeRequiredDescription
deviceIdstringYesUnique device identifier
namestringYesDevice display name
deviceTypestringYesDevice capability type code used to identify the device capability profile
statusstringYesDevice connectivity status. Enum: ONLINE, OFFLINE
peripheralsobjectNoCurrent device peripheral state
peripherals.relaysarray<RelayState>NoRelay state list. See Relay Outputs
peripherals.digitalInputsarray<DigitalInputState>NoDigital input state list. See Digital Inputs
peripherals.sensorsarray<SensorState>NoSensor reading list. See Sensor Readings
peripherals.analogInputsarray<AnalogInputState>NoAnalog input reading list. See Analog Input Readings
stateUpdatedAtstringYesDevice state update time in RFC3339 UTC

Notes:

  • When deviceType returns UNSUPPORTED, no OpenAPI device type definition is currently available for that device, so it cannot be integrated through the standard capability model yet

Error Responses

Possible responses:

  • 400 INVALID_REQUEST
  • 401 AUTH_REQUIRED
  • 401 AUTH_INVALID
  • 401 AUTH_EXPIRED
  • 403 AUTH_SCOPE_DENIED
  • 404 DEVICE_NOT_FOUND
  • 429 RATE_LIMITED
  • 503 GATEWAY_UNAVAILABLE
  • 504 DEVICE_TIMEOUT

429 RATE_LIMITED Response Body

When the rate limit is triggered, the response includes a data field and a Retry-After header:

json
{
  "code": "RATE_LIMITED",
  "message": "Too many requests",
  "requestId": "req_001",
  "data": {
    "retryAfterSeconds": 10
  }
}

retryAfterSeconds carries the same value as the Retry-After response header, in seconds.

Docs buildVersion v1.2.19-20260602-174859-60
Copyright © 2026 WLTE