Skip to content

Add Home Assistant community ability#184

Open
harmsolo13 wants to merge 4 commits intoopenhome-dev:devfrom
harmsolo13:add-home-assistant-voice-control
Open

Add Home Assistant community ability#184
harmsolo13 wants to merge 4 commits intoopenhome-dev:devfrom
harmsolo13:add-home-assistant-voice-control

Conversation

@harmsolo13
Copy link
Contributor

@harmsolo13 harmsolo13 commented Mar 2, 2026

🆕 New Community Ability

Ability Name: community/home-assistant-voice-control

What does it do?

Voice-controlled interface for Home Assistant via REST API. Control lights, switches, covers, sensors, sirens, media players, and shopping lists — all hands-free. Uses LLM-based intent classification with fuzzy entity name matching so users can say natural phrases like "turn off the kitchen light" or "add milk to my shopping list" without knowing exact entity IDs.

Key features:

  • Connects to any Home Assistant instance via Long-Lived Access Token
  • Auto-discovers all actionable entities (lights, switches, covers, sensors, sirens, media players, todo lists)
  • LLM classifies user commands and fuzzy-matches entity names (e.g. "the floodlight" → light.camera_1_floodlight)
  • Safety confirmation prompts for dangerous actions (covers, sirens)
  • State checking without API calls ("is the front door locked?")
  • Shopping list management via Home Assistant's todo integration
  • Conversation loop with natural exit words

Demo

🎬 Watch the demo video on Loom

Suggested Trigger Words

  • "home assistant"
  • "smart home"
  • "control my home"
  • "home control"
  • "turn on the lights"
  • "turn off the lights"
  • "check my home"
  • "house control"

Example conversation

User: "Smart home"
OpenHome: "Home Assistant connected. I found 24 devices across 5 categories. What would you like to do?"
User: "Turn on the floodlight"
OpenHome: "Turning on Camera 1 Floodlight."
User: "Is there motion at the front door?"
OpenHome: "No motion detected at the front door."
User: "Open the gate"
OpenHome: "Are you sure you want to open the gate?"
User: "Yes"
OpenHome: "Opening the driveway gate."
User: "Add cat food to the shopping list"
OpenHome: "Added cat food to your shopping list."
User: "Done"
OpenHome: "Home Assistant control ended. Have a good one."

APIs Required

  • Home Assistant REST API — Long-Lived Access Token required. Generate at http://YOUR_HA_IP:8123/profile → Long-Lived Access Tokens. Free, no rate limits for local instances. Set via HA_TOKEN in .env file alongside main.py.

Type

  • New community Ability
  • Improvement to existing Ability
  • Bug fix
  • Documentation update

Checklist

  • main.py extends MatchingCapability with register_capability
  • README.md exists with description + setup instructions
  • No hardcoded API keys or secrets
  • Tested on OpenHome device/simulator
  • Files only in community/home-assistant-voice-control/
  • resume_normal_flow() called on every exit path (in finally block)
  • No print() — using editor_logging_handler
  • No blocked imports (redis, connection_manager, user_config)
  • No asyncio.sleep() or asyncio.create_task() — using session_tasks
  • Error handling on all external calls with timeouts
  • Demo video recorded and linked above

Anything else?

LLM Intent Classification: Uses the platform's built-in text_to_text_response with a structured system prompt. Returns JSON with action, entity_id, service_data, and a natural spoken response. Handles markdown code fences in LLM output gracefully.

Safety confirmations: Actions like open_cover, close_cover, activate_siren, and deactivate_siren require voice confirmation via run_confirmation_loop() before execution.

Entity registry: Builds a compact entity list from HA's /api/states endpoint, filtered to actionable domains only (light, switch, cover, media_player, siren, binary_sensor, sensor, todo). This keeps LLM context focused and fast.

@harmsolo13 harmsolo13 requested a review from a team as a code owner March 2, 2026 23:13
@github-actions github-actions bot added the first-contribution First-time contributor label Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

✅ Community PR Path Check — Passed

All changed files are inside the community/ folder. Looks good!

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

🔀 Branch Merge Check

PR direction: add-home-assistant-voice-controldev

Passedadd-home-assistant-voice-controldev is a valid merge direction

@github-actions github-actions bot added the community-ability Community-contributed ability label Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

🔍 Lint Results

__init__.py — Empty as expected

Files linted: community/home-assistant-voice-control/main.py

✅ Flake8 — Passed

✅ All checks passed!

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

✅ Ability Validation Passed

📋 Validating: community/home-assistant-voice-control
  ✅ All checks passed!

harmsolo13 and others added 2 commits March 3, 2026 11:32
- Replace manual register_capability() with # {{register_capability}} tag
- Remove .env file loading that used blocked open()
- Fix F541 f-string without placeholders
- Rename ambiguous variable 'l' to 'p' (E741)
- Remove hardcoded IP from HA_URL default

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@abubakar4360
Copy link
Contributor

Please share your demo if you can.

@harmsolo13
Copy link
Contributor Author

Demo link added to the readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-ability Community-contributed ability first-contribution First-time contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants