Voice Assistant Automations in Home Assistant
Home Assistant makes it easy to create powerful automations that respond to your voice using Assist. You can trigger automations or scripts with flexible sentence patterns, use slots to capture variable details, and have your assistant or satellite devices speak, listen, or process custom commands. This guide walks you through it all, step by step. A sentence trigger runs your automation when you say a specific phrase (or set of phrases) to Assist. The trigger patterns can use:
You can list multiple
Slots are placeholders in your sentence patterns that capture user-provided values. For example,
In your actions, use
The Combine this with slots for dynamic, natural conversations. Tip: If you do not provide either a Start message or Start media ID, this action will fail.
In short: Use
How it works: The answer the user gives is saved in the variable (here Tip: For closed questions (e.g. yes/no), you can define lots of accepted phrases. The official blueprint handles 50 ways of saying yes or no! How Sentence Triggers Work
[optional] – Words in square brackets are optional.
Example: [it's ]party time matches "party time" and "it's party time".
(a|b) – Alternatives, choose one.
Example: happy (new year|birthday) matches "happy new year" or "happy birthday".
{slot_name} – Slots (sometimes called wildcards), let you match and capture anything spoken in that place.
Example: play {genre} music matches "play jazz music", "play relaxing music", etc., and makes the spoken words available as a variable.
command: patterns in a single trigger, each using any of these syntaxes.
triggers:
- trigger: conversation
command:
- "[it's ]party time"
- "happy (new year|birthday)"
Using Slots to Capture Variable Input
{color} in set the light to {color} will capture whatever color the user says.
triggers:
- trigger: conversation
command:
- "set the [living room] light to {color}"
actions:
- service: light.turn_on
data:
entity_id: light.living_room
color_name: "{{ trigger.slots.color }}"
- set_conversation_response: "Setting the light to {{ trigger.slots.color }}."
trigger.slots.slotname to get the captured value. You can use this in templates for actions, service calls, or custom responses.
Customizing the Assistant's Response
set_conversation_response action lets you control what the voice assistant says back after your automation runs. You can use plain text or templates that include slot values, states, or other variables.
actions:
- set_conversation_response: "Party mode activated! 🎉"
triggers:
- trigger: conversation
command:
- "play {genre} music"
actions:
- set_conversation_response: "Playing {{ trigger.slots.genre }} music!"
Trigger Variables Reference
Variable Description trigger.platform Always conversation for this type of trigger. trigger.sentence The full spoken phrase. trigger.slots Object with slot names/values. Example: trigger.slots.genre for {genre}. trigger.details Advanced info for each slot, including name, text, and value. trigger.device_id ID of device that heard the command (if available). Assist Satellite Actions
Makes a satellite device speak a message out loud in a specific room. The device will not listen for a reply after the announcement.
actions:
- assist_satellite:announce
device_id: assist_satellite.home_assistant_voice_09969e_assist_satellite
message: "Dinner is ready!"
preannounce: true
Makes a satellite speak a prompt, then listen for a command or question. This is different from announce - the device waits for a spoken reply.
actions:
- assist_satellite:start_conversation
device_id: assist_satellite.home_assistant_voice_09969e_assist_satellite
start_message: "How can I help you?"
preannounce: true
announce to just speak; use start_conversation if you want the device to listen for a response.
Lets you create true back-and-forth conversations. The satellite asks a question, waits for a spoken answer, and saves the response to a variable for your automation. Optionally, you can define "expected answers" to speed up local recognition and even use slots (wildcards) in answers! {genre}). announce above). answer).
actions:
- action: assist_satellite.ask_question
data:
entity_id: assist_satellite.living_room_voice_assistant
preannounce: true # optional
preannounce_media_id: media-source://... # optional
question: "What kind of music do you want to listen to?"
answers:
- id: genre
sentences:
- "genre {genre}"
- id: artist
sentences:
- "artist {artist}"
response_variable: answer
- choose:
- conditions: "{{ answer.id == 'genre' }}"
sequence:
- action: music_assistant.play_media
data:
media_id: "My {{ answer.slots.genre }} playlist"
media_type: playlist
target:
entity_id: media_player.living_room_speakers
- conditions: "{{ answer.id == 'artist' }}"
sequence:
- action: music_assistant.play_media
data:
media_id: "{{ answer.slots.artist }}"
media_type: artist
target:
entity_id: media_player.living_room_speakers
answer). Use {{ answer.id }} to know which answer matched, and {{ answer.slots.genre }} or {{ answer.slots.artist }} to access what was said. This enables "choose your own adventure" style voice flows, dynamic menus, confirmations, and more.
Processes a sentence as if it were spoken to Assist, optionally as if it came from a specific device. This is useful for triggering Assist automations or responses from a script, automation, or another integration, without actually speaking.
actions:
- conversation.process:
sentence: "turn off all lights"
device_id: assist_satellite.home_assistant_voice_09969e_assist_satellite
Quick Reference
(a|b) (choose one) [word] (include or leave out) {slot_name} (capture variable words)