Add Home Assistant community ability#184
Add Home Assistant community ability#184harmsolo13 wants to merge 7 commits intoopenhome-dev:devfrom
Conversation
✅ Community PR Path Check — PassedAll changed files are inside the |
🔀 Branch Merge CheckPR direction: ✅ Passed — |
🔍 Lint Results✅
|
✅ Ability Validation Passed |
- 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>
|
Please share your demo if you can. |
|
Demo link added to the readme |
|
Hey @harmsolo13, the work is great. A few things to fix before this can be approved:
|
uzair401
left a comment
There was a problem hiding this comment.
Hi @harmsolo13, Please address the issues highlighted by @abubakar4360, and then we will proceed further.
🆕 New Community Ability
Ability Name:
community/home-assistant-voice-controlWhat 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:
light.camera_1_floodlight)Demo
🎬 Watch the demo video on Loom
Suggested Trigger Words
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
http://YOUR_HA_IP:8123/profile→ Long-Lived Access Tokens. Free, no rate limits for local instances. Set viaHA_TOKENin.envfile alongsidemain.py.Type
Checklist
main.pyextendsMatchingCapabilitywithregister_capabilityREADME.mdexists with description + setup instructionscommunity/home-assistant-voice-control/resume_normal_flow()called on every exit path (infinallyblock)print()— usingeditor_logging_handlerredis,connection_manager,user_config)asyncio.sleep()orasyncio.create_task()— usingsession_tasksAnything else?
LLM Intent Classification: Uses the platform's built-in
text_to_text_responsewith 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, anddeactivate_sirenrequire voice confirmation viarun_confirmation_loop()before execution.Entity registry: Builds a compact entity list from HA's
/api/statesendpoint, filtered to actionable domains only (light,switch,cover,media_player,siren,binary_sensor,sensor,todo). This keeps LLM context focused and fast.