Home Assistant Guide

Simple tutorials for powerful automations

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.

Sentence Triggers: Making Automations Respond to Speech

Use a conversation trigger to run your automation when a phrase is spoken to Assist. You can provide multiple 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)"
    

This matches "party time", "it's party time", "happy new year", or "happy birthday".

Pattern Syntax for Commands

  • [optional]: Anything inside [] is optional.
    Example: [it's ]party time matches with or without "it's".
  • (a|b): Anything inside () separated by | is an alternative.
    Example: happy (new year|birthday).
  • {slot_name}: Slot/wildcard - captures whatever words are spoken in that place. This is how you match and use variable or open-ended input.
    Example: play {genre} music matches "play jazz music", "play relaxing music", etc.

Setting the Assistant's Response

Use the 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

Slot values (like {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!"
    
  • This matches "play jazz music", "play my playlist music", etc., and will respond with the captured genre or phrase.

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

  • assist_satellite:announce:
    Makes a satellite device speak a message out loud in a specific room.
    • Targets: Select the satellite device, area, or entity you want to announce from.
    • Message: The text-to-speech message you want announced. (Required if no Media ID is set)
    • Media ID: Optional. Instead of TTS, play a media file (like a saved MP3) as the announcement.
    • Preannounce: If enabled, the satellite will play a short notification sound before the message or media.
    • Preannounce media ID: Optional. Play a specific media file as the preannounce sound (for example, a custom chime) instead of the default.

    Use this action when you want to broadcast an announcement - such as "Dinner is ready!" or "Someone is at the door."
    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
             
  • assist_satellite:start_conversation:
    Makes a satellite speak a prompt, then start listening for a spoken command or question from anyone nearby.
    • Targets: Select the satellite device, area, or entity to start the conversation from.
    • Start message: The message the satellite will say to invite someone to speak (e.g. "How can I help you?").
    • Start media ID: Optional. Play a media file as the prompt instead of a TTS message.
    • Extra system prompt: Optional. Give background information or special instructions to the AI for this conversation.
    • Preannounce: Optionally play a notification sound before the prompt.
    • Preannounce media ID: Optionally play a specific sound before the prompt.

    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.

    
    actions:
      - assist_satellite:start_conversation
        device_id: assist_satellite.home_assistant_voice_09969e_assist_satellite
        start_message: "How can I help you?"
        preannounce: true
          

    Tip: At least one of start_message or start_media_id is required, or the action will fail.

  • conversation.process:
    Processes a sentence as if it were spoken to Assist, optionally as if it came from a specific device.
    • sentence: The command or question to process.
    • device_id: Optional. Process the command as if it was heard by a specific Assist satellite or device.

    Use this action to trigger 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   # (optional)