WebSocket API
The API of Home Assistant Core that the frontend and the companion apps use, over one open connection, to read states, perform actions, and get updates as they happen.
- In code
websocket_api/api/websockethome-assistant-js-websocket
A client connects to /api/websocket, logs in with an access token, and then sends commands as JSON messages. Integrations can add their own commands with the websocket_api integration. The frontend talks to it through the home-assistant-js-websocket library.
See the WebSocket API for the messages and how to add a command.