Route All Home Assistant Voice to a Custom Agent

You want every voice command to go to your own agent. Maybe it is a local LLM or an assistant with MCP support.

On Home Assistant 2026.5 and newer, the standard way to do this fails.

If you use a bare wildcard in an automation, you get an HTTP 500 error. This error happens because the system looks for a list that does not exist.

Even if you avoid the error, built-in commands will hijack your queries. If you ask "When is the next low tide," Home Assistant might try to play the next song instead.

Here is how to fix both problems.

The Problems

  1. MissingListError: When you use {text} in an automation, Home Assistant expects a registered list named "text." Since you cannot define lists in automations, the system crashes.

  2. Intent Hijacking: Built-in commands like "turn on" or "play next" match your words before your custom agent gets a chance.

The Solution

You must move the catch-all logic out of automations and into custom sentences. This allows you to define a real wildcard and ensures your command loads first.

Step 1: Create a custom sentence Create a file in your custom_sentences folder. This registers a real wildcard list.

language: "en" intents: NaturaliQuery: data: - sentences: - "{text}" lists: text: wildcard: true

Step 2: Use an intent_script Instead of an automation, use an intent_script in your configuration.yaml. This handles the response and keeps the voice pipeline smooth.

intent_script: NaturaliQuery: speech: text: "One moment." action: - action: mqtt.publish data: topic: my/agent/ask payload: '{"text": "{{ text }}"}'

Why this works

• The wildcard list stops the HTTP 500 error. • Custom sentences load before built-in intents. Your agent catches the command first. • Using intent_script avoids voice deadlocks on many hardware satellites.

Note: A full wildcard will catch everything, including "turn on the lights." If you want to keep native control, add a prefix word to your custom sentence so it only triggers when you want it to.

Source: https://dev.to/clarkbw--/route-all-home-assistant-voice-to-a-custom-agent-with-a-wildcard-sentence-4iee

Optional learning community: https://t.me/GyaanSetuAi