ha-ultimate
Definitive Home Assistant skill for AI agents. Control 25+ entity domains via REST API with safety enforcement, webhooks, inventory generation, and a full CLI wrapper. Lights, climate, locks, presence, weather, calendars, notifications, TTS, scripts, automations, and more.
What this skill does
# ha-ultimate — Definitive Home Assistant Skill
Control your smart home via the Home Assistant REST API with safety enforcement, inventory
awareness, and full domain coverage.
## Setup
### 1. Environment Variables
```bash
export HA_URL="http://your-ha-instance:8123"
export HA_TOKEN="your-long-lived-access-token"
```
Or create a `.env` file in the skill directory (auto-loaded by ha.sh):
```env
HA_URL=http://192.168.1.100:8123
HA_TOKEN=eyJ...your-token...
```
The CLI wrapper also checks `$HOME/.config/homeassistant/config.json` as a fallback
(JSON with `url` and `token` keys). Protect this file with restrictive permissions
(`chmod 600`) since it may contain your token.
### 2. Getting a Long-Lived Access Token
1. Open Home Assistant → Profile (bottom left)
2. Scroll to "Long-Lived Access Tokens"
3. Click "Create Token", name it (e.g., "OpenClaw")
4. Copy the token immediately (shown only once)
### 3. Test Connection
```bash
curl -s -H "Authorization: Bearer $HA_TOKEN" "$HA_URL/api/" | jq
```
Or with the CLI wrapper:
```bash
scripts/ha.sh info
```
### 4. Generate Entity Inventory (Recommended, requires Node.js)
**Note:** Node.js is an **optional** dependency, only needed for `inventory.js`.
If Node.js is not available, `ha.sh inventory` falls back to a curl+jq listing.
```bash
node scripts/inventory.js
```
This generates `ENTITIES.md` with all entities organized by domain, including name, area,
and current state. **Read ENTITIES.md before acting on devices** to know what is available.
### 5. Docker / Container Networking
If running inside Docker:
- **Use IP address** (recommended): `http://192.168.1.100:8123`
- **Tailscale**: `http://homeassistant.ts.net:8123`
- **Avoid mDNS** in Docker: `homeassistant.local` often doesn't resolve
- **Nabu Casa**: `https://xxxxx.ui.nabu.casa` (requires subscription)
---
## Safety Rules
This skill implements a **layered safety system** to prevent accidental actions on
security-critical devices.
### Layer 1: Mandatory Confirmation (Agent Behavior)
**Always confirm with the user before performing these actions:**
- **Locks** — locking or unlocking any lock
- **Alarm panels** — arming or disarming
- **Garage doors** — opening or closing (`cover.*` with `device_class: garage`)
- **Security automations** — disabling automations related to security or safety
- **Covers** — opening or closing covers that control physical access (gates, barriers)
Never act on security-sensitive devices without explicit user confirmation.
### Layer 2: Critical Action Workflow
For critical domains (locks, alarm panels, garage doors, covers controlling physical
access), follow this workflow **before executing any command**:
1. **Identify the action as critical** — check if the entity domain is lock, alarm_control_panel, or cover with device_class garage/gate
2. **Inform the user and ask for confirmation** — "⚠️ Opening the garage door is a critical action. Do you want to proceed?"
3. **Wait for explicit confirmation** — "Yes", "OK", "Sure", "Do it", or any affirmative response
4. **Only then execute the command** — never execute first
**Important:** The agent (not the script) is responsible for enforcing this confirmation
flow. The CLI wrapper (`scripts/ha.sh`) checks `blocked_entities.json` as a hard block,
but interactive confirmation must be handled at the agent conversation level before
invoking any command on critical domains.
### Layer 3: Blocked Entities (Optional Configuration)
Users can permanently block entities by listing them in a `blocked_entities.json` file:
```json
{
"blocked": ["switch.main_breaker", "lock.front_door"],
"notes": "Main breaker should never be automated. Front door is manual-only."
}
```
**Blocked entities cannot be controlled under any circumstance**, even with user confirmation.
Check this file before executing any action if it exists.
---
## CLI Wrapper
The `scripts/ha.sh` CLI provides easy access to all HA functions:
```bash
# Test connection
scripts/ha.sh info
# List entities
scripts/ha.sh list all # all entities
scripts/ha.sh list light # just lights
scripts/ha.sh list switch # just switches
# Search entities
scripts/ha.sh search kitchen # find entities by name
# Get/set state
scripts/ha.sh state light.living_room
scripts/ha.sh full light.living_room # full details with attributes
scripts/ha.sh on light.living_room
scripts/ha.sh on light.living_room 200 # with brightness (0-255)
scripts/ha.sh off light.living_room
scripts/ha.sh toggle switch.fan
# Scenes & scripts
scripts/ha.sh scene movie_night
scripts/ha.sh script goodnight
# Climate
scripts/ha.sh climate climate.thermostat 22
# Dashboard (quick status of everything)
scripts/ha.sh dashboard
# Call any service
scripts/ha.sh call light turn_on '{"entity_id":"light.room","brightness":200}'
# Areas
scripts/ha.sh areas
```
---
## Entity Discovery
### List all entities
```bash
curl -s "$HA_URL/api/states" -H "Authorization: Bearer $HA_TOKEN" \
| jq -r '.[].entity_id' | sort
```
### List entities by domain
```bash
# Lights
curl -s "$HA_URL/api/states" -H "Authorization: Bearer $HA_TOKEN" \
| jq -r '.[] | select(.entity_id | startswith("light.")) | "\(.entity_id): \(.state)"'
# Sensors (with units)
curl -s "$HA_URL/api/states" -H "Authorization: Bearer $HA_TOKEN" \
| jq -r '.[] | select(.entity_id | startswith("sensor.")) | "\(.entity_id): \(.state) \(.attributes.unit_of_measurement // "")"'
```
Replace the domain prefix (`switch.`, `light.`, `sensor.`, etc.) to discover entities
in any domain.
### Get single entity state
```bash
curl -s "$HA_URL/api/states/ENTITY_ID" -H "Authorization: Bearer $HA_TOKEN"
```
### Area & Floor Discovery
Use the template API to query areas, floors, and labels.
```bash
# List all areas
curl -s -X POST "$HA_URL/api/template" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"template": "{{ areas() }}"}'
# Entities in a specific area
curl -s -X POST "$HA_URL/api/template" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"template": "{{ area_entities(\"kitchen\") }}"}'
# Find which area an entity belongs to
curl -s -X POST "$HA_URL/api/template" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"template": "{{ area_name(\"light.kitchen\") }}"}'
# List all floors and their areas
curl -s -X POST "$HA_URL/api/template" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"template": "{% for floor in floors() %}{{ floor }}: {{ floor_areas(floor) }}\n{% endfor %}"}'
```
---
## Switches
```bash
# Turn on
curl -s -X POST "$HA_URL/api/services/switch/turn_on" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"entity_id": "switch.office_lamp"}'
# Turn off
curl -s -X POST "$HA_URL/api/services/switch/turn_off" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"entity_id": "switch.office_lamp"}'
# Toggle
curl -s -X POST "$HA_URL/api/services/switch/toggle" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"entity_id": "switch.office_lamp"}'
```
## Lights
```bash
# Turn on with brightness (percentage)
curl -s -X POST "$HA_URL/api/services/light/turn_on" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"entity_id": "light.living_room", "brightness_pct": 80}'
# Turn on with color (RGB)
curl -s -X POST "$HA_URL/api/services/light/turn_on" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"entity_id": "light.living_room", "rgb_color": [255, 150, 50]}'
# Turn on with color temperature (mireds, 153-500)
curl -s -X POST "$HA_URL/api/services/light/turn_on" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"entity_id": "light.living_room", "color_temp": 300}'
Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.