Chromecast with GTV Volume going to 0 when doing TTS

I am new at this but built the following automation.
Just so you know what is happening here:
I have a power down automation that will set the JBL and Chromecast w/GTV volume to 0.
This works.
My Power Up automation…
I have added a few extra steps, moved stuff around, all trying to figure out why my Chromecast w/GTV is going to zero.
So right now, I am trying to set the volume to 60 first thing. This works.
I added the play of 1 second silent mp3 to make sure I am waking up the device (as the google devices are set to off after awhile, this was causing me some missed steps in the automation). This WAS first on the list, but been trying some experimentation which is why you see the volume set first now.
I do a delay
I then set the JBL speaker to 75.
delay
I use IR to turn the amplifier from USB to BT, have to hit the button twice.
I then set the Pool radio volume to 60 again.
I then delay.
Now, at this part of the automation, I can watch on my google home. the volume goes from 0 to 60, from the previous steps. Now when it gets here, the volume is set to zero automatically. Then it does the TTS.
I can’t figure out what is causing the volume to go to zero. I keep thinking it is the TTS, but I dont know how to resolve that.

service: tts.cloud_say
data:
  entity_id: media_player.pool_radio
  message: >-
    {% set forecast = state_attr('weather.hedrick', 'forecast')[0] %} Today will
    be {{forecast.condition}} with a high of {{forecast.temperature}} and a low
    of {{forecast.templow}}. Currently it is
    {{states('sensor.hedrick_apparent_temperature')}} degrees. The pool water is
    currently at {{states('sensor.pool_temp')}} degrees
  options:
    gender: male
service: media_player.volume_set
data:
  volume_level: 0.6
target:
  entity_id: media_player.pool_radio

Here is part of my code. I am not sure why the chromecast is going back to its zero volume.

- service: media_player.volume_set
  data:
    volume_level: 0.65
  target:
    entity_id: media_player.pool_radio
- delay:
    hours: 0
    minutes: 0
    seconds: 3
    milliseconds: 0
- service: tts.cloud_say
  data:
    entity_id: media_player.pool_radio
    message: >-
      {% set forecast = state_attr('weather.hedrick', 'forecast')[0] %} Today
      will be {{forecast.condition}} with a high of {{forecast.temperature}}
      and a low of {{forecast.templow}}. Currently it is
      {{states('sensor.hedrick_apparent_temperature')}} degrees. The pool
      water is currently at {{states('sensor.pool_temp')}} degrees

Im not sure why its going to zero, but that 3 second delay before the tts can be an issue. I know my players will go to idle within a second. I use that idle state as a trigger to resume playing of the Roku or whatever was paused to make way for the TTS.
You may be able to watch the logs and see what is lowering the volume.

1 Like