Guide to Voice Assistant Automations in Home Assistant
Home Assistant lets you create automations/scripts triggered by voice using flexible patterns. This guide explains the modern trigger syntax, how to use slots (including wildcards), and how to customize the assistant's response.
Use a conversation trigger to run your automation when a phrase is spoken to Assist. You can provide multiple This matches "party time", "it's party time", "happy new year", or "happy birthday".
Use the
Slot values (like Use this action when you want to broadcast an announcement - such as "Dinner is ready!" or "Someone is at the door." Use this action if you want the device to both speak a prompt and then listen for a command or question - for example, after a doorbell press or a smart button.
Tip: At least one of Use this action to trigger Assist automations or responses from a script, automation, or another integration, without actually speaking. Sentence Triggers: Making Automations Respond to Speech
command: patterns, and each can use brackets for optional words, parentheses for alternatives, and curly braces for slots.
triggers:
- trigger: conversation
command:
- "[it's ]party time"
- "happy (new year|birthday)"
Pattern Syntax for Commands
[] is optional.
Example: [it's ]party time matches with or without "it's".
() separated by | is an alternative.
Example: happy (new year|birthday).
Example: play {genre} music matches "play jazz music", "play relaxing music", etc.
Setting the Assistant's Response
set_conversation_response action to control what the assistant says back to you. You can use templates to include dynamic values (like slot values).
actions:
- set_conversation_response: "Party mode activated! 🎉"
Using Slots in Automations
{genre} or {color}) are available as trigger.slots.genre, trigger.slots.color, etc. You can use them in actions, responses, or templates.
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 of slot names/values. trigger.slots.genre for {genre} etc. 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.
Note: The device will not listen for a reply after announcing.
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 start listening for a spoken command or question from anyone nearby.
actions:
- assist_satellite:start_conversation
device_id: assist_satellite.home_assistant_voice_09969e_assist_satellite
start_message: "How can I help you?"
preannounce: true
start_message or start_media_id is required, or the action will fail.
Processes a sentence as if it were spoken to Assist, optionally as if it came from a specific device.
actions:
- conversation.process:
sentence: "turn off all lights"
device_id: assist_satellite.home_assistant_voice_09969e_assist_satellite # (optional)