Continue refactor of speech engine

This commit is contained in:
Jeffrey Stone 2019-07-15 21:40:39 -04:00
parent f7a8e39fe4
commit 9fe9e59afe
5 changed files with 67 additions and 129 deletions

View File

@ -75,6 +75,7 @@ automation:
call_weather_alerts: 1 call_weather_alerts: 1
call_overnight_forecast: 1 call_overnight_forecast: 1
call_upcoming_holidays: 1 call_upcoming_holidays: 1
call_reminders: 1
call_chores: 1 call_chores: 1
- id: good_morning_report - id: good_morning_report
@ -94,6 +95,8 @@ automation:
call_current_conditions_inside: 1 call_current_conditions_inside: 1
call_daily_forecast: 1 call_daily_forecast: 1
call_upcoming_birthdays: 1 call_upcoming_birthdays: 1
call_reminders: 1
call_chores: 1
- service: script.twitter_notify - service: script.twitter_notify
data: data:
message: 'I just provided a morning briefing including weather, and traffic message: 'I just provided a morning briefing including weather, and traffic

View File

@ -6,56 +6,16 @@
############################################################################### ###############################################################################
automation: automation:
- id: guest_mode_feedback
alias: Guest Mode Audio Feedback
trigger:
- platform: state
entity_id:
- input_boolean.guest_mode
from: 'off'
to: 'on'
action:
- service: script.jarvis_voice
data_template:
message: >
{{ [
"Guest Mode has been enabled.",
"I have switched to the system to guest mode.",
"I have enabled guest mode. ",
"Guest Mode is on."
] | random }}
- id: sentry_mode_feedback
alias: Sentry Mode Audio Feedback
trigger:
- platform: state
entity_id:
- input_boolean.sentry_mode
from: 'off'
to: 'on'
action:
- service: script.jarvis_voice
data_template:
message: >
{{ [
"Sentry Mode has been enabled.",
"Anchorage House is secure.",
"I have enabled sentry mode. ",
"I am monitoring Anchorage House."
] | random }}
script: script:
activate_house_party_protocol: activate_house_party_protocol:
sequence: sequence:
- service: script.jarvis_voice
data_template:
message: !include ../templates/jarvis_confirmations.yaml
- delay:
seconds: 3
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.house_party_protocol entity_id: scene.house_party_protocol
- service: script.jarvis_voice - service: script.ah_report
data_template: data_template:
message: > speech_message: >
{{ [ {{ [
"Anchorage House has been configured for a House Party.", "Anchorage House has been configured for a House Party.",
"Incense has been turned on.", "Incense has been turned on.",

View File

@ -245,26 +245,6 @@ script:
</speak> </speak>
cache: true cache: true
# speech_jarvis:
# sequence:
# - condition: state
# entity_id: binary_sensor.quiet_time
# state: 'off'
# - service: tts.amazon_polly_say
# data_template:
# entity_id: >
# {% if states.input_boolean.audible_notifications.state == 'on' %}
# media_player.hass_speaker
# {% else %}
# media_player.googlehome0715, media_player.googlehomehub3492
# {% endif %}
# message: >-
# <speak>
# {{ message }}
# </speak>
# cache: true
ah_report: ah_report:
sequence: sequence:
- condition: or - condition: or
@ -302,6 +282,9 @@ script:
"No Problem.", "No Problem.",
"I think I can handle that.", "I think I can handle that.",
"Working on it now.", "Working on it now.",
"Why not. It's not like I ever sleep.",
"As Always, a great pleasure watching you work.",
"I am afraid I can't do that Dave,,,I'm kidding.",
"Funny, I was just about to do that. " "Funny, I was just about to do that. "
] | random }} ] | random }}
{% endmacro %} {% endmacro %}
@ -523,13 +506,21 @@ script:
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
{% macro reminders() %}
{% if is_state("input_boolean.heartworm", "on") %}
Today is the day Winston gets his heartworm medicine.
{% endif %}
{% endmacro %}
{% macro chores() %} {% macro chores() %}
Be sure to make your bed!
{% if is_state("sensor.weekday", "mon") %} {% if is_state("sensor.weekday", "mon") %}
{{ [ "Don't forget tomorrow is Trash Day. ", {{ [ "Don't forget tomorrow is Trash Day. ",
"I advise you move the trash cans to the curb for the weekly pickup. ", "I advise you move the trash cans to the curb for the weekly pickup. ",
" The trash and recycle should go out" " The trash and recycle should go out"
] | random }} ] | random }}
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
{% macro door_status() %} {% macro door_status() %}
@ -798,6 +789,10 @@ script:
{{ clothes_suggestion() }} {{ clothes_suggestion() }}
{% endif %} {% endif %}
{% if call_reminders == 1 %}
{{ reminders() }}
{% endif %}
{% if call_chores == 1 %} {% if call_chores == 1 %}
{{ chores() }} {{ chores() }}
{% endif %} {% endif %}
@ -888,40 +883,6 @@ script:
data_template: data_template:
message: !include ../templates/twitter_new_ha.yaml message: !include ../templates/twitter_new_ha.yaml
###############################################################################
# Morning Report
###############################################################################
# morning_report:
# sequence:
# - service: script.jarvis_voice
# data_template:
# message: !include ../templates/morning_report.yaml
###############################################################################
# Skylar Get Dressed
###############################################################################
# skylar_morning_greeting:
# sequence:
# - service: script.jarvis_voice
# data_template:
# message: !include ../templates/skylar_morning.yaml
###############################################################################
# Nightly Report
###############################################################################
# nightly_report:
# sequence:
# - service: script.jarvis_voice
# data_template:
# message: !include ../templates/nightly_report.yaml
# test_nightly_report:
# sequence:
# - service: script.jarvis_voice
# data_template:
# message: !include ../templates/nightly_report.yaml
############################################################################### ###############################################################################
# Weather Report # Weather Report
############################################################################### ###############################################################################
@ -986,13 +947,3 @@ script:
- service: script.ah_report - service: script.ah_report
data: data:
call_kat_headed_home: 1 call_kat_headed_home: 1
###############################################################################
# Prebed Routing
###############################################################################
# prebed_routine:
# sequence:
# - service: script.jarvis_voice
# data_template:
# message: !include ../templates/skylar_night.yaml
# # message: >
# # Bed time is in 30 mins. If you are taking a bath now is the time to get in the tub, otherwise time to put on pajamas and brush teeth.

