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
| Topic | Description |
|---|---|
session.ping | Application-level heartbeat |
device.state.get | Refresh and retrieve one device state |
device.operation.execute | Execute a device write operation |
device.operation.execute currently supports:
operation.name | Permission | Description |
|---|---|---|
device.relay.set | device:control | Control one or multiple relays |
device.rs485.transceive | device:control | Send RS485 data and wait for a response |
device.rs485.baudRate.set | device:config | Set the RS485 baud rate |
device.relay.jogConfig.set | device:config | Set a relay jog duration |
Event Topics
| Topic | Description |
|---|---|
device.connection.online | Device came online |
device.connection.offline | Device went offline |
device.state.changed | Peripheral state changed |
device.power.lost | Device lost power |
device.rs485.received | RS485 data was received without a matching pending request |
REST Consistency
| Concept | REST | WebSocket |
|---|---|---|
| Success and failure | code | code |
| Response data | data | data |
| Idempotency key | Idempotency-Key header | data.idempotencyKey |
| Request correlation | HTTP request/response | requestId |
| Command object | data.command | data.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.changedis triggered by relay or digital-input state changes.changesidentifies affected channels andperipheralscarries 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
wsTicketbefore connecting. - Correlate each
requestandreplybyrequestId. - Branch on
coderather thanmessagetext. - 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
