Get all entity states via WebSocket
ws_get_statesFetch all Home Assistant entity states in one WebSocket call, avoiding per-entity HTTP overhead on large installations. Use it when you need every entity's state, not filtered or paginated results.
Instructions
Get all entity states over the WebSocket API in one call.
Sends get_states and waits up to timeout seconds for the matching
result message; this can be faster than the HTTP /api/states
endpoint on large installs since it avoids per-entity HTTP overhead.
Use when: fetching every entity's state on a large installation.
Not for: a filtered or paginated state list — use
entities_list_entities.
Returns: the list of state dicts from HA's result.result.
Errors: raises RuntimeError when the WebSocket handshake or the
result message does not arrive within timeout, or when a result
message arrives but is not successful.
Limits: blocks for up to timeout seconds (default 10), including the
initial handshake.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | Maximum seconds to wait for the WebSocket handshake and the result message before raising an error; must be between 1 and 300. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |