Inconsistent Announcements

I have been experiencing truncated announcements when using the media_player.all_speakers group consisting of only Google Nest Minis. Sometimes it plays the full announcement, but other times it only plays the chime or a truncated message. It doesn’t seem to matter whether I use the HA TTS or Google’s. Here is my automation:

alias: Washer/Dryer Done
description: ""
triggers:
  - type: turned_on
    device_id: 0de72aefc8740a9ec8477bffdb1d8e01
    entity_id: a2f14dff07c6af806f87ebf1de4cedf6
    domain: binary_sensor
    trigger: device
    alias: Washer
  - type: turned_on
    device_id: 2accab71c621d236c46e20e54cb47c16
    entity_id: 01cae9da18fd15d9bb9391a2d6d8b431
    domain: binary_sensor
    trigger: device
    alias: Dryer
conditions:
  - condition: state
    entity_id: input_boolean.quiet_time_toggle
    state: "off"
actions:
  - action: script.announce_message
    metadata: {}
    data: {}
  - action: tts.cloud_say
    metadata: {}
    data:
      cache: false
      entity_id: media_player.all_speakers
      message: The {{ trigger.alias }} has finished.
    enabled: false
  - choose:
      - conditions:
          - condition: and
            conditions:
              - condition: device
                type: is_on
                device_id: 0de72aefc8740a9ec8477bffdb1d8e01
                entity_id: 1dddebc15bc6f7d9ddbb86b49a552c13
                domain: switch
              - type: is_on
                condition: device
                device_id: 0de72aefc8740a9ec8477bffdb1d8e01
                entity_id: a2f14dff07c6af806f87ebf1de4cedf6
                domain: binary_sensor
              - condition: device
                type: is_on
                device_id: 2accab71c621d236c46e20e54cb47c16
                entity_id: ab429bc795ad6e53b1ef2db6f10a4a8c
                domain: switch
              - type: is_off
                condition: device
                device_id: 2accab71c621d236c46e20e54cb47c16
                entity_id: 01cae9da18fd15d9bb9391a2d6d8b431
                domain: binary_sensor
        sequence:
          - action: tts.cloud_say
            metadata: {}
            data:
              cache: true
              entity_id: media_player.all_speakers
              message: The washer has completed, but the dryer is still running.
            enabled: false
          - action: tts.speak
            metadata: {}
            data:
              cache: true
              media_player_entity_id: media_player.all_speakers
              message: The washer has completed, but the dryer is still running.
            target:
              entity_id: tts.google_translate_en_com
    default:
      - action: tts.cloud_say
        metadata: {}
        data:
          cache: false
          entity_id: media_player.all_speakers
          message: The {{ trigger.alias }} has finished.
        enabled: false
      - action: tts.speak
        metadata: {}
        data:
          cache: true
          media_player_entity_id: media_player.kitchen_speaker
          message: The {{ trigger.alias }} has finished.
          options:
            speed: 1.2
        target:
          entity_id: tts.google_translate_en_com
  - action: tts.speak
    metadata: {}
    data:
      cache: true
      media_player_entity_id: media_player.kitchen_speaker
      message: The clothes have finished.
    target:
      entity_id: tts.google_translate_en_com
mode: queued

And here is the script I am calling in an attempt to prepare them for the announcement.

alias: Wake All Speakers
sequence:
  - target:
      entity_id: media_player.all_speakers
    action: media_player.turn_on
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
  - target:
      entity_id: media_player.all_speakers
    data:
      volume_level: 0.3
    action: media_player.volume_set
  - wait_template: |
      {{ expand('media_player.all_speakers')
         | rejectattr('state', 'in', ['unavailable', 'unknown'])
         | selectattr('state', 'eq', 'idle')
         | list | length ==
         expand('media_player.all_speakers')
         | rejectattr('state', 'in', ['unavailable', 'unknown'])
         | list | length }}
    timeout: "00:00:05"
    continue_on_timeout: true
mode: single
description: ""
icon: mdi:speaker

Any tips appreciated!

Looks like you are making one announcement after another without waiting for the first one to finish. Put a wait template between them, wait for the speaker/player to be idle.

Thanks, Tom. Shouldn’t the announcement play simultaneously on all speakers?

Yes but your automation is making more than one announcement. The second is interrupting the first.

Hmm, I think you’re right. I don’t know how I missed that! I guess that’s why these forums exist. :slight_smile:

I have deleted the final action which appears to be redundant. Let’s see how it goes.

I have simplified things and here is what I have found:

if I choose the Run Action command and HA hasn’t spoken recently, one speaker sometimes gets cut off. For example, the Living Room speaker might say “…but the dryer is still running” while the Master Bedroom speaker speaks the entire sentence. Sometimes it will just play the attention beep and nothing else. If I play it again, it appears to play from cache and speak correctly.

Oddly, the Living Room speaker had just played some music, so it was not idle.

I have tried both the HA Cloud and Google TTS engines, and they both have the issue.