Updating my speech notifications....mostly just wording

This commit is contained in:
Jeffrey Stone 2021-05-24 11:46:53 -04:00
parent ed6e7b5d3c
commit f41bf5a9c7
5 changed files with 179 additions and 204 deletions

View File

@ -78,23 +78,14 @@ automation:
platform: template
value_template: "{{ states('sensor.time') == (state_attr('input_datetime.skylar_nightly_report', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
action:
- service: script.skylar_nightly_briefing
# - id: 15056866-5ac7-4b33-a371-ab9e449548d1
# initial_state: true
# alias: Nightly Report
# trigger:
# platform: template
# value_template: "{{ states('sensor.time') == (state_attr('input_datetime.nightly_report', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
# action:
# - service: script.nightly_briefing_report
- service: script.turn_on
entity_id: script.skylar_nightly_briefing
- id: 1d8f396a-f6ec-460d-97e3-d11900418f95
alias: Good Morning Report
initial_state: true
trigger:
# platform: template
# value_template: "{{ states('sensor.time') == (state_attr('input_datetime.morning_report', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
- platform: state
entity_id: binary_sensor.kitchen_occupancy
to: 'on'
@ -127,68 +118,78 @@ automation:
alias: Master Bedroom Report
initial_state: true
trigger:
#platform: template
#value_template: "{{ states('sensor.time') == (state_attr('input_datetime.daily_report', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
platform: time
at: input_datetime.daily_report
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
action:
- service: script.morning_wakeup_report
- id: 09bf89e7-180c-40fb-9543-5bd862e21049
alias: skylar morning alarm announcement
trigger:
platform: template
value_template: "{{ states('sensor.time') == (state_attr('input_datetime.skylar_morning_report', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
condition:
condition: template
value_template: '{{ states.calendar.skylar_school.attributes.offset_reached == True }}'
platform: time
at: input_datetime.skylar_morning_report
action:
- service: scene.turn_on
entity_id: scene.skylar_room_morning
- service: script.skylar_morning_briefing
- service: script.turn_on
entity_id: script.skylar_morning_briefing
- id: bbbafc52-eab1-44cd-ac24-4f9b7f4210b6
alias: set skylar morning report time
trigger:
- platform: time
at: '05:50:00'
at: '06:05:00'
action:
- service: input_datetime.set_datetime
entity_id: input_datetime.skylar_morning_report
data_template:
time: >
{% if states.calendar.skylar_school.attributes.offset_reached == True %}
06:15
{% if states('input_boolean.school_today', 'on') %}
06:25
{% else %}
07:15
{% endif %}
# - id: set_morning_report_time
# alias: set morning report time
# trigger:
# - platform: time
# at: '05:50:30'
# action:
# - service: input_datetime.set_datetime
# entity_id: input_datetime.morning_report
# data_template:
# time: >
# {% if states.calendar.skylar_school.attributes.offset_reached == True %}
# 07:10
# {% else %}
# 08:00
# {% endif %}
- id: e1cb2f28-0423-11eb-adc1-0242ac120002
alias: Skylar Event Starting soon
trigger:
- platform: state
entity_id: calendar.skylar_events
attribute: offset_reached
to: True
action:
- service: script.status_annc
data:
who: '{{ states.sensor.room_presence.state }}'
call_interuption: 1
call_skylar_events: 1
- service: script.text_notify
data_template:
who: "all_ios"
message: Skylar has {{ states.calendar.skylar_events.attributes.message }} in 45 minutes.
- id: e1cb2e6a-0423-11eb-adc1-0242ac120002
alias: School Pickup Reminder
trigger:
- platform: time
at: input_datetime.school_day_start_reminder
- platform: time
at: input_datetime.school_day_end_reminder
condition:
- condition: state
entity_id: calendar.skylar_school
attribute: offset_reached
state: True
action:
- service: script.status_annc
data:
who: '{{ states.sensor.room_presence.state }}'
call_interuption: 1
call_school_pickup_reminder: 1
- service: script.text_notify
data_template:
who: "all_ios"
message: It's almost time to head for school.
script:
reset_annc_switches:
@ -198,64 +199,76 @@ script:
security_briefing:
sequence:
- service: script.speech_engine
- service: script.status_annc
data_template:
who: '{{ states.sensor.alexa_audio.state }}'
message: !include ../templates/speech/security_report.yaml
who: '{{ states.sensor.room_presence.state }}'
message: !include ../templates/speech/security_briefing.yaml
event_briefing:
welcome_briefing:
sequence:
- condition: state
entity_id: input_boolean.welcome_home
state: 'on'
- delay: 00:04:00
- service: script.speech_engine
data_template:
who: '{{ states.sensor.alexa_audio.state }}'
message: !include ../templates/speech/event_briefing.yaml
data:
who: main
message: !include ../templates/speech/welcome_briefing.yaml
- delay: 00:02:00
- service: input_boolean.turn_off
entity_id: input_boolean.welcome_home
skylar_morning_briefing:
sequence:
- service: script.speech_engine
data:
who: >
{%- if is_state('media_player.theater_tv', 'on') %}
theater
{%- elif is_state('binary_sensor.skylar_room_occupancy', 'on') %}
skylar_bedroom
{% else %}
main
{%- endif %}
who: skylar_bedroom
message: !include ../templates/speech/skylar_morning_briefing.yaml
- service: script.text_notify
data:
who: "jeff"
message: "I just gave Skylars morning briefing."
skylar_nightly_briefing:
sequence:
- service: script.speech_engine
data_template:
who: main
data:
who: '{{ states.sensor.room_presence.state }}'
message: !include ../templates/speech/skylar_nightly_briefing.yaml
nightly_briefing_report:
sequence:
- service: script.speech_engine
- service: script.text_notify
data_template:
who: main
message: !include ../templates/speech/nightly_briefing.yaml
who: "all_ios"
message: "Time for Skylar to get ready for bed."
sundown_briefing:
sequence:
- service: script.speech_engine
data_template:
who: kitchen
data:
who: '{{ states.sensor.room_presence.state }}'
message: !include ../templates/speech/sundown_briefing.yaml
- service: script.text_notify
data_template:
who: "all_ios"
message: "Sun is almost down. Time to call it a day."
morning_briefing:
sequence:
- service: script.speech_engine
data_template:
data:
who: kitchen
message: !include ../templates/speech/morning_briefing.yaml
message: !include ../templates/speech/daily_briefing.yaml
daily_briefing:
sequence:
- service: script.speech_engine
data:
who: '{{ states.sensor.room_presence.state }}'
message: !include ../templates/speech/daily_briefing.yaml
morning_wakeup_report:
sequence:
- service: script.speech_engine
data_template:
data:
who: master_bedroom
message: !include ../templates/speech/morning_wakeup_report.yaml

