WebSocket API Playground
You can directly test the Aqara Studio WebSocket channel on this page. Customize the host, connect to your Studio endpoint, send AuthRequest, ping, and subscription messages, and view push event responses in real time.
Usage Recommendations
- First, select either the local network environment or remote access environment in the "Connect" section, then modify the Host address as needed.
- Since browsers' native WebSocket does not support custom handshake
Authorizationheaders, it is recommended to enable the option to automatically send anAuthRequestto complete authentication with the first message. In theTokeninput box, just enter the Token obtained from Aqara Studio; the playground will automatically assemble the authentication content asBearer <Token>. - If your Studio exposes a non-default path, you can further modify the
Path; the default contract path is/open/ws. - To keep the WebSocket connection alive, the client should regularly send
PingRequestor other business messages, and at least one message should be sent every 30 seconds; if there are no outbound messages within 30 seconds, the connection will be closed. - After a successful connection, you can use the message editor to load sample messages such as
SubscribeAllRequestandSubscribeTraitValueRequest, modify them as needed, and then send them directly for testing. TraitValueUpdate,objectEvent, andErrorMessagewill appear in real time in the log area for easy verification of subscription results.
Authentication Instructions
The original AsyncAPI contract supports two authentication methods: handshake header Authorization: Bearer <accessToken> and AuthRequest as the first message after connection. Due to browser environment limitations, this page mainly covers the second method.
Loading WebSocket playground…