View File

@ -155,9 +155,10 @@ automation:
entity_id: input_boolean.audible_notifications entity_id: input_boolean.audible_notifications
state: 'on' state: 'on'
action: action:
- service: script.jarvis_voice - service: script.ah_report
data_template: data_template:
message: "I thought you might like to know, the {{ trigger.to_state.attributes.friendly_name }} has been standing open for more than a minute." speech_message: " the {{ trigger.to_state.attributes.friendly_name }} has been standing open for more than a minute."
call_interuption: 1
initial_state: true initial_state: true
- id: garage_opened_night - id: garage_opened_night
@ -202,7 +203,7 @@ automation:
entity_id: input_boolean.sentry_mode entity_id: input_boolean.sentry_mode
state: 'on' state: 'on'
action: action:
- service: script.jarvis_notify - service: script.jarvis_alert
data_template: data_template:
message: "My security protocols are being overidden,, The {{ trigger.to_state.attributes.friendly_name }} has been opened." message: "My security protocols are being overidden,, The {{ trigger.to_state.attributes.friendly_name }} has been opened."
- service: script.text_alert - service: script.text_alert
@ -222,9 +223,9 @@ automation:
from: 'off' from: 'off'
to: 'on' to: 'on'
action: action:
- service: script.jarvis_voice - service: script.ah_report
data: data_template:
message: > speech_message: >
{{ [ {{ [
"Barn door protocol has been activated.", "Barn door protocol has been activated.",
"Anchorage House has been secured! ", "Anchorage House has been secured! ",
@ -241,15 +242,34 @@ automation:
from: 'on' from: 'on'
to: 'off' to: 'off'
action: action:
- service: script.jarvis_voice - service: script.ah_report
data: data_template:
message: > speech_message: >
{{ [ {{ [
"Barn door protocol has been deactivated.", "Barn door protocol has been deactivated.",
"I am no longer monitoring the access points. ", "I am no longer monitoring the access points. ",
"Sentry Mode has been switched off. " "Sentry Mode has been switched off. "
] | random }} ] | random }}
- id: guest_mode_feedback
alias: Guest Mode Audio Feedback
trigger:
- platform: state
entity_id:
- input_boolean.guest_mode
from: 'off'
to: 'on'
action:
- service: script.ah_report
data_template:
speech_message: >
{{ [
"Guest Mode has been enabled.",
"I have switched to the system to guest mode.",
"I have enabled guest mode. ",
"Guest Mode is on."
] | random }}
script: script:
lockdown_issue: lockdown_issue:
sequence: sequence:
@ -367,25 +387,29 @@ script:
activate_barn_door_protocol: activate_barn_door_protocol:
sequence: sequence:
- service: script.jarvis_voice - service: script.ah_report
data_template: data:
message: !include ../templates/jarvis_confirmations.yaml call_confirmation: 1
- delay:
seconds: 2
- service: input_boolean.turn_on - service: input_boolean.turn_on
entity_id: input_boolean.sentry_mode entity_id: input_boolean.sentry_mode
deactivate_barn_door_protocol: deactivate_barn_door_protocol:
sequence: sequence:
- service: script.jarvis_voice - service: script.ah_report
data_template: data:
message: !include ../templates/jarvis_confirmations.yaml call_confirmation: 1
- delay:
seconds: 2
- service: input_boolean.turn_off - service: input_boolean.turn_off
entity_id: input_boolean.sentry_mode entity_id: input_boolean.sentry_mode
activate_guest_mode: activate_guest_mode:
sequence: sequence:
- service: script.jarvis_voice - service: script.ah_report
data_template: data:
message: !include ../templates/jarvis_confirmations.yaml call_confirmation: 1
- delay: - delay:
seconds: 2 seconds: 2
- service: input_boolean.turn_on - service: input_boolean.turn_on

View File

@ -119,9 +119,9 @@ automation:
- condition: template - condition: template
value_template: "{{ (('Severe' in states.sensor.nws_alerts.attributes.title) or ('Thunderstorm' in states.sensor.nws_alerts.attributes.title)) and 'Warning' in states.sensor.nws_alerts.attributes.title }}" value_template: "{{ (('Severe' in states.sensor.nws_alerts.attributes.title) or ('Thunderstorm' in states.sensor.nws_alerts.attributes.title)) and 'Warning' in states.sensor.nws_alerts.attributes.title }}"
action: action:
- service: script.jarvis_voice - service: script.ah_report
data_template: data_template:
message: > speech_message: >
{% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %} {% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }} The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }}
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %} {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %}
@ -141,9 +141,9 @@ automation:
"The weather outside is getting intense, so I just made a weather announcement.", "The weather outside is getting intense, so I just made a weather announcement.",
"Anchorage House monitors the NWS using #HomeAssistant just for these occasions. Thanks for the heads up @NWSAtlanta " ] | random }}' "Anchorage House monitors the NWS using #HomeAssistant just for these occasions. Thanks for the heads up @NWSAtlanta " ] | random }}'
- delay: '00:00:15' - delay: '00:00:15'
- service: script.jarvis_voice - service: script.ah_report
data_template: data_template:
message: > speech_message: >
{% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %} {% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }} The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }}
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %} {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %}