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 name: Speech notifications
icon: mdi:chat icon: mdi:chat
sarah_talking:
name: SARAH talking
icon: mdi:chat
initial: off
script: script:
say: say:
alias: Speech - Say alias: Speech - Say
@@ -48,6 +53,10 @@ script:
sonos_blast: sonos_blast:
alias: Speech - Sonos blast alias: Speech - Sonos blast
sequence: sequence:
# Mark SARAH as talking.
- service: input_boolean.turn_on
entity_id: input_boolean.sarah_talking
# Don't shout :)
- service: media_player.volume_set - service: media_player.volume_set
entity_id: media_player.master_bedroom entity_id: media_player.master_bedroom
data_template: data_template:
@@ -57,10 +66,17 @@ script:
{% else %} {% else %}
0.5 0.5
{% endif %} {% endif %}
# Say message.
- service: tts.amazon_polly_say - service: tts.amazon_polly_say
data_template: data_template:
entity_id: media_player.master_bedroom entity_id: media_player.master_bedroom
message: "{{ message }}" 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: sonos_say:
alias: Speech - Sonos say alias: Speech - Sonos say
+10 -7
View File
@@ -20,13 +20,10 @@ script:
# Wait a while for me to enter before welcoming. # Wait a while for me to enter before welcoming.
- delay: 00:00:02 - delay: 00:00:02
- service: script.coming_home_welcome_home
- service: script.coming_home_say_welcome coming_home_welcome_home:
- delay: 00:00:13 alias: Routine - Coming home - Welcome home
- service: script.music_play
coming_home_say_welcome:
alias: Routine - Coming home - Say welcome
sequence: sequence:
- service: script.say - service: script.say
data_template: data_template:
@@ -35,7 +32,10 @@ script:
- !include ../../templates/partials/time.yaml - !include ../../templates/partials/time.yaml
- "Here's the current status:" - "Here's the current status:"
- !include ../../templates/partials/window_check.yaml - !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 - service: script.say
data_template: data_template:
message: >- message: >-
@@ -47,3 +47,6 @@ script:
"Here's some music." "Here's some music."
] | random ] | random
}} }}
- delay: 00:00:02
- service: script.music_play
+7 -1
View File
@@ -4,12 +4,17 @@ script:
sequence: sequence:
- service: fan.turn_off - service: fan.turn_off
entity_id: fan.philips_airpurifier entity_id: fan.philips_airpurifier
- service: script.routine_morning_briefing - 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 - service: script.say
data: data:
message: "Here's some music to start the day!" message: "Here's some music to start the day!"
- delay: 00:00:02 - delay: 00:00:02
- service: script.music_play - service: script.music_play
routine_morning_briefing: routine_morning_briefing:
@@ -21,6 +26,7 @@ script:
- !include ../../templates/partials/greeting.yaml - !include ../../templates/partials/greeting.yaml
- !include ../../templates/partials/time.yaml - !include ../../templates/partials/time.yaml
- >- - >-
{{ {{
[ [
"Here's your briefing for today!", "Here's your briefing for today!",