Skip to content

Home Assistant + HA Voice wiring

HA stays wherever it runs today, wired to Novak over the network: the conversation agent talks to the router or an engine directly (decision #28), STT/TTS are Home Assistant’s own native Whisper/Piper add-ons (decision #39 — no longer Novak’s own containers), and MCP gives it tools. This household’s own real setup (Spire) is the reference: HA runs on separate hardware (a Home Assistant Yellow), reaching Spire’s router over the LAN/tailnet.

1. Conversation agent → the router, via HA’s native litellm integration

Section titled “1. Conversation agent → the router, via HA’s native litellm integration”

HA’s stock OpenAI integration still doesn’t accept a custom base URL (core#137087, closed as not planned), so pointing HA at Spire’s router needs something else. Use HA Core’s own native litellm integration (added in HA Core 2026.8 — check Settings → Devices & Services → Add Integration → “LiteLLM” before installing anything from HACS; if your HA predates 2026.8, see decision #40/#41 for the HACS-based fallback this section used to recommend).

It’s built into Core, not a third-party dependency — no manifest/import bugs to chase, no removed-API references to patch, none of decision #40’s entire bug class. It discovers every model the router exposes automatically and creates one conversation agent per role name (chat, ha-voice, deep, task), and it uses HA’s own Assist API for device control — same architecture this doc has always wanted (conversation agent handles language, HA’s own intents handle devices), just without a third party in between.

Settings:

  • URL: http://<engine-host-ts-ip>:<ROUTER_PORT> (13402 by default) — no /v1 suffix. The API key is the router’s key (novak secret show ROUTER_API_KEY, decision #59): the router enforces one, so without it every call is a 401. Rotating the key means pasting the new one here too.
  • Per conversation agent (Settings → Devices & Services → LiteLLM → Add conversation agent): pick the role (ha-voice for this pipeline), set Instructions to the template in “Persona: HA pulls it” below (not a pasted copy), and check Assist under “Control Home Assistant.”
  • Wire the new agent into the actual pipeline: Settings → Voice assistants → your assistant → Conversation agent → the new ha-voice agent. Adding the LiteLLM integration does not do this automatically — it only creates the conversation.* entity.

Confirmed directly against this household’s real router (decision #41/#42): persona-correct responses and genuine, verified device control (real state changes, accurate success/failed metadata — notably more reliable here than the HACS-based Custom Conversation was, whose response metadata stayed empty even on real successes).

The one real gotcha: entity exposure, not the integration

Section titled “The one real gotcha: entity exposure, not the integration”

A light that silently refused to respond to any phrasing — by every integration tried, including HA’s own built-in, non-AI agent — turned out to have "conversation": {"should_expose": false} in its entity registry entry (a switch_as_x-wrapped switch, never exposed to Assist at all). No LLM, alias, or prompt fix could have found it; it was never in the exposed-entity list to begin with. If a request “doesn’t recognize” an entity that definitely exists, check its exposure state before suspecting the model — Settings → Voice assistants → Expose, or { "type": "homeassistant/expose_entity", "assistants": ["conversation"], "entity_ids": [...], "should_expose": true } over the websocket API.

A second, smaller gotcha once exposure is fixed: entity aliases work (HA joins them into the entity’s "names" field the model sees), but giving one entity multiple aliases at once measurably confused the small ha-voice model — it received "names": "Buffet Light, Sideboard Light" and echoed the whole comma-joined string back as if it were one literal (unmatchable) name, rather than trying either alternative. A single, distinctive alias per ambiguous entity resolved cleanly and reliably. Useful for the common case — two similarly-named lights in the same area — where the model’s own tool-selection otherwise favors the area match over a specific entity.

History: the HACS custom_conversation path (superseded here)

Section titled “History: the HACS custom_conversation path (superseded here)”

Before HA Core shipped litellm natively, this doc recommended Custom Conversation via HACS (https://github.com/michelle-avery/custom-conversation). It’s still a reasonable choice on HA versions before 2026.8, or if you want its specific features (Langfuse tracing, per-agent ignored-intents UI). Real compatibility bugs were found and fixed against it this way (decisions #40, #41) — missing voluptuous-openapi dependency, references to HA Core’s since-removed llm.AssistAPI class, and a thinking-model chat-log crash — all fixed in the integration’s own 1.7.0 release. If using it: configure it as the OpenAI provider with the router’s base URL (same settings as above, but with a /v1 suffix), persona goes in its “Customize Prompts” → instructions_prompt field (mislabeled enough in the UI that it’s easy to miss — it is not called “Instructions Prompt” despite that being the field’s internal purpose), and API choice Assist.

2. STT/TTS: Home Assistant’s own native add-ons

Section titled “2. STT/TTS: Home Assistant’s own native add-ons”

Decision #39: use HA’s own Whisper and Piper add-ons (Settings → Add-ons → Store), not a separate Wyoming service Novak runs itself. Same underlying models either way (faster-whisper at auto, Piper en_US-lessac-medium), one less network hop between HA and the voice services it needs fastest, and one less thing to keep in sync in two places.

Wake word detection is the one piece that still comes from Novak’s own stack (openwakeword, Wyoming) — HA has no native equivalent for server-side wake word on Wyoming satellites. Add it as a third Wyoming Protocol integration pointing at tcp://<core-host>:${OPENWAKEWORD_PORT} (13407 by default).

Settings → Devices & Services → Add Integration → Model Context Protocol (official, HA 2025.2+), once per server:

  • The gateway’s household connection: http://<novak-host-tailscale-ip>:13410/mcp/household/k/<household key>. Create the key with novak gateway household-key. The gateway fronts memory, notes and the rest of the household’s tools, so this one entry replaces a separate Hindsight entry. HA’s MCP client cannot send a custom header, so the key goes in the URL path, which the gateway accepts for exactly this case (gateway.md). Treat HA’s stored URL as a secret, because it contains the key.

    Register the household connection only. Never a person’s own key on a shared satellite: anyone who talks to it would reach that person’s memory, and a voice satellite cannot tell who is speaking. A pipeline that belongs to one person uses that person’s key, /mcp/k/<their key>, as described in gateway.md.

    Hindsight itself is not reachable from Home Assistant, by design. Its port is published on the host’s loopback only (decision #62), and the gateway is the way in. See memory-setup.md.

Their tools become available to the conversation agent. Keep the voice agent’s toolset small — each tool call is a model round-trip and voice should answer in ~1–2s. Memory + HA devices + Outline search is a good ceiling; do not attach Vikunja/email/etc. to the voice pipeline.

Read wakeword.md first — it covers training the model (synthetic, ~no effort) and one significant constraint: HA Voice PE hardware detects wake words on-device with microWakeWord, which has no custom-training path, so “Hey Novak” works for Wyoming satellites (like Satellite1) but not (currently) for Voice PE. On Voice PE, keep a stock trigger like “okay nabu” — the assistant still answers as Novak.

HA’s litellm agent always sends its own system message, so the router cannot inject the persona for ha-voice. Instead of a hand-pasted copy, HA pulls it: a small server on the Novak host (persona/server.py, the persona compose service) serves prompts/novak-voice.md as JSON, a REST sensor in HA polls it, and the agent’s Instructions field is a template that reads the sensor. Edit prompts/, and HA has it at its next poll.

  1. Bind the server to the Tailscale IP on the Novak host, so only the tailnet can reach it:

    Terminal window
    novak config set PERSONA_BIND <novak-host-tailscale-ip>
    novak up

    curl http://<novak-host-tailscale-ip>:13408/voice.json should return {"text": ..., "sha256": ...}.

  2. Add the REST sensor to HA’s configuration.yaml (HA’s REST integration is YAML only, there is no UI for it), then reload it from Developer tools → YAML → REST entities (no restart needed):

    rest:
    - resource: http://<novak-host-tailscale-ip>:13408/voice.json
    scan_interval: 300
    sensor:
    - name: Novak voice persona
    value_template: "{{ value_json.sha256[:12] }}"
    json_attributes:
    - text

    The entity is sensor.novak_voice_persona: its state is a short hash of the persona, and its text attribute is the persona itself.

  3. Set the agent’s Instructions (Settings → Devices & Services → LiteLLM → the ha-voice agent’s gear) to:

    {{ state_attr('sensor.novak_voice_persona', 'text') or 'You are Novak, a private home assistant. You are speaking aloud. Answer in one or two short sentences with no markdown.' }}

    The text after or is a short fallback so a sensor outage degrades the persona instead of removing it.

  4. Ask ha-voice “who are you?” once to confirm the template rendered. HA gives no way to read the Instructions field back, so this is the only check that it is in place.

novak drift --live can confirm the pull is healthy: that sensor.novak_voice_persona exists, is available, and its text matches prompts/novak-voice.md. It reads one entity’s state, so it works with a non-admin user’s token:

  1. Create a dedicated HA user (Settings → People → Users → Add User, e.g. novak-drift-check), left non-admin. HA’s long-lived tokens carry no scope of their own: a token can do whatever its user can, so a non-admin user is what makes this read-only. Never use your admin token, and never HA_MCP_TOKEN (a different, much higher-privilege credential).

  2. Log in as that user and create the token on its own profile page (bottom-left name → Long-Lived Access Tokens → Create Token). HA shows it once.

  3. Apply it:

    Terminal window
    novak config set HA_URL http://<ha-host>
    novak secret set HA_DRIFT_TOKEN

    Use the HA host’s address as you reach it (include the port only if it is not 80). Paste the token when prompted, never into .env directly.

  4. novak drift --live now includes the check. With nothing set it skips silently.

Note that HA’s web login refuses to authorize from a Tailscale 100.x address (“Invalid client id”), so use the LAN address or a hostname for the UI. API calls with a token are not affected.

Settings → Voice assistants → Add assistant, named Novak:

  • Conversation agent: HA’s native LiteLLM agent (→ ha-voice)
  • STT: HA’s native Whisper add-on, TTS: HA’s native Piper add-on
  • Wake word: hey_novak (satellites) or a stock word (Voice PE)
  • Expose only the entities you actually want voice-controllable.

Whisper faster-whisper at auto STT ≈ well under a second for short commands; the 4B model’s first token is fast if the engine host has it warm. If responses feel slow, check (in order): model role is really the 4B/ha-voice role, thinking mode is off (non-thinking model variant), toolset size, whisper model size.