Home Assistant Guide

Simple tutorials for powerful automations

Smart Volume Ducking for Assist Satellite in Home Assistant

This Home Assistant blueprint brings Google-Home-style “smart volume ducking” to your Assist satellites. Whenever your Assist device starts listening, responding, or even processing a question, it will automatically lower (duck) or pause your selected media players — and restore them when the conversation ends.

It’s ideal for setups where you have music, radio, or TV audio playing in the same room as your voice assistant, ensuring you can always be heard clearly without manual volume fiddling.

What Does This Blueprint Do?

This automation will:

  • Automatically detect when your Assist satellite starts listening or responding.
  • Optionally include the processing phase for extended quiet time while the LLM is thinking.
  • Either reduce (duck) the volume to a fixed level, or pause playback entirely — your choice.
  • Restore the previous volume or playback state once the assistant returns to Idle.
  • Work with one or multiple media players simultaneously.
  • Use Home Assistant’s scene snapshot feature to cleanly restore pre-interaction states.

How to Use This Blueprint

Note: This blueprint works with entities that expose states such as listening, responding, processing, and idle — for example voice_assistant.living_room or assist_satellite.kitchen.

  1. Import the Blueprint
    Click the Import Blueprint button/link at the top of this article.
    — When prompted in Home Assistant, review the YAML and click Import.
    Alternative (manual): In Home Assistant go to Settings → Automations & Scenes → Blueprints, click Import Blueprint, paste the raw YAML URL, and choose Preview → Import.
  2. Create an Automation from the Blueprint
    After import, find “Smart Volume Ducking for Assist Satellite” under Settings → Automations & Scenes → Blueprints and click Create Automation.
  3. Fill in the Inputs
    • Assist / Voice Assistant Entity: Select your satellite or voice assistant (e.g. voice_assistant.living_room).
    • Media Players: Choose one or more media players to duck or pause.
    • Behavior: Select Duck to fixed volume or Pause while speaking.
    • Duck Volume Level: Target volume (e.g. 0.15 = 15%). Only used in duck mode.
    • Also Apply While Processing: Keep audio quiet even during the LLM’s thinking phase.
    • Minimum Listen Time (ms): Optional debounce to ignore rapid state flickers.
  4. Save
    Click Save. The automation will now handle volume ducking or playback pausing automatically whenever your voice assistant activates.

Use Cases & Ideas

  • Lower background music or radio during voice interactions.
  • Pause TV audio while talking to your assistant.
  • Reduce office noise from speakers during dictation or chat commands.
  • Integrate multiple rooms for synchronized quiet during assistant replies.

Blueprint YAML


blueprint:
  name: Smart Volume Ducking for Assist Satellite (duck/pause + processing option)
  description: >
    Duck (reduce volume) or pause selected media players while an Assist Satellite
    is listening/responding, and optionally while processing. Restores prior state
    when the satellite returns to Idle. Works with multiple players and uses a
    scene snapshot for clean restore.
  domain: automation

  input:
    assist_entity:
      name: Assist Satellite
      description: >
        Select your Assist Satellite entity (e.g. assist_satellite.living_room).
        The automation reacts to states like listening/responding/processing/idle.
      selector:
        entity:
          multiple: false
          filter:
            - domain: assist_satellite

    media_players:
      name: Media players to control
      description: One or more players to duck or pause during assistant activity.
      selector:
        entity:
          multiple: true
          filter:
            - domain: media_player

    behavior_mode:
      name: Behavior
      description: Choose whether to reduce volume or pause playback.
      default: duck
      selector:
        select:
          options:
            - label: Duck to fixed volume
              value: duck
            - label: Pause while speaking
              value: pause

    duck_volume:
      name: Duck volume level (0.0–1.0)
      description: Target volume while Assist is active (used only in Duck mode).
      default: 0.15
      selector:
        number:
          min: 0
          max: 1
          step: 0.01
          mode: slider

    apply_while_processing:
      name: Also apply while "processing"
      description: If enabled, duck/pause during the LLM processing/thinking phase too.
      default: false
      selector:
        boolean: {}

    min_listen_time:
      name: Minimum active duration (ms)
      description: Debounce to ignore very brief state flickers.
      default: 0
      selector:
        number:
          min: 0
          max: 3000
          step: 50
          unit_of_measurement: ms

mode: restart

