I did it. I defeated the horrible Google Home "cast-start" prompt sound!

- id: mantieni_google_home_mini_attivi_hub

    alias: Mantieni tutti i Google Home Mini attivi

    description: ''

    trigger:

      - platform: state

        entity_id: >-

          media_player.corridoio,media_player.cucina,media_player.disimpegno,media_player.bagno_principale,media_player.bagno_secondario,media_player.google_home_mini

        to: 'off'

        for: '00:00:10'

      - platform: state

        entity_id: >-

          media_player.corridoio,media_player.cucina,media_player.disimpegno,media_player.bagno_principale,media_player.bagno_secondario,media_player.google_home_mini

        from: unavailable

      - platform: state

        entity_id: >-

          media_player.corridoio,media_player.cucina,media_player.disimpegno,media_player.bagno_principale,media_player.bagno_secondario,media_player.google_home_mini

        to: 'off'

        for: '00:00:10'

        from: idle

      - platform: state

        entity_id: >-

          media_player.corridoio,media_player.cucina,media_player.disimpegno,media_player.bagno_principale,media_player.bagno_secondario,media_player.google_home_mini

        to: idle

        for: '00:00:10'

        from: 'on'

    action:

      - service: media_player.volume_set

        data:

          volume_level: 0

          entity_id: '{{ trigger.entity_id }}'

      - service: media_player.turn_on

        data:

          entity_id: '{{ trigger.entity_id }}'

      - service: media_player.play_media

        data:

          media_content_id: 'http://192.168.2.101:8123/local/1sec.mp3'

          media_content_type: music

          entity_id: '{{ trigger.entity_id }}'

      - delay:

          hours: 0

          minutes: 0

          seconds: 2

          milliseconds: 0

      - service: media_player.volume_set

        data:

          volume_level: "{{states('sensor.period_of_day_volume')|float}}"

          entity_id: '{{ trigger.entity_id }}'

    mode: queued

    max: 10

trigger.entity_id do the trick.

Than you

1 Like

So question for @lolouk44 , @CarlosGS and @Emphyrio ; does this also work for Google/Nest devices with a screen? E.g. my Nest Hub with picture frame is beneath my TV. i would not want it to switch to a different view all of the time.

Well yes and no. Yes it will work and not play the connection sound, but no because it’ll stop displaying the photo and display the media player screen instead.what you probably want to do instead is have a script that will bring the vol to 0, connect with a 1 sec, then set the vol to whichever number you then play your announcement.
This will mean a delay, and the announcement will anyway stop the photo display

Oh magic ! Exactly what i am searching ! Thanks ! Work flawlessly. Only slow to start playing but worth it for not hearing the cast start sound :smiley:

1 Like

I tried this automation but the minis keep bleeping every 2 seconds. I do not have the sensor.period_of_day_volume and filled in 0.55 as volume. how did you define this sensor? In a script? And you don’t have the constant volume change bleepings?

Is it just me or is is something with 2021.12.2 version that google home mini stays in ‘playing’ state after playing 1 second sound for more or less 5 minutes so my automation to defeat this prompt sound is not working?

I created Google home mini stays in 'playing' state after playing 1 second sound for more or less 5 minutes · Issue #62007 · home-assistant/core · GitHub

For me have the same problem after update. “playing” always.

same here, which means the google mini turns off after 5 min and triggers the cast start sound :frowning:

Exactly. Unfortunately nothing is happening with my issue :frowning:

I’ve reverted back to 2021.12.1 for now as not only media_players no longer go to idle state, I’m also missing information on what’s actually playing (media_content_id attribut missing) and this is screwing my lovelace radio player card

Please report it.

Same issue here. Reverted back for now and will report.

I have the same issue, anybody report this yet?

yes, here:

So it looks like they implemented a fix in 2021.12.5 that is working but now I’m finding the state of my Plex client isn’t updating, which is very similar to this issue. Anybody seeing that problem as well?

someone succeed to remove volume up and the volume down sound ?
thanks

I finally figured out after hours what the issue is.
This will only work for a single google home it seems.
From my testing it looks like the last google home in your account that has been triggered puts all the others to sleep.
Example:
I trigger google home 1 with silent track i get the blink and I can control volume
I trigger google home 1 again before it sleeps, no blink, but can still control volume
Keep doing above, no blink, still control volume

