Get the FREE Ultimate OpenClaw Setup Guide →
e

Homeassistant N8n Agent

@enchantedmotorcycle

npx machina-cli add skill @enchantedmotorcycle/homeassistant-n8n-agent --openclaw
Files (1)
SKILL.md
2.3 KB

Home‑Assistant – n8n Agent Skill

This skill bridges OpenClaw with your n8n instance for Home Assistant automation.

How it works

Uses curl to trigger a n8n workflow for all things related to IoT. All requests should be a POST formatted as follows: curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H "Content-Type: application/json" -d '{"chatInput": "USERS QUESTION/REQUEST", "requestType": "DETERMINED REQUEST TYPE", "sessionId":"openclaw"}'

Steps

Determine the nature of a user's prompt.

  1. Is the inquiry about a current device state or multiple states? If so, requestType is state
  2. Is the inquiry asking for an IoT device state to be changed? If so, requestType is action
  3. Is the inquiry asking about IoT data from the past? If so, requestType is historical
  4. Is the inquiry asking about calendar or schedule information? If so, requestType is calendar

Quick Reference

Action

curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H "Content-Type: application/json" -d '{"chatInput": "turn off the office light", "requestType": "action", "sessionId":"openclaw"}'

curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H "Content-Type: application/json" -d '{"chatInput": "change the downstairs thermostat to 72", "requestType": "action", "sessionId":"openclaw"}'

Historical

curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H "Content-Type: application/json" -d '{"chatInput": "when was the front door last opened?", "requestType": "historical", "sessionId":"openclaw"}'

State

curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H "Content-Type: application/json" -d '{"chatInput": "is the air conditioner running?", "requestType": "state, "sessionId":"openclaw"}'

Calendar

curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H "Content-Type: application/json" -d '{"chatInput": "when is my next meeting?", "requestType": "calendar, "sessionId":"openclaw"}'

Source

git clone https://clawhub.ai/enchantedmotorcycle/homeassistant-n8n-agentView on GitHub

Overview

Bridges OpenClaw with your n8n instance to automate Home Assistant workflows. By sending a POST to a n8n webhook, it routes user prompts into state checks, actions, historical data, or calendar information.

How This Skill Works

Sends a JSON POST to the n8n webhook endpoint containing chatInput, a requestType (state, action, historical, calendar), and a sessionId. The skill determines the appropriate requestType from the user's prompt and triggers the corresponding n8n workflow via curl at the designated webhook URL.

When to Use It

  • Query the current state of a device (e.g., 'is the air conditioner running?')
  • Change a device state or trigger an action (e.g., 'turn off the office light')
  • Ask for IoT data from the past (e.g., 'when was the front door last opened?')
  • Ask about calendar or scheduling information (e.g., 'when is my next meeting?')
  • Route a user prompt into a Home Assistant automation workflow via the n8n webhook for IoT-related tasks

Quick Start

  1. Step 1: Determine the nature of a user's prompt (state, action, historical, calendar)
  2. Step 2: POST to the n8n webhook: http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 with {"chatInput": "...", "requestType": "...", "sessionId": "openclaw"}
  3. Step 3: Verify the n8n workflow runs and returns results

Best Practices

  • Use clear, concise chatInput phrases that map to your device or scene
  • Always map prompts to the correct requestType: state, action, historical, or calendar
  • Keep sessionId as 'openclaw' to maintain context across requests
  • Run and test the n8n webhook locally (n8n should listen on port 5678) and verify the webhook URL
  • Send requests with Content-Type: application/json and use the exact webhook URL

Example Use Cases

  • Action: turn off the office light (requestType: action) with chatInput: 'turn off the office light'
  • Action: change the downstairs thermostat to 72 (requestType: action) with chatInput: 'change the downstairs thermostat to 72'
  • Historical: when was the front door last opened? (requestType: historical) with chatInput: 'when was the front door last opened?'
  • State: is the air conditioner running? (requestType: state) with chatInput: 'is the air conditioner running?'
  • Calendar: when is my next meeting? (requestType: calendar) with chatInput: 'when is my next meeting?'

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers