Volume to 100% on TTS Notification for Google Home devices?

Does anyone have any suggestions or can point me to some configuration whereby the volume on my defined media players for TTS notification will increase to 100%. Still learning my way around configuration.yaml and don’t quite understand how I might call that parameter. Below is my current config

# Front Door Motion        
  - alias: 'FrontDoorMotion'
    trigger:
      - platform: state
        entity_id: binary_sensor.front_door_motion
        to: 'on'
    action:
      - service: tts.google_translate_say
        entity_id: 
          - media_player.home
        data:
          message: 'Motion detected at the front door'
      - service: notify.mobile_app_vadennote20
        data:
          message: 'Motion detected at the front door'
  action:
  - data:
      volume_level: 0.7
    entity_id: media_player.den_speaker
    service: media_player.volume_set

Volume level 0.7 is 70%, so 1.0 would be 100%

Thank you very much for the reply. I am not clear on how I would add that line to my current config. Could I get a little more direction?

Might be better if I show you a whole automation, but basically put it as your first action:
(I cut and pasted, so the spacing may be off.)

# Front Door Motion        
  - alias: 'FrontDoorMotion'
    trigger:
      - platform: state
        entity_id: binary_sensor.front_door_motion
        to: 'on'
    action:
    - data:
        volume_level: 0.7
      entity_id: media_player.home
      service: media_player.volume_set
      - service: tts.google_translate_say
        entity_id: 
          - media_player.home
        data:
          message: 'Motion detected at the front door'
      - service: notify.mobile_app_vadennote20
        data:
          message: 'Motion detected at the front door'
```

@wolfer4004 Do you know how to reduce the volume back to original/another level ‘AFTER’ the notification with increased volume is played. ?

Add a delay of at least two seconds, then a wait until media_player is idle, then reduce the volume the same way as it was increased.

1 Like

Awesome… that worked. Here is my entry in automation.yaml , incase someone need it.

- id: '16342415'
  alias: Increase Volume for Notification and Lower it after the announcement 
  description: 'I used the phone getting plugged in for charging as trigger as its easy to simulate'
  trigger:
  - type: plugged_in
    platform: device
    device_id: f58f9aaf5c33ba28
    entity_id: binary_sensor.myphone_is_charging
    domain: binary_sensor
  condition: []
  action:
  - service: media_player.volume_set
    data_template:
      entity_id: media_player.study_room_speaker
      volume_level: 0.7
  - service: tts.google_say
    data:
      entity_id: media_player.study_room_speaker
      message: 'Its plugged in.. '
  - wait_template: 'wait_template: {{ is_state(''media_player.study_room_speaker'',
      ''off'') }}'
    timeout: '2'
  - service: media_player.volume_set
    data_template:
      entity_id: media_player.study_room_speaker
      volume_level: 0.3
  - service: tts.google_say
    data:
      entity_id: media_player.study_room_speaker
      message: I reduced the volume to 30%
  mode: single
1 Like

That is not the same as I said.
It’s quite a lot different.

I said delay two seconds then wait until idle.
That means it will lower the volume right after the TTS is done.

Your code on the other hand waits until off or two seconds timout.
I don’t think a message will even be played in two seconds so my guess is that it has already lowered the volume before the TTS is even played.

But sure, if you’re pleased than that’s great.