I trigger google home 1 with a silent track, i get the blink, and have volume control
I trigger google home 2 with a silent track, i get the blink, and have volume control of #2 but no longer #1
I trigger google home 1 with a silent track, i get the blink, and have volume control of #1 but no longer #2

any idea of my issue ? :slight_smile:

Hello all!

Sorry to hijack this post, but it’s very, very relevant.

I have been working over the last few weeks to develop this script which can be called by other scripts and automations. It’s as user-friendly as the usual media player service. No need to edit the script, in fact, I encourage you not to if you’re not sure what you’re doing.

What is it?

The script will allow you to select a player, set an optional volume and link to your media player content. No need for any “silent” tracks, loops, or anything other than the script.

The script will play the media (without any casting sound), and then restore its state back to what it was before.
For example, you can use it to ring an alert, and after the alert, it will restore volume (if changed) and continue playing whatever was playing before.

Installation:
Create a new script, switch to YAML mode, and copy-paste the script below in and save it. That’s it! It’s ready to use

Issues:

Some issues is that sometimes you will hear a volume “bloop” sound at the end of the automation if you changed the volume. I’ve also had it not resume playback of media it was previously playing, but that may have been because of my Internet connection (it was a radio stream).

I may improve the script over time with some feedback. One feature that could be considered is an option to not restore the previous state, but that’s not a part of this script.

Tested on the latest Home Assistant to this date (2022.2) on my Google Home Minis.

Enjoy!

alias: Google Speaker Play
mode: parallel
icon: mdi:cast-audio
description: >-
  Plays media (on Google Speakers) at the specified volume without the extra
  bleeps and bloops. Restores the state back after it is done.
fields:
  playback_entity:
    name: Playback Entity
    description: The entity that will play the sound
    required: true
    selector:
      entity:
        domain: media_player
  playback_volume:
    name: Volume
    description: Volume to play the sound at
    required: false
    selector:
      number:
        min: 0
        max: 100
        step: 10
        unit_of_measurement: percent
        mode: slider
  media_location:
    name: Content ID
    description: The ID of the content to play. Platform dependent.
    example: media-source://media_source/local/folder_name/file.wav
    required: true
    selector:
      text: null
  media_type:
    name: Content type
    description: >-
      The type of the content to play. Like image, music, tvshow, video,
      episode, channel or playlist.
    example: media-source://media_source/local/folder_name/file.wav
    required: true
    default: music
    selector:
      text: null
sequence:
  - service: scene.create
    data:
      scene_id: before_state_{{ playback_entity|replace(".", "_") }}
      snapshot_entities: '{{ playback_entity }}'
  - service: media_player.volume_mute
    data:
      is_volume_muted: true
    target:
      entity_id: '{{ playback_entity }}'
  - service: media_player.play_media
    data:
      media_content_id: '{{ media_location }}'
      media_content_type: '{{ media_type }}'
    target:
      entity_id: '{{ playback_entity }}'
  - wait_template: '{% if states(playback_entity) == ''playing'' %}true{% endif %}'
    timeout: '00:00:02'
    continue_on_timeout: true
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ playback_volume is number and playback_volume > -1 }}'
        sequence:
          - service: media_player.volume_set
            data:
              volume_level: ' {{ playback_volume / 100 }} '
            target:
              entity_id: '{{ playback_entity }}'
  - service: media_player.volume_mute
    data:
      is_volume_muted: false
    target:
      entity_id: '{{ playback_entity }}'
  - wait_template: '{% if states(playback_entity) == ''idle'' %}true{% endif %}'
    timeout: '00:05:00'
    continue_on_timeout: false
  - service: scene.turn_on
    data: {}
    target:
      entity_id: scene.before_state_{{ playback_entity|replace(".", "_") }}
2 Likes

Thanks, I’ve tried this in my HA (2022.2) and Nest Mini(s), but

  1. I still get the casting sound
  2. Although the volume level is properly restored after the script is called, it’s not resuming the playback

Am I missing something?
Thanks!