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 <noreply@anthropic.com>
This commit is contained in:
Aodhan Collins
2026-03-06 00:29:36 +00:00
parent c4f3dbed77
commit c3dda280ea
2 changed files with 97 additions and 0 deletions

View File

@@ -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/<entity_id>
```
**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": "<entity_id>"}' \
http://10.0.0.199:8123/api/services/<domain>/<service>
```
## 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: `<domain>.<name>` e.g. `light.living_room`
- For brightness: 0255 range (255 = max)
- Token is long-lived — never regenerate unless asked

View File

@@ -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 12 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 — 12 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).