Overview
This node listens for events from a Home Automation system via its WebSocket API. It triggers workflows in n8n when specific types of events occur, such as changes in device states, service calls, automation executions, or custom-defined events.
Common scenarios include:
- Reacting to a light turning on or off (state change).
- Triggering actions when a particular service is called (e.g., switching a device).
- Starting workflows when an automation runs.
- Listening for any event or a custom event type for advanced integrations.
For example, you could use this node to start a workflow whenever the living room light state changes or when any automation is triggered in your home system.
Properties
| Name | Meaning |
|---|---|
| Event Type | The type of event to listen for. Options: State Changed, Service Executed, Automation Triggered, Any Event, Custom Event. |
| Custom Event Type | The name of the custom event type to listen for (only shown if "Custom Event" is selected). |
| Entity | The specific entity to monitor (e.g., light.living_room) when listening for state changes. |
| Monitor All Entities | Whether to monitor all entities instead of a specific one (for state changed events). |
| Domain | The domain to monitor (e.g., light, switch) when listening for service executed events. |
| Monitor All Domains | Whether to monitor all domains instead of a specific one (for service executed events). |
| Service | The specific service to monitor when listening for service executed events. |
| Monitor All Services | Whether to monitor all services instead of a specific one (for service executed events). |
| Automation | The specific automation to monitor when listening for automation triggered events. |
| Monitor All Automations | Whether to monitor all automations instead of a specific one (for automation triggered events). |
Output
The node outputs JSON data representing the event received from the Home Automation system. The structure includes:
event_type: The type of the event that triggered the workflow.data: The payload or details associated with the event.origin: The origin/source of the event.time_fired: The timestamp when the event was fired by the Home Automation system.context: Additional context information about the event.timestamp: The ISO string timestamp when the event was received by the node.
If the Home Automation system sends binary data as part of events, it would be included accordingly, but this node primarily handles JSON event data.
Dependencies
- Requires connection to a Home Automation WebSocket API.
- Needs credentials including the host URL and an access token for authentication.
- The node uses a WebSocket handler internally to maintain a live connection and listen for events.
Troubleshooting
- Missing Credentials: If the host or access token is not provided, the node will throw an error indicating these are required.
- Connection Issues: Network problems or incorrect host URLs can prevent establishing the WebSocket connection.
- Event Filtering: Incorrect configuration of entity, domain, service, or automation filters may result in no events triggering the workflow.
- Custom Events: When using custom event types, ensure the exact event name matches what the Home Automation system emits.
To resolve errors:
- Verify credentials and network connectivity.
- Double-check property values for filtering.
- Consult Home Automation system logs to confirm event names and availability.