Skip to content

WebSocket Scope

WebSocket supports real-time single-device queries, device operations, and device events. Connection, authorization, and error rules are consistent across all topics.

Connection Endpoints

text
POST /wlte/v1/ws/ticket
GET  /wlte/v1/ws?ticket={ticket}

Request Topics

TopicDescription
session.pingApplication-level heartbeat
device.state.getRefresh and retrieve one device state
device.operation.executeExecute a device write operation

device.operation.execute currently supports:

operation.namePermissionDescription
device.relay.setdevice:controlControl one or multiple relays
device.rs485.transceivedevice:controlSend RS485 data and wait for a response
device.rs485.baudRate.setdevice:configSet the RS485 baud rate
device.relay.jogConfig.setdevice:configSet a relay jog duration

Event Topics

TopicDescription
device.connection.onlineDevice came online
device.connection.offlineDevice went offline
device.state.changedPeripheral state changed
device.power.lostDevice lost power
device.rs485.receivedRS485 data was received without a matching pending request

REST Consistency

ConceptRESTWebSocket
Success and failurecodecode
Response datadatadata
Idempotency keyIdempotency-Key headerdata.idempotencyKey
Request correlationHTTP request/responserequestId
Command objectdata.commanddata.command

Command objects consistently use operation, params, status, and an optional result. Use the command ID with the REST Get Command Result endpoint.

Configuration and State

  • device.state.changed is triggered by relay or digital-input state changes. changes identifies affected channels and peripherals carries the complete runtime state block.
  • Changes only to analog inputs or sensor readings do not trigger device.state.changed.
  • Relay jog duration and RS485 baud rate are device configuration and are not broadcast over WebSocket.
  • Use the REST Get Device Configuration endpoint when you need the current configuration.

Rules

  • Create a one-time wsTicket before connecting.
  • Correlate each request and reply by requestId.
  • Branch on code rather than message text.
  • WebSocket does not provide event history replay. Query important device state after reconnecting.
  • Ignore unknown event fields for forward compatibility.

Not Included

  • Historical event replay
  • Webhooks
  • Device group control
  • OTA
  • Advanced subscription rules

Next

Docs buildVersion v1.3.6-20260720-180213-70
Copyright © 2026 WLTE