Actions7
Overview
The node "Home Assistant WS" enables interaction with Home Assistant via its WebSocket API. It supports multiple resources, including Entities, and allows performing various operations on them. Specifically, for the Entity resource with the List operation, the node fetches a list of entities from Home Assistant, optionally filtered by criteria such as entity type, area ID, or device ID.
This node is beneficial in scenarios where you want to dynamically retrieve and process Home Assistant entities within an n8n workflow. For example, you might use it to:
- List all entities of a certain type (e.g., lights or sensors) to monitor their states.
- Filter entities by area or device to target specific parts of your smart home setup.
- Use the retrieved entity data to trigger further automation or reporting workflows.
Properties
| Name | Meaning |
|---|---|
| Additional Fields | Optional filters to narrow down the list of entities returned: |
| - Entity Type | Filter entities by their type. Options include selecting from a searchable list or entering a name manually. |
| - Area ID | Filter entities by the Area they belong to. Options include selecting from a searchable list or entering a name manually. |
| - Device ID | Filter entities by the Device they are associated with. Options include selecting from a searchable list or entering a name manually. |
Output
The node outputs an array of JSON objects representing the entities retrieved from Home Assistant. Each object typically contains details about an entity such as its unique identifier, state, attributes, and metadata. The exact structure depends on Home Assistant's entity model but generally includes fields like entity_id, state, attributes, and possibly timestamps.
No binary data output is indicated for this operation.
Dependencies
- Requires connection to a Home Assistant instance accessible via WebSocket.
- Needs an API key credential configured in n8n for authentication with Home Assistant.
- The node uses internal helper modules to perform operations and load options dynamically.
Troubleshooting
- Connection Issues: If the node fails to connect, verify that the Home Assistant host URL and API key are correct and that the WebSocket API is enabled on the Home Assistant server.
- Empty Results: If no entities are returned, check the filter criteria (Entity Type, Area ID, Device ID). Ensure these values exist in your Home Assistant setup.
- Permission Errors: Insufficient permissions on the API key may cause errors. Make sure the API key has read access to entities.
- Timeouts or Slow Responses: Large numbers of entities or network latency can slow responses. Consider narrowing filters or increasing timeout settings if available.