Hi
I’ve built a little script to make it easier for me to have my echos play a little sound clip. Which is working fine. However, I tried to add a volume change to it so you can actually hear it even while doing something.
It does kinda, sorta work. Occasionally it won’t raise the volume (I’m ok with that, altho, not really ideal…) but quite often one (or several) devices are stuck on high volume. I’ve tried to add some delays in there, but that didn’t seem to be working.
Is there any other way to make sure the volume is set to the initial value?
Like, a for loop that checks if the volume is set?
Here’s my current script:
alias: "Script: Play clip on Echo"
sequence:
- service: scene.create
data:
scene_id: before
snapshot_entities:
- media_player.echo_kuche
- media_player.buro_echo
- media_player.living_room
- service: media_player.volume_set
target:
entity_id: "{{speaker}}"
data:
volume_level: 0.4
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- service: notify.alexa_media
data:
message: >-
<audio
src='https://xxx/local/mp3/{{clip}}'/>
target: "{{speaker}}"
data:
type: tts
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- service: scene.turn_on
target:
entity_id: scene.before
metadata: {}
mode: single
icon: mdi:volume-high
fields:
clip:
selector:
text: null
name: Clip
description: Name of clip in mp3 folder
required: true
speaker:
selector:
entity:
multiple: true
filter:
domain: media_player
name: Speaker
default:
- media_player.living_room
- media_player.buro_echo
required: true