Upgrade speech - wait for SARAH to stop talking

This commit is contained in:
2020-03-08 13:04:57 +02:00
parent 2320d5a924
commit 67cca3fa38
3 changed files with 33 additions and 8 deletions
+16
View File
@@ -3,6 +3,11 @@ input_boolean:
name: Speech notifications
icon: mdi:chat
sarah_talking:
name: SARAH talking
icon: mdi:chat
initial: off
script:
say:
alias: Speech - Say
@@ -48,6 +53,10 @@ script:
sonos_blast:
alias: Speech - Sonos blast
sequence:
# Mark SARAH as talking.
- service: input_boolean.turn_on
entity_id: input_boolean.sarah_talking
# Don't shout :)
- service: media_player.volume_set
entity_id: media_player.master_bedroom
data_template:
@@ -57,10 +66,17 @@ script:
{% else %}
0.5
{% endif %}
# Say message.
- service: tts.amazon_polly_say
data_template:
entity_id: media_player.master_bedroom
message: "{{ message }}"
# Wait for phrase to be over and mark as not talking.
- delay: 00:00:01
- wait_template: "{{ is_state('media_player.master_bedroom', 'paused') }}"
timeout: 00:02:00
- service: input_boolean.turn_off
entity_id: input_boolean.sarah_talking
sonos_say:
alias: Speech - Sonos say
+10 -7
View File
@@ -20,13 +20,10 @@ script:
# Wait a while for me to enter before welcoming.
- delay: 00:00:02
- service: script.coming_home_welcome_home
- service: script.coming_home_say_welcome
- delay: 00:00:13
- service: script.music_play
coming_home_say_welcome:
alias: Routine - Coming home - Say welcome
coming_home_welcome_home:
alias: Routine - Coming home - Welcome home
sequence:
- service: script.say
data_template:
@@ -35,7 +32,10 @@ script:
- !include ../../templates/partials/time.yaml
- "Here's the current status:"
- !include ../../templates/partials/window_check.yaml
- delay: 00:00:10
- wait_template: "{{ is_state('input_boolean.sarah_talking', 'off') }}"
timeout: 00:02:00
- delay: 00:00:01
- service: script.say
data_template:
message: >-
@@ -47,3 +47,6 @@ script:
"Here's some music."
] | random
}}
- delay: 00:00:02
- service: script.music_play
+7 -1
View File
@@ -4,12 +4,17 @@ script:
sequence:
- service: fan.turn_off
entity_id: fan.philips_airpurifier
- service: script.routine_morning_briefing
- delay: 00:00:35
- wait_template: "{{ is_state('input_boolean.sarah_talking', 'off') }}"
timeout: 00:02:00
- delay: 00:00:01
- service: script.say
data:
message: "Here's some music to start the day!"
- delay: 00:00:02
- service: script.music_play
routine_morning_briefing:
@@ -21,6 +26,7 @@ script:
- !include ../../templates/partials/greeting.yaml
- !include ../../templates/partials/time.yaml
- >-
{{
[
"Here's your briefing for today!",