I’m using MPD for local TTS and sounds through USB speakers attached to the Windows 10 computer where I have HA running on VirtualBox, and it works well, except I can’t seem to set the volume for it.
I call media_player.volume_set in my script, but it just gets ignored, and MPD always defaults to 85% when playing sound, and 0% when it is not.
Here is the script that I use. The sound and the message are are played properly, but even though the trace shows that the sound level should have been set it always is around 85%.
alias: announce
sequence:
- service: media_player.volume_set
target:
entity_id: media_player.mpd
data:
volume_level: '{{ states(''input_number.volume'') | float }}'
- service: media_player.play_media
target:
entity_id: media_player.mpd
data:
media_content_id: http://192.168.1.99:8123/local/sounds/{{type}}.mp3
media_content_type: audio/mp3
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 750
- service: tts.cloud_say
data:
entity_id: media_player.mpd
language: en-US
message: '{{ message }}'
options:
gender: female
mode: single
icon: mdi:bullhorn
And now the trace that shows it SHOULD be setting the volume:
Result:
params:
domain: media_player
service: volume_set
service_data:
volume_level: 0.1
entity_id:
- media_player.mpd
target:
entity_id:
- media_player.mpd
running_script: false
limit: 10
Can anyone see what I am doing wrong?