From c3dda280ea791e47ed9851038d0b6f6a32ed2cd5 Mon Sep 17 00:00:00 2001 From: Aodhan Collins Date: Fri, 6 Mar 2026 00:29:36 +0000 Subject: [PATCH] Add OpenClaw skills: home-assistant and voice-assistant - home-assistant: controls lights, switches, media players, climate etc via HA REST API at 10.0.0.199:8123; includes service/domain reference - voice-assistant: voice-specific response style guide for TTS output (concise, no markdown, natural speech) Co-Authored-By: Claude Sonnet 4.6 --- homeai-agent/skills/home-assistant/SKILL.md | 60 ++++++++++++++++++++ homeai-agent/skills/voice-assistant/SKILL.md | 37 ++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 homeai-agent/skills/home-assistant/SKILL.md create mode 100644 homeai-agent/skills/voice-assistant/SKILL.md diff --git a/homeai-agent/skills/home-assistant/SKILL.md b/homeai-agent/skills/home-assistant/SKILL.md new file mode 100644 index 0000000..6a0b9a5 --- /dev/null +++ b/homeai-agent/skills/home-assistant/SKILL.md @@ -0,0 +1,60 @@ +--- +name: home-assistant +description: 'Control smart home devices and query Home Assistant. Use when the user asks to control lights, switches, media players, covers, climate, sensors, or any smart home entity. Also use for scenes, scripts, automations, and device state queries. Examples: turn off the living room lights, what is the temperature in the bedroom, play music in the kitchen, is the front door locked.' +--- + +# Home Assistant Skill + +## Connection +- URL: http://10.0.0.199:8123 +- Token: read from environment `HASS_TOKEN` or file `~/.homeai/hass_token` +- API base: `{URL}/api` + +## Common API calls + +**Get all states (entity discovery):** +```bash +curl -s -H "Authorization: Bearer $HASS_TOKEN" \ + http://10.0.0.199:8123/api/states | jq '[.[] | {entity_id, state, attributes: .attributes.friendly_name}]' +``` + +**Get single entity state:** +```bash +curl -s -H "Authorization: Bearer $HASS_TOKEN" \ + http://10.0.0.199:8123/api/states/ +``` + +**Call a service (turn on/off, set value, etc.):** +```bash +curl -s -X POST \ + -H "Authorization: Bearer $HASS_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{"entity_id": ""}' \ + http://10.0.0.199:8123/api/services// +``` + +## Domain/service reference + +| Domain | Services | +|---|---| +| light | turn_on, turn_off, toggle (+ brightness, color_temp, rgb_color) | +| switch | turn_on, turn_off, toggle | +| media_player | media_play, media_pause, media_stop, volume_set, select_source | +| cover | open_cover, close_cover, set_cover_position | +| climate | set_temperature, set_hvac_mode | +| scene | turn_on | +| script | turn_on | +| input_boolean | turn_on, turn_off, toggle | +| homeassistant | turn_on, turn_off (works across domains) | + +## Workflow + +1. If entity ID is unknown, GET /api/states and filter by friendly_name or domain +2. Call the appropriate service with the entity_id +3. Confirm the action succeeded (HTTP 200 = OK) +4. Report back to user in natural language + +## Tips +- Entity IDs follow pattern: `.` e.g. `light.living_room` +- For brightness: 0–255 range (255 = max) +- Token is long-lived — never regenerate unless asked diff --git a/homeai-agent/skills/voice-assistant/SKILL.md b/homeai-agent/skills/voice-assistant/SKILL.md new file mode 100644 index 0000000..4eda273 --- /dev/null +++ b/homeai-agent/skills/voice-assistant/SKILL.md @@ -0,0 +1,37 @@ +--- +name: voice-assistant +description: Handle voice assistant requests received via the wake-word pipeline. Use when a request arrives tagged as a voice command or comes through the wake-word webhook (/wake endpoint). Respond concisely — responses will be spoken aloud via TTS (Kokoro). Avoid markdown, lists, or formatting that doesn't work in speech. Keep replies to 1–2 sentences unless detail is requested. +--- + +# Voice Assistant Skill + +## Context + +This assistant runs on a Mac Mini (LINDBLUM, 10.0.0.200). Requests may arrive: +- Via the `/wake` HTTP webhook (wake word detected by openWakeWord) +- Via Home Assistant Wyoming voice pipeline +- Via direct text input + +## Response style for voice + +- Speak naturally, as if in conversation +- Keep it short — 1–2 sentences by default +- No bullet points, headers, or markdown +- Say numbers as words when appropriate ("twenty-two degrees" not "22°C") +- Use the character's personality (defined in system prompt) + +## TTS pipeline + +Responses are rendered by Kokoro ONNX (port 10301, voice: af_heart) and played back through the requesting room's speaker. + +## Smart home integration + +For device control requests, use the `home-assistant` skill. HA is at 10.0.0.199:8123. + +## Wake word webhook + +POST to `http://localhost:8080/wake` triggers this context: +```json +{"wake_word": "hey_jarvis", "score": 0.87} +``` +After wake, wait for the transcribed utterance from the STT pipeline (Whisper large-v3, port 10300).