Disable Google Home casting sound

Tags: #<Tag:0x00007fc4126149b8> #<Tag:0x00007fc4126146e8> #<Tag:0x00007fc412614580> #<Tag:0x00007fc412614260> #<Tag:0x00007fc412614080>

When I first started integrating my Nest Minis to Home Assistant, I noticed that the speaker always plays a short chime whenever HA tries to connect it. This ruins my doorbell automation, which plays a custom doorbell chime when the doorbell is pressed.

I checked out this thread which was able to disable the sound and while it does offer a nice workaround, it feels a bit tedious to configure with the idle and off timing frequency of the Nest minis.

After messing around for a while, I was able to come up with a short and simple solution with a script:

alias: Disable google cast sound
sequence:
  - choose:
      - conditions:
          - condition: state
            entity_id: media_player.$PLAYER
            state: 'off'
        sequence:
          - service: media_player.volume_set
            target:
              entity_id: media_player.$PLAYER
            data:
              volume_level: 0
          - service: media_player.turn_on
            target:
             entity_id: media_player.$PLAYER
          - wait_template: '{{ is_state(''media_player.$PLAYER'', ''idle'') }}'
      - conditions:
          - condition: state
            entity_id: media_player.$PLAYER
            state: idle
        sequence: []
    default: []
  - service: media_player.volume_set
    target:
      entity_id: media_player.$PLAYER
    data:
      volume_level: $VOLUME_LEVEL
  - service: media_player.play_media
    target:
      entity_id: media_player.$PLAYER
    data:
      media_content_id: '$AUDIO_URL'
      media_content_type: audio
mode: single

How it works:

  1. Check if Nest Mini is either off or idle. If it is idle, skip to step 5.

  2. If Nest Mini is off, set its volume to 0%.

  3. Turn on the Nest Mini with Home Assistant’s call service.

  4. Wait for the state of the Nest Mini to change from off to idle.

  5. Once it is idle, set the volume to whichever you desire.

  6. Audio is played on the Nest Mini without cast sound successfully.

Hope this helps anyone facing this issue! :smile:

4 Likes

I’ve been doing this in Node-Red for a little while now. Nice little work around.

How about this idea? My change below splits off the play-audio part so you can use this script also when you want to do other things, for example TTS.

As i could test it, it will mute the volume instead of setting it to ‘0’; also preventing the casting sound to appear. Then, once it becomes ‘idle’ it will unmute and continue with the flow. In the next part, it will again mute (so the one in the condition might be optional) and set the volume level so you don’t hear the volume change sound, as last step it will unmute and be ready for you to cast/play audio.

ready_cast_with_set_volume:
description: Ensures a Google Home device is activated with a pre-set volume
sequence:
  - choose:
      - conditions:
          - condition: state
            entity_id: media_player.$PLAYER
            state: 'off'
        sequence:
           - service: media_player.volume_mute
             data:
              entity_id: media_player.$PLAYER
              is_volume_muted: true
          - service: media_player.turn_on
            target:
             entity_id: media_player.$PLAYER
          - wait_template: '{{ is_state(''media_player.$PLAYER'', ''idle'') }}'
      - conditions:
          - condition: state
            entity_id: media_player.$PLAYER
            state: idle
        sequence:
           - service: media_player.volume_mute
             data:
              entity_id: media_player.$PLAYER
              is_volume_muted: false
    default: []
  - service: media_player.volume_mute
      data:
      entity_id: media_player.$PLAYER
      is_volume_muted: true
  - service: media_player.volume_set
    target:
      entity_id: media_player.$PLAYER
    data:
      volume_level: $VOLUME_LEVEL
  - service: media_player.volume_mute
      data:
      entity_id: media_player.$PLAYER
      is_volume_muted: false
mode: single

@Codestian feedback?

The only thing i notice is that volume changes also have a small ‘bloob’ feedback; still have to get rid of that.

Volume up seems to bloop, but volume down does not. Or was it the other way around? Not quite sure

That is interesting, i can check that.

Never thought of muting it instead of setting volume to 0%. Both methods do work as intended, though muting will restore the state of the previous volume, which can be convenient. Will try it out.

I think we will have to live with the volume boop sound effect, there’s no setting to disable it from Google’s end.