Is there some way how I could prevent script starting next in sequence while Alexa is still speaking without setting explicit delay for x seconds since length of text may vary?
In script below Alexa is still speaking whatever is passed in as “message” but volume is already changing in the middle of sentence.
alexa_speak:
sequence:
- service: input_number.set_value
data_template:
entity_id: input_number.alexa_volume_holder
value: "{{ states.media_player.mana_alexa.attributes.volume_level | default(0.4) }}"
- service: media_player.volume_set
data_template:
entity_id: media_player.mana_alexa
volume_level: "{{ volume | float }}"
- service: media_player.alexa_tts
data_template:
entity_id: media_player.mana_alexa
message: "{{ message }}"
- service: media_player.volume_set
data_template:
entity_id: media_player.mana_alexa
volume_level: "{{ states.input_number.alexa_volume_holder.state | float }}"