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 INLINECODE1 - Is the inquiry asking for an IoT device state to be changed? If so,
requestType is INLINECODE3 - Is the inquiry asking about IoT data from the past? If so,
requestType is INLINECODE5 - Is the inquiry asking about calendar or schedule information? If so,
requestType is INLINECODE7
Quick Reference
Action
CODEBLOCK0
Historical
CODEBLOCK1
State
CODEBLOCK2
Calendar
CODEBLOCK3
Home‑Assistant – n8n Agent 技能
此技能将 OpenClaw 与您的 n8n 实例连接,用于 Home Assistant 自动化。
工作原理
使用 curl 触发 n8n 工作流,处理所有与物联网相关的事务。所有请求均需采用 POST 格式,示例如下:curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H Content-Type: application/json -d {chatInput: 用户的问题/请求, requestType: 确定的请求类型, sessionId:openclaw}
步骤
判断用户提示的性质。
- 1. 询问的是当前设备状态还是多个状态?如果是,requestType 为 state
- 询问的是否是更改物联网设备状态?如果是,requestType 为 action
- 询问的是过去的物联网数据?如果是,requestType 为 historical
- 询问的是日历或日程信息?如果是,requestType 为 calendar
快速参考
动作
bash
curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H Content-Type: application/json -d {chatInput: 关闭办公室灯, requestType: action, sessionId:openclaw}
curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H Content-Type: application/json -d {chatInput: 将楼下恒温器调至72度, requestType: action, sessionId:openclaw}
历史数据
bash
curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H Content-Type: application/json -d {chatInput: 前门最后一次打开是什么时候?, requestType: historical, sessionId:openclaw}
状态
bash
curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H Content-Type: application/json -d {chatInput: 空调在运行吗?, requestType: state, sessionId:openclaw}
日历
bash
curl -X POST http://localhost:5678/webhook/05f3f217-08b9-42de-a84a-e13f135bde73 -H Content-Type: application/json -d {chatInput: 我下一个会议是什么时候?, requestType: calendar, sessionId:openclaw}