Home Assistant Event Integration using AppDaemon Webhooks - n8n Workflow

Learn how to trigger an n8n workflow using Home Assistant events and AppDaemon. This n8n templates guide provides the secure Webhook n8n node setup for smart home automation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Smart Home enthusiasts and engineers using Home Assistant.
Users who need to reliably trigger external automation systems from specific HA events.
Developers looking for specialized n8n templates for secure IoT and web integration.
Anyone requiring a custom n8n workflow solution for complex AppDaemon integrations.

Overview

This highly specialized n8n workflow addresses the challenge of creating a direct link between Home Assistant events and an n8n node execution. Since Home Assistant does not have a native n8n API endpoint for triggering, this solution leverages the powerful AppDaemon add-on. AppDaemon runs a custom Python script that listens for user-defined HA events (such as state_changed). When the event is detected, the script securely sends the event payload via HTTP POST to the n8n trigger. This structure provides a stable and authenticated method to initiate a downstream n8n workflow, making this one of the most effective n8n templates for advanced smart home automation scenarios.

How it Works

The execution of this n8n workflow begins outside of n8n itself, relying on external services:


  1. Home Assistant Event: A specific, monitored event (like a sensor state changing or a service being called) occurs within your Home Assistant instance.

  2. AppDaemon Listener: The custom AppDaemon Python application, configured via the workflow's embedded notes, detects this event based on its internal listener configuration (target_event).

  3. Secure Webhook Call: AppDaemon constructs a JSON payload containing the event data and executes a secure HTTP POST request. Crucially, this request includes the required custom headers for authentication, matching the setup of the n8n trigger.

  4. n8n Trigger Activation: The Home Assistant Event Trigger n8n node receives the authenticated POST request. Since the authentication headers match the credentials configured for the n8n node, the n8n workflow successfully starts.

  5. Data Ingestion: The data is passed to the Process data from webhook n8n node. This node acts as a functional placeholder, confirming successful ingestion and serving as the starting point for all subsequent actions in the remainder of the n8n workflow.

Installation Guide

To implement this n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON and import it directly into your n8n instance via the 'New' menu -> 'Import from JSON'.

  2. Configure the n8n Trigger URL: Open the Home Assistant Event Trigger n8n node. Note the unique Production Webhook URL generated by the n8n node. This URL must be added to your AppDaemon configuration.

  3. Set up Header Credentials: The n8n trigger uses Header Authentication. You must create or select an existing httpHeaderAuth credential in n8n. Ensure the header name and value (e.g., CredName: credValue as suggested in the sticky note) are set both in the n8n credential and accurately reflected in the Python script running in AppDaemon.

  4. Implement AppDaemon Code: Install AppDaemon in Home Assistant. Use the Python script provided in the workflow's Sticky Note, adjusting the lines marked #EDIT for your specific use case. Specifically, update the webhookurl (your n8n trigger URL), the targetevent, and the custom header details.

  5. Test and Activate: Test the n8n trigger within the n8n node, then activate the entire n8n workflow to enable the production endpoint for persistent monitoring.

Node Details

Sticky Note (Documentation):
Function: Provides essential context and the exact AppDaemon Python script required to bridge Home Assistant events to the n8n node via a webhook. This note clarifies the need for a custom script because no direct n8n API integration exists in HA.
Key Configuration: Contains editable fields (#EDIT) for the AppDaemon code, including setting the targetevent, the n8nwebhook_url, and the header authentication used to secure the n8n trigger.
Home Assistant Event Trigger (Webhook n8n node):
Function: Serves as the primary n8n trigger, initiating the entire n8n workflow upon receiving an authenticated POST request from AppDaemon.
Key Configuration: Configured for the POST HTTP Method and requires Header Auth to validate the incoming request, securing this sensitive n8n node endpoint.
Process data from webhook (NoOp n8n node):
Function: A simple n8n node that acts as the initial processing step. It confirms data successful ingestion and is the intended starting point for users to add their custom logic to the n8n workflow, utilizing the Home Assistant event data payload.

Related n8n Workflows

Free

Nodes: 3 Nodes
Updated: December 26 2025
View all
Created by

Business process improvement and continuous improvement SME. Process automation advocate.

Featured*