Homeassistant N8n Agent
@enchantedmotorcycle
npx machina-cli add skill @enchantedmotorcycle/homeassistant-n8n-agent --openclawHome‑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.
- Is the inquiry about a current device state or multiple states? If so,
requestTypeisstate - Is the inquiry asking for an IoT device state to be changed? If so,
requestTypeisaction - Is the inquiry asking about IoT data from the past? If so,
requestTypeishistorical - Is the inquiry asking about calendar or schedule information? If so,
requestTypeiscalendar
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"}'
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
- Step 1: Determine the nature of a user's prompt (state, action, historical, calendar)
- Step 2: POST to the n8n webhook: http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 with {"chatInput": "...", "requestType": "...", "sessionId": "openclaw"}
- 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?'