Help with the Google Assisant Volume Automation

Hi All

I have configured automation to play something from the web at a particular time, multiple times every day, and have configured to set the Google home assistant volume to change to 40% before the audio plays up but at times google assistant turns to full volume before playing. Do I need to add a delay or any support is appreciated?

action:
  - service: media_player.volume_set
    data:
      volume_level: 0.4
    target:
      device_id: xxxxxxxxxxxxx
  - service: media_player.play_media
    data:
      media_content_type: audio/mp3
      media_content_id: https://www.xxxx.com/audio/xxxx.mp3
    target:
      device_id: xxxxxxx
mode: single

Thanks

Find an audio file that is just 1 second of silence. Play that first, and then set the volume. Then play your intended file.

Thanks, seems bit of a workaround

Hi,

You probably found out this “workaround” does not… work. That’s because the Chromecast volume gets physically maxxed out when the device restarts BUT if you use a UPnP client to control that volume, you will notice said client does NOT report the maximum volume (it will show instead the volume level it had prior to the restart). Nor is the UPnP client able to change that volume. EXCEPT for the Google Home app: as soon as you touch the volume dial (which also shows the level prior to the restart), you will hear the actual volume reverting to that same level.

The Google Home app must send some code to the Chromecast when we touch the volume dial. There should be a way to emulate that GH behavior in HA, right?