Actions7
Overview
The node "Home Assistant WS" enables interaction with Home Assistant via its WebSocket API. It supports multiple resources and operations, including managing states, entities, devices, areas, categories, service actions, and logbook entries.
Specifically, for the State - List operation, the node retrieves a list of state objects from Home Assistant. This is useful for scenarios where you want to monitor or process the current states of various entities within your smart home setup. For example, you might list all sensor states to analyze temperature readings or check the status of lights and switches.
Properties
| Name | Meaning |
|---|---|
| Additional Fields | A collection of optional fields to filter or modify the listing of states: |
- Entity Type Name or ID (entityType) |
Select or specify an entity type to filter states by their component or domain (e.g., sensor, light). |
- Entity Name or ID (entityId) |
Select or specify a particular entity to retrieve its state(s). |
- Area Name or ID (areaId) |
Select or specify an area to filter states belonging to that physical or logical area. |
- Resolve Entities (resolveEntities) |
Boolean flag to indicate whether to resolve and include full entity details in the output. |
Output
The node outputs an array of JSON objects representing the states retrieved from Home Assistant. Each object typically contains:
- The entity ID (e.g.,
sensor.temperature_living_room) - The current state value (e.g.,
"23.5") - Attributes providing additional metadata about the state (e.g., unit of measurement, friendly name)
- Timestamps for last update and last change
If the "Resolve Entities" option is enabled, the output may include expanded information about each entity beyond just the state.
The node does not output binary data.
Dependencies
- Requires a valid connection to a Home Assistant instance via its WebSocket API.
- Needs an API key credential configured in n8n for authentication.
- The node depends on internal helper modules for operations related to states and other resources.
Troubleshooting
- Connection errors: Ensure the Home Assistant host URL and API key are correctly configured and that the WebSocket API is accessible.
- Empty results: Verify that the filters (entity type, entity ID, area) match existing entities/states in Home Assistant.
- Permission issues: The API key used must have sufficient permissions to read states.
- Timeouts or slow responses: Large numbers of entities or network latency can cause delays; consider filtering more narrowly.
Links and References
- Home Assistant WebSocket API Documentation
- n8n Expressions Documentation (for using expressions in property fields)