Skip to content

WebSocket API ​

The WebSocket API receives device events, refreshes one device state, and executes device operations over a long-lived connection.

When to Use WebSocket ​

  • Continuously observe online, offline, power lost, power restored, and peripheral-state changes
  • Refresh one device in response to a user action
  • Control relays or perform RS485 operations over an existing connection
  • Avoid high-frequency HTTP state polling

Use REST for device lists, pagination, device configuration reads, and command-result queries. See REST API vs WebSocket for selection guidance.

Connection Flow ​

  1. Call POST /wlte/v1/ws/ticket with an access token.
  2. Connect to GET /wlte/v1/ws?ticket={ticket} with the one-time ticket.
  3. Start Ping/Pong and session.ping.
  4. Listen for device events.
  5. Use device.state.get for one-device state queries.
  6. Use device.operation.execute for device operations.

Core Rules ​

  • Correlate request and reply with requestId.
  • Select device write operations with operation.name.
  • Replies use code, message, and optional data, matching REST semantics.
  • Events have no history replay. Query critical device state after reconnecting.
  • Configuration changes are not broadcast. Read relay jog duration and RS485 baud rate through the REST device-configuration endpoint.

See WebSocket Scope for the current topics and operations.

Docs buildVersion v1.6.3-20261020-171545-90
Copyright © 2026 WLTE