View File

@ -57,24 +57,9 @@
and {{ states.weather.home.state }}
{% endif %}
{% if states.sensor.nws_alerts.state | int > 0 %}
There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area.
The National Weather Service Has issued,
{% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %}
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 %}
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] }}.
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] is defined %}
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] }}.
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] is defined %}
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] }}.
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] is defined %}
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] }}.
{% else %}
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[0] }}.
{% endif %}
{% endif %}
{% if states.sensor.gwinnett_active_alerts.state | int > 0 %}
There are currently {{states.sensor.gwinnett_active_alerts.state }} active weather alerts for our area.
{% endif %}
{% if is_state('binary_sensor.evening','on') %}
The overnight forecast says we can expect {{ states.sensor.nws_overnight_forecast.state }}
@ -177,6 +162,8 @@
{% endif %}
{% endif %}
{% if is_state('binary_sensor.evening','on') %}
{% if states.sensor.halloween_countdown.state | int == 1 %}
@ -209,26 +196,12 @@
{% else %}
{% endif %}
{% if states.sensor.trip_disney.state | int == 120 %}
There are only one hundred and twenty days until the next Disney Trip.
{% endif %}
{% if states.sensor.trip_disney.state | int == 60 %}
There are only on sixty days until the next Disney Trip.
{% endif %}
{% if states.sensor.trip_disney.state | int < 32 %}
{% if states.sensor.trip_disney.state | int > 1 %}
There are {{ states.sensor.trip_disney.state }} days until the next Disney Trip!
{% else %}
There is {{ states.sensor.trip_disney.state }} day until the next Disney Trip!
{% endif %}
{% endif %}
{% if states.sensor.anniversary_our_wedding.state | int == 1 %}
Tomorrow is Jeff and Katherine's Wedding Anniversary.
{% endif %}
{% if states.sensor.trip_disney.state | int == 1 %}
Oh, and there is just one more sleep until the next Disney Trip!
{% endif %}
{% else %}
{% if is_state('sensor.halloween_countdown','0') %}
Happy Halloween!
@ -258,8 +231,8 @@
{{states.calendar.national_holidays.attributes.message | replace("&"," and ") }}.
{% if 'Chocolate' in event %}
{{ [
'Oh. You had me at Chocolate. ',
'And I like chocolate. This sounds fun.'
'Oh. You had me at Chocolate. I like Chocolate.',
'And I like chocolate. This sounds fun. More Chocolate please!'
]|random }}
{%- endif -%}
@ -336,26 +309,27 @@
{%- endif -%}
{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %}
{% if is_state('input_boolean.school_today', 'on') and state_attr('input_datetime.school_day_end', 'timestamp') < as_timestamp(now()) %}
{{ [ 'Today is a school day.',
'It is a school day. '
] | random }}
<s>Pickup today will be at {{(state_attr('input_datetime.school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }}</s>
{% if states.calendar.skylar_school.attributes.description == 'digital-learning' %}
{% if 'Digital Learning' in states('sensor.school_event') %}
But it is a digital learning day so the commute will be short.
{% endif %}
{% if states.calendar.skylar_school.attributes.description == 'early-release' %}
{% if 'Early Release' in states('sensor.school_event') %}
And It is early release!
{% endif %}
{% endif %}
{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %}
{% if states.sensor.school_lunch.state == 'Nothing' %}
Skylar will want to take his lunch today.
{% if is_state('input_boolean.school_today', 'on') %}
{% if is_state('sensor.school_lunch', 'Nothing') %}
I am not sure what the school menu is for today, so plan on Skylar taking his lunch
{% else %}
Today's school lunch is {{ states.sensor.school_lunch.state }}, so he might be interested in buying his lunch.
{% endif %}
{% endif %}
{% if states.sensor.school_end_days2go.state |int <= 35 and states.sensor.school_end_days2go.state |int > 0 %}
{% if states.sensor.school_end_days2go.state | int <= 35 and states.sensor.school_end_days2go.state | int > 0 %}
{{ [ 'Oh, and look at that.',
'For those trying to keep count. ',
'In case you were wondering.',
@ -366,10 +340,20 @@
{% if states.sensor.school_end_days2go.state | int == -1 -%}
Today is the first day of Summer Break!
{%- endif %}
{% if is_state('calendar.skylar_events', 'on') %}
Skylar has {{ states.calendar.skylar_events.attributes.message }} today as well!
{% endif %}
{%- endif -%}
{% endif %}
{% if states.sensor.vacation_days2go.state | int < 32 %}
{% if states.sensor.vacation_days2go.state | int > 1 %}
There are {{ states.sensor.vacation_days2go.state }} days until {{ states.calendar.vacation.attributes.message }}!
{% else %}
Oh, and there is {{ states.sensor.vacation_days2go.state }} one more sleep until {{ states.calendar.vacation.attributes.message }}!
{% endif %}
{% endif %}
</p>
@ -437,7 +421,7 @@
{%- if is_state('media_player.croft_tv','playing') or is_state('binary_sensor.croft_occupancy','on') %}
There appears to be activity in the Croft.
{%- if is_state('media_player.croft_tv','playing') %}
The croft TV is current playing
The croft TV is currently playing
{%- if states.media_player.croft_tv.attributes.app_name == 'YouTube' %}
You Tube.
{% else %}

View File

@ -45,22 +45,8 @@
{% endif %}
{% if states.sensor.nws_alerts.state | int > 0 %}
There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area.
The National Weather Service Has issued,
{% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %}
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 %}
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] }}.
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] is defined %}
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] }}.
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] is defined %}
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] }}.
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] is defined %}
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] }}.
{% else %}
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[0] }}.
{% endif %}
{% if states.sensor.gwinnett_active_alerts.state | int > 0 %}
There are currently {{states.sensor.gwinnett_active_alerts.state }} active weather alerts for our area.
{% endif %}
Based on the forecasted high temperature,
@ -105,32 +91,41 @@
</p>
<p>
{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %}
{{ [ 'Today is a school day.',
'It is a school day. '
] | random }}
<s>Pickup today will be at {{(state_attr('input_datetime.school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }} </s>
{% if states.calendar.skylar_school.attributes.description == 'digital-learning' %}
But it is a digital learning day so the commute will be short.
{% endif %}
{% if states.calendar.skylar_school.attributes.description == 'early-release' %}
And It is early release which means pick up is at tweleve fifteen.
{% endif %}
{% if is_state('input_boolean.school_today', 'on') and state_attr('input_datetime.school_day_end', 'timestamp') < as_timestamp(now()) %}
{{ [ 'Today is a school day.',
'It is a school day. '
] | random }}
<s>Pickup today will be at {{(state_attr('input_datetime.school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }}</s>
{% if 'Digital Learning' in states('sensor.school_event') %}
But it is a digital learning day so the commute will be short.
{% endif %}
{% if 'Early Release' in states('sensor.school_event') %}
And It is early release!
{% endif %}
{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %}
{% if states.sensor.school_lunch.state == 'Nothing' %}
Today's lunch is not interesting, so plan on taking one.
{% else %}
Todays school lunch is {{ states.sensor.school_lunch.state }} .
{% endif %}
{% endif %}
{% if is_state('calendar.school_holiday', 'on') %}
And look at that. There is no school today. Because it is {{ states.calendar.school_holiday.attributes.message }}.
{% if states.sensor.school_end_days2go.state | int == 0 -%}
But today is the last day of School!
{%- endif %}
{% endif %}
{% if is_state('input_boolean.school_today', 'on') and state_attr('input_datetime.school_day_end', 'timestamp') < as_timestamp(now()) %}
{% if is_state('sensor.school_lunch', 'Nothing') %}
I am not sure what the school menu is for today, so plan on Skylar taking his lunch
{% else %}
Today's school lunch is {{ states.sensor.school_lunch.state }}, so he might be interested in buying his lunch.
{% endif %}
{% endif %}
{% if is_state('calendar.skylar_events', 'on') %}
Skylar has {{ states.calendar.skylar_events.attributes.message }} today as well!
{% endif %}
{% if states.sensor.school_end_days2go.state | int == -1 -%}
Today is the first day of Summer Break!
{%- endif %}
{% if 'School Holiday' in states('sensor.school_event') and is_state('input_boolean.school_today', 'off') %}
There is no school today.
{% endif %}
{% if is_state('calendar.skylar_events', 'on') %}
Skylar has {{ states.calendar.skylar_events.attributes.message }} today as well!
{% endif %}
</p>
<p>

View File

@ -57,31 +57,22 @@
</p>
<p>
{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %}
Because you have school today!
{% if states.calendar.skylar_school.attributes.description == 'digital-learning' %}
But today is a digital learning day.
{% endif %}
{% if states.calendar.skylar_school.attributes.description == 'early-release' %}
And guess what? It is early release!
{% endif %}
{% if states.calendar.skylar_school.attributes.description == 'start_thanksgiving_break' %}
Oh, One More Thing. Tomorrow is the first day of Thanksgiving Break.
{% endif %}
{% if states.calendar.skylar_school.attributes.description == 'start_winter_break' %}
Oh, One More Thing. Tomorrow is the first day of Winter Break.
{% endif %}
{% if states.calendar.skylar_school.attributes.description == 'start_spring_break' %}
Oh, One More Thing. Tomorrow is the first day of Spring Break.
{% endif %}
{% if states.calendar.skylar_school.attributes.description == 'start_fall_break' %}
Oh, One More Thing. Tomorrow is the first day of Fall Break.
{% if is_state('input_boolean.school_today', 'on') and state_attr('input_datetime.school_day_end', 'timestamp') > as_timestamp(now()) %}
{{ [ 'Today is a school day.',
'It is a school day. '
] | random }}
<s>Pickup today will be at {{(state_attr('input_datetime.school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }}</s>
{% if 'Digital Learning' in states('sensor.school_event') %}
But it is a digital learning day so the commute will be short.
{% endif %}
{% if 'Early Release' in states('sensor.school_event') %}
And It is early release!
{% endif %}
{% if states.sensor.school_end_days2go.state | int == 0 -%}
Oh, One More Thing. Tomorrow is the first day of Summer Break! Emjoy the Last day of school this year!
{%- endif %}
{% else %}
{% if is_state('calendar.school_holiday', 'on') %}
But today is the last day of School!
{%- endif %}
{% endif %}
{% if 'School Holiday' in states('sensor.school_event') and is_state('input_boolean.school_today', 'off') %}
And look at that. You do not have school today. Because it is {{ states.calendar.school_holiday.attributes.message }}.
{{ [ 'Guess today would be a good day to clean your room.',
'You could always do some chores.',
@ -91,32 +82,24 @@
'Today would be a good day to spend some time with mom and dad.'
] | random }}
{% endif %}
{% endif %}
{% if states.sensor.school_end_days2go.state | int == -1 -%}
Today is the first day of Summer Break!
{%- endif %}
</p>
<p>
{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %}
{% if is_state('input_boolean.school_today', 'on') and state_attr('input_datetime.school_day_end', 'timestamp') > as_timestamp(now()) %}
{% if states.sensor.school_lunch.state == 'Nothing' %}
You are going to want to take your own lunch today.
I am not sure what is on the school menu today, so You may want to take your own lunch today.
{% else %}
Today's school lunch is {{ states.sensor.school_lunch.state }}
{% endif %}
{% endif %}
</p>
<p>
{% if is_state('calendar.school_holiday', 'on') %}
And look at that. You do not have school today. Because it is {{ states.calendar.school_holiday.attributes.message }}.
{{ [ 'Guess today would be a good day to clean your room.',
'You could always do some chores.',
'Lets try to keep the TV off today. okay?',
'Want to play a nice game of chess? Sorry. I meant. want to play Thermal Nuclear War.',
'I hope you enjoy your day off. You deserve it.',
'Today would be a good day to spend some time with mom and dad.'
] | random }}
{% endif %}
</p>
{% if is_state('calendar.skylar_events', 'on') %}
You have {{ states.calendar.skylar_events.attributes.message }} today as well!
{% endif %}

View File

@ -8,7 +8,7 @@
'I cannot communicate with the bathtub. Or I would have started the water for you already. So you will have to start the bath, yourself',
'My sensors are detecting a strange smell. I am running diagnostics. But in the mean time, you should start a bath.',
'I hate to say it but, the day is coming to an end. Time to finish up your tasks, pick up any toys you have out, and get ready for bed.',
'We have reached that time in every day when we must switch gears and start preparing for bed. If you would like to have story time you better get a move on.'
'We have reached that time in every day when we must switch gears and start preparing for bed. If you would like to have story time you better get a move on.',
'Did you ever hear the one about the kid who never took a bath? <break time="2s"/>Yeah, me either. So we should keep it that way. It is time to get ready for bed.',
'The count down clock until bedtime has started. Time to get cleaned up, get your pajamas on, and pick the story you will read tonight.'
] | random }}
@ -46,7 +46,7 @@
{% elif states.sensor.school_start_days2go.state | int == 1 -%}
Tomorrow is the first day of school. Are you ready?
{%- endif %}
{% if states.sensor.school_end_days2go.state | int < 10 and states.sensor.school_end_days2go.state | int > 0 -%}
{% if states.sensor.school_end_days2go.state | int < 15 and states.sensor.school_end_days2go.state | int > 0 -%}
{{ [ 'School is almost over for the year.',
'You have made it to the end of the school year.',
'You are almost done with school.'
@ -61,7 +61,7 @@
{%- endif %}
{{ [ 'I have prepared your room as you like it. ',
'I have adjusted the lighting in your room.',
'I have turned on your bedroom lights, and adjusted the ligting under your bed.',
'I have turned on your bedroom lights, and adjusted the lighting under your bed.',
'I have executed the Pre bed routine for your room.'
] | random }}
</p>