Actions7
Overview
This node enables interaction with Home Assistant via its WebSocket API, specifically focusing on executing service actions within the Home Assistant ecosystem. It allows users to trigger services by specifying the service domain and service IDs along with optional attributes and additional parameters.
Common scenarios include automating smart home devices, triggering scenes, or invoking any custom service available in Home Assistant. For example, a user might use this node to turn on lights, adjust thermostat settings, or call a custom script defined in Home Assistant.
Properties
| Name | Meaning |
|---|---|
| Service Domain ID | The ID of the service domain to execute. Can be selected from a searchable list or entered by name. |
| Service ID | The ID of the specific service to execute within the chosen domain. Selectable from a list or by name. |
| Service Attributes | Key-value pairs representing attributes to pass to the service call. Multiple attributes can be added. Each attribute has: - Name: The attribute's name. - Value: The attribute's value. |
| Additional Fields | Optional extra parameters for the service call. Currently supports: - Response (boolean): Whether the service call should return a response. |
Output
The node outputs JSON data representing the result of the executed service action. This typically includes the response from Home Assistant after calling the specified service, which may contain status information or data returned by the service.
If the "Response" option is enabled, the output will include the service call's response; otherwise, it may be empty or minimal.
No binary data output is indicated for this operation.
Dependencies
- Requires connection credentials to Home Assistant's WebSocket API, including host and an API key or token.
- The node depends on Home Assistant being accessible over the network and having the specified services available.
- No other external dependencies are required beyond the Home Assistant WebSocket API.
Troubleshooting
Common Issues:
- Incorrect or missing service domain or service ID can cause the service call to fail.
- Network connectivity issues between n8n and Home Assistant will prevent execution.
- Insufficient permissions or invalid API keys will result in authentication errors.
- Providing malformed or incorrect service attributes may cause the service call to error.
Error Messages:
- Authentication failures usually indicate invalid credentials; verify API key/token and host.
- "Service not found" errors suggest the specified service domain or service ID does not exist; check spelling and availability in Home Assistant.
- Timeout or connection errors imply network issues; ensure Home Assistant is reachable.
Resolution Tips:
- Double-check all input fields for correctness.
- Test connectivity to Home Assistant outside n8n to confirm access.
- Review Home Assistant logs for more detailed error information if calls fail.