介绍
# Home‑Assistant – n8n Agent Skill 此技能将 OpenClaw 与您的 n8n 实例连接起来,用于 Home Assistant 自动化。
# 如何工作 使用 curl 触发 n8n 工作流来处理所有与 IoT 相关的事情。所有请求应为 POST 请求,格式如下: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"}'
# 步骤 确定用户提示的性质。
1. 询问是关于当前设备状态还是多个状态?如果是,`requestType` 为 `state` 2. 询问是要求更改 IoT 设备状态吗?如果是,`requestType` 为 `action` 3. 询问是关于过去的 IoT 数据吗?如果是,`requestType` 为 `historical` 4. 询问是关于日历或日程信息吗?如果是,`requestType` 为 `calendar`
## 快速参考
### Action ```bash 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 ```bash 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 ```bash 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 ```bash 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"}' ```