I've tried searching every combination of keywords I could think of online and in this forum, so forgive me if this is a trivial or already solved issue:
I am using my Voice PE to give me notifications for various events (when trash collection starts, when the laundry is finished, when the front door is opened, etc). For this purpose, I have set up two scripts, one to play an attention-grabbing sound effect and the other to announce the TTS message.
I often want to play these sounds at a different volume than what the Voice PE is usually set to, so in each of those scripts, I have an optional field that allows me to choose a volume to play at. The script will save the current media player's volume, set it to the volume I chose, play the sound effect/message, then set the volume back to its previous value.
Annoyingly, the volume that comes out of the Voice PE is not always the volume I set in the script. For example, I frequently set the sound effect to 100% and the announcement to 80%. When the automation runs, a few things could happen:
- Most of the time, the sound effect and announcement run at the correct volume.
- Sometimes, the sound effect will be pretty quiet, but the announcement is at the correct volume.
- Rarely, both the sound effect and the announcement play pretty quiet. Certainly quieter than what they're set to!
I added delays after the volume_set commands, thinking that maybe the WiFi communication between my HA instance and the Voice PE was a bit slow, but that didn't seem to fix it, even when I increased the delay to a massive two seconds.
What's also interesting is if I manually trigger the automation actions multiple times in a row, the first one usually has the bugged volume, but then the subsequent ones run fine.
This isn't the worst pain point in existence, but it is annoying that I can't rely on the notifications to do their job properly at all times. What am I missing to get this to work? I'll attach my scripts below.