variables:
  mp_list: !input media_players
  behavior_mode: !input behavior_mode
  duck_volume: !input duck_volume
  apply_processing: !input apply_while_processing

trigger:
  - id: assist_active
    platform: state
    entity_id: !input assist_entity
    to:
      - listening
      - responding
      - speaking       # some satellites use 'speaking' instead of/responding
      - processing
    for:
      milliseconds: !input min_listen_time

action:
  - variables:
      to_state: "{{ trigger.to_state.state | lower }}"
      from_state: "{{ trigger.from_state.state | default('unknown') | lower }}"

  - alias: Ignore 'processing' if user didn't opt in
    condition: template
    value_template: "{{ not (to_state == 'processing' and not apply_processing) }}"

  - alias: Snapshot only when coming from an inactive state
    if:
      - condition: template
        value_template: "{{ from_state in ['idle','unknown','off'] }}"
    then:
      - alias: Snapshot current media player states/volumes
        action: scene.create
        data:
          scene_id: assist_duck_restore_snapshot
          snapshot_entities: "{{ mp_list }}"
      - alias: Remember which players were playing (for pause-mode resume)
        variables:
          playing_before: >-
            {{ expand(mp_list)
               | selectattr('state','eq','playing')
               | map(attribute='entity_id') | list }}
    else:
      - alias: Preserve previous 'playing_before' if already set; otherwise compute a best-effort list
        variables:
          playing_before: >-
            {{ playing_before if playing_before is defined else
               (expand(mp_list)
               | selectattr('state','eq','playing')
               | map(attribute='entity_id') | list) }}

  - choose:
      - conditions: "{{ behavior_mode == 'duck' }}"
        sequence:
          - alias: Compute list of currently playing players (only these will duck)
            variables:
              active_players: >-
                {{ expand(mp_list)
                   | selectattr('state','eq','playing')
                   | map(attribute='entity_id') | list }}
          - alias: Only proceed if any players are actively playing
            if:
              - condition: template
                value_template: "{{ active_players | length > 0 }}"
            then:
              - alias: Set duck volume on each active player
                repeat:
                  for_each: "{{ active_players }}"
                  sequence:
                    - if:
                        - condition: template
                          value_template: "{{ state_attr(repeat.item, 'volume_level') is defined }}"
                      then:
                        - action: media_player.volume_set
                          target:
                            entity_id: "{{ repeat.item }}"
                          data:
                            volume_level: "{{ duck_volume }}"
                      else:
                        - action: system_log.write
                          data:
                            level: WARNING
                            message: >-
                              [Assist Ducking] {{ repeat.item }} has no volume_level; skipping volume_set.

      - conditions: "{{ behavior_mode == 'pause' }}"
        sequence:
          - alias: Pause only players that were playing
            if:
              - condition: template
                value_template: "{{ playing_before | length > 0 }}"
            then:
              - action: media_player.media_pause
                target:
                  entity_id: "{{ playing_before }}"

  - alias: Wait for Assist to go Idle; then restore
    wait_for_trigger:
      - platform: state
        entity_id: !input assist_entity
        to: idle
    timeout:
      minutes: 5
    continue_on_timeout: true

  - alias: Restore after Idle (or timeout)
    choose:
      - conditions: "{{ behavior_mode == 'duck' }}"
        sequence:
          - action: scene.turn_on
            target:
              entity_id: scene.assist_duck_restore_snapshot

      - conditions: "{{ behavior_mode == 'pause' }}"
        sequence:
          - alias: Resume only the players that were playing before
            if:
              - condition: template
                value_template: "{{ playing_before | length > 0 }}"
            then:
              - action: media_player.media_play
                target:
                  entity_id: "{{ playing_before }}"
          - alias: Restore pre-duck volumes and any other attributes
            action: scene.turn_on
            target:
              entity_id: scene.assist_duck_restore_snapshot
    

Tips & Notes

  • Processing phase: If your satellite entity reports a processing state (common for Extended OpenAI or local LLM setups), enabling “Also apply while processing” ensures playback stays quiet until the final spoken reply.
  • Scene restore: The automation uses Home Assistant’s scene.create and scene.turn_on to snapshot and restore volumes/states cleanly.
  • Multiple players: All selected entities are handled together. It’s safe to include grouped or individual speakers.
  • Testing: Try asking your assistant a question while music plays — you’ll see the media gently duck or pause, then resume automatically.