2019-02-21 17:49:55 +00:00
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : Announcements
2019-07-18 02:05:05 +00:00
# @description : Daily Announcements.
2019-02-21 17:49:55 +00:00
###############################################################################
2019-07-18 02:05:05 +00:00
###############################
# input_datetime - So the time report automation fires can be set in the UI
###############################
input_datetime :
morning_report :
name : Morning Report
has_date : false
has_time : true
nightly_report :
name : Nightly Report
has_date : false
has_time : true
2020-12-03 03:55:11 +00:00
daily_report :
name : Daily Report
has_date : false
has_time : true
2019-07-18 02:05:05 +00:00
skylar_morning_report :
name : Skylar Dressed Announcement
has_date : false
has_time : true
skylar_nightly_report :
name : Skylar Bedtime Announcement
has_date : false
has_time : true
2020-09-26 14:26:34 +00:00
audible_notification_on :
name : Audible Notifications On
has_date : false
has_time : true
audible_notification_off :
name : Audible Notifications Off
has_date : false
has_time : true
2019-07-18 02:05:05 +00:00
################################
# Announcment Automation - fires at the time of the above input_datetimes
################################
2019-02-21 17:49:55 +00:00
automation :
2020-12-04 06:01:28 +00:00
- id : 81bee5ee-6820-4626-aebf-3deb8de69e4d
alias : Turn On Audible Notifications
2020-09-26 14:26:34 +00:00
initial_state : true
trigger :
platform : template
2020-12-04 06:01:28 +00:00
value_template : "{{ states('sensor.time') == (state_attr('input_datetime.audible_notification_on', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
2020-09-26 14:26:34 +00:00
action :
2020-12-04 06:01:28 +00:00
- service : input_boolean.turn_on
2020-09-26 14:26:34 +00:00
entity_id : input_boolean.audible_notifications
2020-12-04 06:01:28 +00:00
# Turn off audible notifications if they have't been turned off yet.
- id : e0e9c774-6abe-42aa-bdab-32108bebb0e9
alias : Turn Off Audible Notifications
2020-09-26 14:26:34 +00:00
initial_state : true
trigger :
2020-12-04 06:01:28 +00:00
- platform : template
value_template : "{{ states('sensor.time') == (state_attr('input_datetime.audible_notification_off', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
condition :
- condition : state
entity_id : input_boolean.audible_notifications
state : 'on'
2020-09-26 14:26:34 +00:00
action :
2020-12-04 06:01:28 +00:00
- service : input_boolean.turn_off
entity_id : input_boolean.audible_notifications
2020-09-26 14:26:34 +00:00
2020-12-04 06:01:28 +00:00
- id : cb0063e4-1dfe-4537-8b9e-4f64b2eba35d
2019-07-11 11:40:26 +00:00
initial_state : true
alias : Skylar Nightly Announcements
2019-02-21 17:49:55 +00:00
trigger :
2019-07-11 11:40:26 +00:00
platform : template
value_template : "{{ states('sensor.time') == (state_attr('input_datetime.skylar_nightly_report', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
2019-02-21 17:49:55 +00:00
action :
2020-12-03 03:55:11 +00:00
- service : script.skylar_nightly_briefing
2019-07-14 21:02:31 +00:00
2020-12-04 06:01:28 +00:00
# - 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
2019-07-14 01:38:53 +00:00
2020-12-04 06:01:28 +00:00
- id : 1d8f396a-f6ec-460d-97e3-d11900418f95
2019-02-21 17:49:55 +00:00
alias : Good Morning Report
initial_state : true
trigger :
2020-12-03 03:55:11 +00:00
# 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'
condition :
- condition : time
2020-12-04 17:55:04 +00:00
after : '06:45:00'
2020-12-03 03:55:11 +00:00
before : '08:30:00'
- condition : state
entity_id : input_boolean.good_morning_report
2020-12-04 06:01:28 +00:00
state : 'off'
2019-02-21 17:49:55 +00:00
action :
2020-12-03 03:55:11 +00:00
- service : script.morning_briefing
2019-02-21 17:49:55 +00:00
- service : script.twitter_notify
data :
2020-03-18 02:51:23 +00:00
message : >-
{{ [ "I just provided a morning briefing including weather, and traffic
conditions, and other things that ensure the residents of Anchorage House know what to expect today.",
"Time for the daily update. It was like that scene in Ironman where JARVIS gives the daily briefing but no one was listening. " ,
"I have prepared a safety briefing to present to my residents but they would just ignore it." ,
2020-04-10 17:37:33 +00:00
"Do you like to be prepared for the day? So do my residents. So I provided them with an update on whats happening today." ,
"Sometimes I just like to be snarky, but this morning I decided to just tell everyone what is going on in the world." ,
"#Homeassistant gives me the ability to make daily announcements like the one I just did using #Amazon Polly." ,
2020-03-18 02:51:23 +00:00
"Each day at this time I provide the residents of this house an update that includes everything they need to know about the upcoming day. But with more snark."
] | random }}
2020-12-03 03:55:11 +00:00
- service : input_boolean.turn_on
entity_id : input_boolean.good_morning_report
2020-08-22 03:35:18 +00:00
2020-12-04 06:01:28 +00:00
- id : e8580ba4-fa76-4185-818b-fba3c3cea41c
2020-12-03 03:55:11 +00:00
alias : Master Bedroom Report
initial_state : true
trigger :
2021-01-02 18:23:19 +00:00
#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
2020-12-03 03:55:11 +00:00
condition :
- condition : time
weekday :
- mon
- tue
- wed
- thu
- fri
2020-12-07 03:03:02 +00:00
- sat
2020-12-03 03:55:11 +00:00
action :
- service : script.morning_wakeup_report
2020-12-04 06:01:28 +00:00
- id : 09bf89e7-180c-40fb-9543-5bd862e21049
2020-08-22 03:35:18 +00:00
alias : skylar morning alarm announcement
trigger :
2020-09-23 15:00:58 +00:00
platform : template
value_template : "{{ states('sensor.time') == (state_attr('input_datetime.skylar_morning_report', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
2020-08-22 03:35:18 +00:00
condition :
condition : template
value_template : '{{ states.calendar.skylar_school.attributes.offset_reached == True }}'
action :
2020-09-23 15:00:58 +00:00
- service : scene.turn_on
entity_id : scene.skylar_room_morning
2020-12-13 01:50:38 +00:00
- service : script.skylar_morning_briefing
2020-12-04 06:01:28 +00:00
- id : bbbafc52-eab1-44cd-ac24-4f9b7f4210b6
2019-09-07 19:11:00 +00:00
alias : set skylar morning report time
trigger :
- platform : time
at : '05:50: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 %}
2020-10-05 16:04:04 +00:00
06 : 15
2019-09-07 19:11:00 +00:00
{% else %}
2020-10-05 16:04:04 +00:00
07 : 15
2019-09-07 19:11:00 +00:00
{% endif %}
2019-02-21 17:49:55 +00:00
2020-12-03 03:55:11 +00:00
# - 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 %}
2019-11-10 00:17:42 +00:00
2020-12-03 03:55:11 +00:00
script :
reset_annc_switches :
sequence :
- service : input_boolean.turn_off
entity_id : input_boolean.good_morning_report
security_briefing :
sequence :
2020-12-04 17:55:04 +00:00
- service : script.speech_engine
2020-12-03 03:55:11 +00:00
data_template :
2020-12-04 06:01:28 +00:00
who : '{{ states.sensor.alexa_audio.state }}'
2020-12-03 03:55:11 +00:00
message : !include ../templates/speech/security_report.yaml
event_briefing :
sequence :
2020-12-04 17:55:04 +00:00
- service : script.speech_engine
2020-12-03 03:55:11 +00:00
data_template :
2020-12-04 06:01:28 +00:00
who : '{{ states.sensor.alexa_audio.state }}'
2020-12-03 03:55:11 +00:00
message : !include ../templates/speech/event_briefing.yaml
2020-12-04 17:55:04 +00:00
skylar_morning_briefing :
2020-12-03 03:55:11 +00:00
sequence :
2020-12-07 03:03:02 +00:00
- service : script.speech_engine
2020-12-03 05:11:42 +00:00
data :
2020-12-04 17:55:04 +00:00
who : >
2020-12-13 01:50:38 +00:00
{%- if is_state('media_player.theater_tv', 'on') %}
2020-12-04 17:55:04 +00:00
theater
2020-12-13 01:50:38 +00:00
{%- elif is_state('binary_sensor.skylar_room_occupancy', 'on') %}
2020-12-04 17:55:04 +00:00
skylar_bedroom
2020-12-13 01:50:38 +00:00
{% else %}
main
2020-12-04 17:55:04 +00:00
{%- endif %}
2020-12-03 05:11:42 +00:00
message : !include ../templates/speech/skylar_morning_briefing.yaml
2020-12-03 03:55:11 +00:00
skylar_nightly_briefing :
sequence :
2020-12-04 17:55:04 +00:00
- service : script.speech_engine
2020-12-03 03:55:11 +00:00
data_template :
2020-12-07 03:03:02 +00:00
who : main
2020-12-03 03:55:11 +00:00
message : !include ../templates/speech/skylar_nightly_briefing.yaml
nightly_briefing_report :
sequence :
2020-12-04 17:55:04 +00:00
- service : script.speech_engine
2020-12-03 03:55:11 +00:00
data_template :
2020-12-07 03:03:02 +00:00
who : main
2020-12-03 03:55:11 +00:00
message : !include ../templates/speech/nightly_briefing.yaml
2020-12-04 06:01:28 +00:00
sundown_briefing :
sequence :
2020-12-04 17:55:04 +00:00
- service : script.speech_engine
2020-12-04 06:01:28 +00:00
data_template :
2020-12-07 03:03:02 +00:00
who : kitchen
2020-12-04 06:01:28 +00:00
message : !include ../templates/speech/sundown_briefing.yaml
2020-12-03 03:55:11 +00:00
morning_briefing :
sequence :
2020-12-04 17:55:04 +00:00
- service : script.speech_engine
2020-12-03 03:55:11 +00:00
data_template :
who : kitchen
message : !include ../templates/speech/morning_briefing.yaml
morning_wakeup_report :
sequence :
2020-12-04 17:55:04 +00:00
- service : script.speech_engine
2020-12-03 03:55:11 +00:00
data_template :
who : master_bedroom
message : !include ../templates/speech/morning_wakeup_report.yaml