Coninuing with the major audible notifications overhual of 2020

This commit is contained in:
Jeffrey Stone 2020-12-04 01:01:28 -05:00
parent 2bd15de241
commit da591c9631
14 changed files with 405 additions and 244 deletions

View File

@ -13,4 +13,4 @@
- platform: tod - platform: tod
name: Quiet time name: Quiet time
after: '21:00' after: '21:00'
before: '07:00' before: '06:00'

View File

@ -11,7 +11,6 @@ arriving:
name: Arriving name: Arriving
entities: [] entities: []
House Conditions: House Conditions:
- climate.first_floor - climate.first_floor
- sensor.accurite_back_porch_temperature - sensor.accurite_back_porch_temperature

View File

@ -44,46 +44,34 @@ input_datetime:
# Announcment Automation - fires at the time of the above input_datetimes # Announcment Automation - fires at the time of the above input_datetimes
################################ ################################
automation: automation:
- id: turn_off_audible_notifications
alias: Turn Off Audible Notifications
initial_state: true
trigger:
platform: template
value_template: "{{ states('sensor.time') == (state_attr('input_datetime.audible_notification_off', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
action:
- service: input_boolean.turn_off
entity_id: input_boolean.audible_notifications
- id: 81bee5ee-6820-4626-aebf-3deb8de69e4d
- id: turn_on_audible_notifications alias: Turn On Audible Notifications
alias: Turn On Audible Notifications at 7am
initial_state: true initial_state: true
trigger: trigger:
platform: template platform: template
value_template: "{{ states('sensor.time') == (state_attr('input_datetime.audible_notification_on', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}" value_template: "{{ states('sensor.time') == (state_attr('input_datetime.audible_notification_on', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
action: action:
- service: script.turn_on_ha_speaker - service: input_boolean.turn_on
entity_id: input_boolean.audible_notifications
# Turn off audible notifications if they have't been turned off yet.
- id: set_audible_time_off_guest - id: e0e9c774-6abe-42aa-bdab-32108bebb0e9
alias: set audible time off guest alias: Turn Off Audible Notifications
initial_state: true
trigger: trigger:
- platform: state - platform: template
entity_id: input_boolean.guest_mode value_template: "{{ states('sensor.time') == (state_attr('input_datetime.audible_notification_off', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
to: 'on' condition:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
action: action:
- service: input_datetime.set_datetime - service: input_boolean.turn_off
entity_id: input_datetime.audible_notification_off entity_id: input_boolean.audible_notifications
data_template:
time: >
{% if states.binary_sensor.school_tomorrow.state == 'on' %}
19:30
{% else %}
20:30
{% endif %}
- id: prebed_routine - id: cb0063e4-1dfe-4537-8b9e-4f64b2eba35d
initial_state: true initial_state: true
alias: Skylar Nightly Announcements alias: Skylar Nightly Announcements
trigger: trigger:
@ -92,16 +80,16 @@ automation:
action: action:
- service: script.skylar_nightly_briefing - service: script.skylar_nightly_briefing
- id: nightly_report # - id: 15056866-5ac7-4b33-a371-ab9e449548d1
initial_state: true # initial_state: true
alias: Nightly Report # alias: Nightly Report
trigger: # trigger:
platform: template # platform: template
value_template: "{{ states('sensor.time') == (state_attr('input_datetime.nightly_report', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}" # value_template: "{{ states('sensor.time') == (state_attr('input_datetime.nightly_report', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
action: # action:
- service: script.nightly_briefing_report # - service: script.nightly_briefing_report
- id: good_morning_report - id: 1d8f396a-f6ec-460d-97e3-d11900418f95
alias: Good Morning Report alias: Good Morning Report
initial_state: true initial_state: true
trigger: trigger:
@ -116,7 +104,7 @@ automation:
before: '08:30:00' before: '08:30:00'
- condition: state - condition: state
entity_id: input_boolean.good_morning_report entity_id: input_boolean.good_morning_report
state: 'on' state: 'off'
action: action:
- service: script.morning_briefing - service: script.morning_briefing
- service: script.twitter_notify - service: script.twitter_notify
@ -135,7 +123,7 @@ automation:
entity_id: input_boolean.good_morning_report entity_id: input_boolean.good_morning_report
- id: master_bedroom_report - id: e8580ba4-fa76-4185-818b-fba3c3cea41c
alias: Master Bedroom Report alias: Master Bedroom Report
initial_state: true initial_state: true
trigger: trigger:
@ -152,7 +140,7 @@ automation:
action: action:
- service: script.morning_wakeup_report - service: script.morning_wakeup_report
- id: skylar_morning_alarm_announcement - id: 09bf89e7-180c-40fb-9543-5bd862e21049
alias: skylar morning alarm announcement alias: skylar morning alarm announcement
trigger: trigger:
platform: template platform: template
@ -170,7 +158,7 @@ automation:
script.skylar_morning_briefing_alexa script.skylar_morning_briefing_alexa
{%- endif %} {%- endif %}
- id: set_skylar_morning_report_time - id: bbbafc52-eab1-44cd-ac24-4f9b7f4210b6
alias: set skylar morning report time alias: set skylar morning report time
trigger: trigger:
- platform: time - platform: time
@ -214,14 +202,14 @@ script:
sequence: sequence:
- service: script.jarvis_voice - service: script.jarvis_voice
data_template: data_template:
who: kitchen who: '{{ states.sensor.alexa_audio.state }}'
message: !include ../templates/speech/security_report.yaml message: !include ../templates/speech/security_report.yaml
event_briefing: event_briefing:
sequence: sequence:
- service: script.jarvis_voice - service: script.jarvis_voice
data_template: data_template:
who: kitchen who: '{{ states.sensor.alexa_audio.state }}'
message: !include ../templates/speech/event_briefing.yaml message: !include ../templates/speech/event_briefing.yaml
skylar_morning_briefing_jarvis: skylar_morning_briefing_jarvis:
@ -253,6 +241,13 @@ script:
who: '{{ states.sensor.room_audio.state }}' who: '{{ states.sensor.room_audio.state }}'
message: !include ../templates/speech/nightly_briefing.yaml message: !include ../templates/speech/nightly_briefing.yaml
sundown_briefing:
sequence:
- service: script.jarvis_voice
data_template:
who: '{{ states.sensor.room_audio.state }}'
message: !include ../templates/speech/sundown_briefing.yaml
morning_briefing: morning_briefing:
sequence: sequence:
- service: script.jarvis_voice - service: script.jarvis_voice

View File

@ -112,7 +112,6 @@ sensor:
sensors: sensors:
room_audio: room_audio:
friendly_name: "Room Audio" friendly_name: "Room Audio"
unit_of_measurement: ''
value_template: >- value_template: >-
{%- if is_state('binary_sensor.theater_occupancy', 'on') and is_state('media_player.theater_tv', 'on') %} {%- if is_state('binary_sensor.theater_occupancy', 'on') and is_state('media_player.theater_tv', 'on') %}
theater theater
@ -127,6 +126,16 @@ sensor:
{% else %} {% else %}
all_google all_google
{%- endif %} {%- endif %}
alexa_audio:
friendly_name: "Alexa Audio"
value_template: >-
{%- if is_state('sensor.last_alexa', 'media_player.living_room') %}
main
{% elif is_state('sensor.last_alexa', 'media_player.kitchen') %}
kitchen
{% else %}
main
{%- endif %}
last_alexa: last_alexa:
value_template: > value_template: >
{{ states.media_player | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }} {{ states.media_player | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}

View File

@ -7,7 +7,7 @@
automation: automation:
- id: coffee_time - id: 3a0175f8-9caf-45fb-a461-585474f73e6b
alias: Coffee Time alias: Coffee Time
initial_state: true initial_state: true
trigger: trigger:
@ -25,7 +25,7 @@ automation:
entity_id: alarm_control_panel.aarlo_ah_base_station entity_id: alarm_control_panel.aarlo_ah_base_station
mode: 'home' mode: 'home'
- id: good_morning - id: ce3d7e63-3eaa-4cc5-959b-1334e6c5c4e6
alias: Good Morning alias: Good Morning
initial_state: true initial_state: true
trigger: trigger:
@ -54,7 +54,7 @@ automation:
{{ [ "/config/www/tweet_images/coffee.jpg", {{ [ "/config/www/tweet_images/coffee.jpg",
"/config/www/tweet_images/coffee2.jpg"] | random }} "/config/www/tweet_images/coffee2.jpg"] | random }}
- id: skylar_bedtime - id: ff00b2a6-be6a-4f1f-ac14-84de9d42bb6a
alias: Skylar Bedtime alias: Skylar Bedtime
initial_state: true initial_state: true
trigger: trigger:
@ -69,7 +69,7 @@ automation:
entity_id: scene.skylar_room_prebed entity_id: scene.skylar_room_prebed
- id: master_bedroom_lights_dim - id: 745ee642-26ef-4818-8068-67f8ffccb29f
alias: Master Bedroom lights dim alias: Master Bedroom lights dim
initial_state: true initial_state: true
trigger: trigger:
@ -83,7 +83,7 @@ automation:
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.master_bedroom_dim entity_id: scene.master_bedroom_dim
- id: master_bedroom_lights_out - id: 68891fc2-b631-4195-ae63-b660e04f1615
alias: Master Bedroom lights out alias: Master Bedroom lights out
initial_state: true initial_state: true
trigger: trigger:
@ -97,7 +97,7 @@ automation:
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.master_bedroom_off entity_id: scene.master_bedroom_off
- id: master_bedroom_lights_on - id: 27b83e67-b509-427a-aa2f-1ce4bb7ad0ab
alias: Master Bedroom Lights On alias: Master Bedroom Lights On
initial_state: true initial_state: true
trigger: trigger:
@ -112,7 +112,7 @@ automation:
entity_id: scene.master_bedroom_on entity_id: scene.master_bedroom_on
- id: master_bedroom_alarm - id: b054e477-be50-480e-bd2e-2996b3e1c997
alias: Master bedroom alarm alias: Master bedroom alarm
initial_state: true initial_state: true
trigger: trigger:
@ -126,7 +126,7 @@ automation:
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.master_bedroom_on entity_id: scene.master_bedroom_on
- id: master_bedroom_wake_up - id: 1feafed1-0de9-44a4-a2f0-e693bc637ea1
alias: Master bedroom Wake Up alias: Master bedroom Wake Up
initial_state: true initial_state: true
trigger: trigger:
@ -140,7 +140,7 @@ automation:
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.master_bedroom_dim entity_id: scene.master_bedroom_dim
- id: good_night - id: 0d5cea61-f295-4e5d-87a9-f12dfb5b67d6
alias: Good Night alias: Good Night
initial_state: true initial_state: true
trigger: trigger:
@ -165,6 +165,8 @@ automation:
data: data:
entity_id: light.kitchen_cabinets entity_id: light.kitchen_cabinets
- service: script.good_night_loft - service: script.good_night_loft
- service: input_boolean.turn_off
entity_id: input_boolean.audible_notifications
- service: script.reset_annc_switches - service: script.reset_annc_switches
- service: script.twitter_notify_image - service: script.twitter_notify_image
data_template: data_template:
@ -181,7 +183,7 @@ automation:
"/config/www/tweet_images/clock.jpg"] | random }} "/config/www/tweet_images/clock.jpg"] | random }}
- id: outside_lights_on_sunset - id: 79886677-4fdb-4cec-ad46-92a9c3c75681
alias: Outside Lights on at Sunset alias: Outside Lights on at Sunset
initial_state: true initial_state: true
trigger: trigger:
@ -195,6 +197,7 @@ automation:
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.normal_livingroom_lighting entity_id: scene.normal_livingroom_lighting
- service: script.sunset_garage_open - service: script.sunset_garage_open
- service: script.sundown_briefing
- service: script.twitter_notify_image - service: script.twitter_notify_image
data_template: data_template:
tweet: >- tweet: >-
@ -212,7 +215,7 @@ automation:
"/config/www/tweet_images/light.jpg", "/config/www/tweet_images/light.jpg",
"/config/www/tweet_images/lamp2.jpg"] | random }} "/config/www/tweet_images/lamp2.jpg"] | random }}
- id: sunset - id: a01624c1-1222-4d53-a9b3-95eee9a6a4b0
alias: Sunset alias: Sunset
initial_state: true initial_state: true
trigger: trigger:
@ -223,9 +226,8 @@ automation:
data: data:
entity_id: alarm_control_panel.aarlo_ah_base_station entity_id: alarm_control_panel.aarlo_ah_base_station
mode: 'Armed' mode: 'Armed'
- service: script.nightly_briefing_report
- id: outside_lights_off_sunrise - id: 18656c32-65ab-4578-9cc0-2de5820290de
alias: Outside Lights off at Sunrise alias: Outside Lights off at Sunrise
initial_state: true initial_state: true
trigger: trigger:
@ -277,7 +279,7 @@ automation:
# "Since I monitor the conditions inside and outside the Anchorage House I know all the things. Like it is time to turn on the inside lights." # "Since I monitor the conditions inside and outside the Anchorage House I know all the things. Like it is time to turn on the inside lights."
# ] | random }} # ] | random }}
- id: inside_off_after_sunrise - id: 9c4e0720-6496-49a9-ad49-fe59b52fc056
alias: Inside off after Sunrise alias: Inside off after Sunrise
initial_state: true initial_state: true
trigger: trigger:
@ -297,7 +299,7 @@ automation:
entity_id: scene.master_bedroom_off entity_id: scene.master_bedroom_off
- id: ha_start - id: 86fd5de9-3136-4d86-aef9-268f097eae35
alias: HA Startup alias: HA Startup
initial_state: true initial_state: true
trigger: trigger:
@ -308,7 +310,7 @@ automation:
data: data:
name: midnight-AH name: midnight-AH
- id: jeff_eta_home - id: 82b96b73-2407-49d7-8ea2-1f78a69e025b
alias: Jeff eta home alias: Jeff eta home
initial_state: true initial_state: true
trigger: trigger:
@ -355,7 +357,7 @@ automation:
] | random }} ] | random }}
- id: set_coffee_time - id: 49fcdf4f-5cb1-442a-9a1a-16eefc3da503
alias: set soffee time alias: set soffee time
trigger: trigger:
- platform: time - platform: time
@ -371,7 +373,7 @@ automation:
07:15 07:15
{% endif %} {% endif %}
- id: set_skylar_nightly_report_time - id: 7ad448b3-f2f0-4dfc-9549-732fa6396bc5
alias: set skylar nightly report time alias: set skylar nightly report time
trigger: trigger:
- platform: time - platform: time
@ -387,7 +389,7 @@ automation:
20:15 20:15
{% endif %} {% endif %}
- id: set_good_morning_time - id: bd8e4e20-f138-49ec-a9f6-d23ab1450b98
alias: set good morning time alias: set good morning time
trigger: trigger:
- platform: time - platform: time

View File

@ -76,7 +76,9 @@ sensor:
friendly_name: "Skylar's Current Location" friendly_name: "Skylar's Current Location"
unit_of_measurement: '' unit_of_measurement: ''
value_template: >- value_template: >-
{%- if is_state('input_boolean.skylar_school', 'on')%} {% if is_state('person.skylar', 'home') %}
home
{%- elif is_state('input_boolean.skylar_school', 'on') or is_state('person.skylar', 'Starling')%}
school school
{%- elif is_state('sensor.jeff_location', 'home') and is_state('sensor.kat_location', 'home') and is_state('input_boolean.skylar_school', 'off')%} {%- elif is_state('sensor.jeff_location', 'home') and is_state('sensor.kat_location', 'home') and is_state('input_boolean.skylar_school', 'off')%}
home home
@ -168,10 +170,14 @@ automation:
- platform: state - platform: state
entity_id: binary_sensor.skylar_room_occupancy entity_id: binary_sensor.skylar_room_occupancy
to: 'on' to: 'on'
from: 'off'
condition: condition:
- condition: time - condition: time
after: '05:00:00' after: '05:00:00'
before: '08:30:00' before: '08:30:00'
- condition: state
entity_id: input_boolean.skylar_awake
state: 'off'
action: action:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
entity_id: input_datetime.skylar_awake_at entity_id: input_datetime.skylar_awake_at
@ -212,7 +218,8 @@ automation:
- service: script.jarvis_voice - service: script.jarvis_voice
data_template: data_template:
who: '{{ states.sensor.room_audio.state }}' who: '{{ states.sensor.room_audio.state }}'
message: message: Katherine appears to be headed home. Based on current traffic conditions, she should be here in {{states.sensor.kat_ett_home.attributes.duration | round}} minutes.
- id: '1550109528753' - id: '1550109528753'
alias: Jeff Is Heading Home alias: Jeff Is Heading Home
@ -227,7 +234,7 @@ automation:
- service: script.jarvis_voice - service: script.jarvis_voice
data_template: data_template:
who: '{{ states.sensor.room_audio.state }}' who: '{{ states.sensor.room_audio.state }}'
message: message: Jeff appears to be headed home. Based on current traffic conditions, he should be here in {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes.
- id: jeff_heading_to_work - id: jeff_heading_to_work
alias: Jeff Is Heading To Work alias: Jeff Is Heading To Work
@ -253,7 +260,7 @@ automation:
condition: condition:
condition: time condition: time
after: '07:25:00' after: '07:25:00'
before: '08:30:00' before: '09:00:00'
weekday: weekday:
- mon - mon
- tue - tue
@ -440,8 +447,8 @@ automation:
- service: script.standby - service: script.standby
- service: script.washer_finished_notification_audible - service: script.washer_finished_notification_audible
- wait_template: "{{ states.binary_sensor.kitchen_door.state == 'on' }}" - wait_template: "{{ states.binary_sensor.kitchen_door.state == 'on' }}"
timeout: '00:1:00' timeout: '00:01:00'
- delay: '00:01:00' - delay: '00:02:00'
- service: script.jarvis_voice - service: script.jarvis_voice
data_template: data_template:
who: main who: main

View File

@ -143,6 +143,8 @@ automation:
- service: input_boolean.turn_on - service: input_boolean.turn_on
entity_id: input_boolean.garage_after_dark entity_id: input_boolean.garage_after_dark
- id: door_chime - id: door_chime
alias: Door Chine alias: Door Chine
trigger: trigger:

View File

@ -1,15 +1,47 @@
> >
{# Event Report #} {# Event Report #}
{%- macro getReport() -%} {%- macro getReport() -%}
<p>
{% if is_state('calendar.holidays_in_united_states', 'on') %}
Today is {{states.calendar.holidays_in_united_states.attributes.message}}.
{% endif %}
{% if is_state('calendar.anchorage_holidays', 'on') %}
Today is {{states.calendar.anchorage_holidays.attributes.message}}.
{% endif %}
{% if states.calendar.birthdays.state == 'on' %}
Today is {{ states.calendar.birthdays.attributes.message }}! So Happy Birthday! The confetti cannon is not working otherwise I would shower you in paper.
{% endif %}
{%- set event=states.calendar.national_holidays.attributes.message %}
{% if 'Day' in event and 'National' in event%}
{{ [
'And a very special Happy ',
'It is also ',
'Today is also known as ',
'Oh <emphasis>Look</emphasis>. Today is ',
'Want to know a fact? Today is ',
'Everyday can be a holiday. So today is '
]|random }}
{{states.calendar.national_holidays.attributes.message | replace("&"," and ") }}.
{%- endif -%}
</p>
<p> <p>
{% if states.sensor.birthday_skylar.state | int == 1 %} {% if states.sensor.birthday_skylar.state | int == 1 %}
Tomorrow is Skylar's Birthday. Tomorrow is Skylar's Birthday.
{% elif states.sensor.birthday_skylar.state | int > 1 and states.sensor.birthday_skylar.state | int < 15 %}
Skylar's Birthday is in {{ states.sensor.birthday_skylar.state }} days!
{% else %}
{% endif %} {% endif %}
{% if states.sensor.birthday_jeff.state | int == 1 %} {% if states.sensor.birthday_jeff.state | int == 1 %}
Tomorrow is Jeff's Birthday. Tomorrow is Jeff's Birthday.
{% elif states.sensor.birthday_jeff.state | int > 1 and states.sensor.birthday_jeff.state | int < 15 %}
Jeff's Birthday is in {{ states.sensor.birthday_jeff.state }} days!
{% else %}
{% endif %} {% endif %}
{% if states.sensor.birthday_kat.state | int == 1 %} {% if states.sensor.birthday_kat.state | int == 1 %}
Tomorrow is Katherine's Birthday. Tomorrow is Katherine's Birthday.
{% elif states.sensor.birthday_kat.state | int > 1 and states.sensor.birthday_kat.state | int < 15 %}
Katherine's Birthday is in {{ states.sensor.birthday_kat.state }} days!
{% else %}
{% endif %} {% endif %}
</p> </p>
<p> <p>
@ -19,7 +51,7 @@
'I have prepped the scary music. Just in case.', 'I have prepped the scary music. Just in case.',
'I will be going as HAL 9000. The Pod Bay Doors are being installed today. I <emphasis>dare</emphasis> you to ask me to open them. ' 'I will be going as HAL 9000. The Pod Bay Doors are being installed today. I <emphasis>dare</emphasis> you to ask me to open them. '
] | random }} ] | random }}
{% elif states.sensor.halloween_countdown.state | int < 30 %} {% elif states.sensor.halloween_countdown.state | int < 30 and states.sensor.halloween_countdown.state | int > 1 %}
There are only {{states.sensor.halloween_countdown.state}} days There are only {{states.sensor.halloween_countdown.state}} days
{{ [ 'until Halloween.', {{ [ 'until Halloween.',
'until Halloween. It might not be enough time. ', 'until Halloween. It might not be enough time. ',
@ -31,7 +63,7 @@
{% endif %} {% endif %}
{% if states.sensor.christmas_countdown.state | int == 1 %} {% if states.sensor.christmas_countdown.state | int == 1 %}
Tomorrow is Christmas. <break time="1s"/> It is practically here! <break time="1s"/> Santa is coming tonight! Do not forget the cookies! Tomorrow is Christmas. <break time="1s"/> It is practically here! <break time="1s"/> Santa is coming tonight! Do not forget the cookies!
{% elif states.sensor.christmas_countdown.state | int < 31 %} {% elif states.sensor.christmas_countdown.state | int < 31 and states.sensor.christmas_countdown.state | int > 1 %}
There are only {{states.sensor.christmas_countdown.state}} days until christmas. There are only {{states.sensor.christmas_countdown.state}} days until christmas.
{{ [ 'All I want for Christmas, is a hippopotamus.', {{ [ 'All I want for Christmas, is a hippopotamus.',
'Hey Skylar, I know what you are getting for Christmas. But <emphasis>I am</emphasis> not telling.', 'Hey Skylar, I know what you are getting for Christmas. But <emphasis>I am</emphasis> not telling.',

View File

@ -39,7 +39,7 @@
{{states.sensor.today_is.state }}. {{states.sensor.today_is.state }}.
</p> </p>
<p> <p>
It is currently {{states.weather.home_2.state}} and {{states.sensor.back_porch.state|round}} degrees in Grayson. It is currently {{states.weather.home_2.state}} and {{states.sensor.back_porch_temperature.state|round}} degrees in Grayson.
</p> </p>
<p> <p>
{% if states.sensor.nws_alerts.state | int > 0 %} {% if states.sensor.nws_alerts.state | int > 0 %}
@ -99,7 +99,7 @@
And do not forget. Today is also {{states.calendar.anchorage_holidays.attributes.message}}. And do not forget. Today is also {{states.calendar.anchorage_holidays.attributes.message}}.
{% endif %} {% endif %}
{% if states.calendar.birthdays.state == 'on' %} {% if states.calendar.birthdays.state == 'on' %}
Today is {{ states.calendar.birthdays.attributes.message }}! So Happy Birthday! The confetti cannon is not working otherwise I would shower you in paper. Today is {{ states.calendar.birthdays.attributes.message }}! So Happy Birthday! The confetti cannon is not working otherwise I would shower you in paper garbage that someone else would have to pick up.
{% endif %} {% endif %}
{%- set event=states.calendar.national_holidays.attributes.message %} {%- set event=states.calendar.national_holidays.attributes.message %}
{% if 'Day' in event and 'National' in event%} {% if 'Day' in event and 'National' in event%}
@ -112,22 +112,6 @@
'Everyday can be a holiday. So today is ' 'Everyday can be a holiday. So today is '
]|random }} ]|random }}
{{states.calendar.national_holidays.attributes.message | replace("&"," and ") }}. {{states.calendar.national_holidays.attributes.message | replace("&"," and ") }}.
{{ [
'We should celebrate.',
'I will leave the party planning up to <emphasis>you</emphasis>.',
'I bet <emphasis>you</emphasis> are glad I told you.',
'Wait. <emphasis>Really.</emphasis> That cannot be a <emphasis>Real</emphasis> holiday.',
'Wait. <emphasis>That</emphasis> is a <emphasis>Real</emphasis> holiday?',
'Umm. Okay. You <emphasis>cannot</emphasis> make this stuff up.',
'But, <emphasis>that</emphasis> just sounds silly.',
'You did not know did <emphasis>you</emphasis>? But, <emphasis>now </emphasis> you do.'
]|random }}
{{ [
'Anyway. ',
'Moving On. ',
'Back to the morning announcements. ',
'Right. Well. '
]|random }}
{%- endif -%} {%- endif -%}
</p> </p>
<p> <p>

View File

@ -39,7 +39,7 @@
{{states.sensor.today_is.state }}. {{states.sensor.today_is.state }}.
</p> </p>
<p> <p>
It is currently {{states.weather.home_2.state}} and {{states.sensor.back_porch.state|round}} degrees in Grayson. It is currently {{states.weather.home_2.state}} and {{states.sensor.back_porch_temperature.state|round}} degrees in Grayson.
</p> </p>
<p> <p>
{% if is_state('sensor.clothing_forecast', 'Freezing') %} {% if is_state('sensor.clothing_forecast', 'Freezing') %}

View File

@ -1,107 +1,7 @@
> >
{# Nightky Report #} {# Nightly Report #}
{%- macro getReport() -%} {%- macro getReport() -%}
<p>
{% if now().strftime('%H')|int < 12 and now().strftime('%H')|int > 6 %}
Good morning.
{% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %}
Good afternoon.
{% else %}
Good evening.
{% endif %}
</p>
<p>
{% if now().strftime('%H')|int < 12 %}
{% if now().strftime('%M')|int == 0 %}
It is {{ now().strftime('%H')|int }} AM.
{% else %}
It is {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} AM.
{% endif %}
{% elif now().strftime('%H')|int > 12 %}
{% if now().strftime('%M')|int == 0 %}
It is {{ now().strftime('%H')|int }} PM.
{% else %}
It is {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} PM.
{% endif %}
{% else %}
{% endif %}
</p>
<p>
{{ [
'The sun is officially down. Exterior Cameras are now motion activated.',
'The sun has been ushered off the stage. I have armed the perimiter cameras.',
'You are running out of daylight. Time to wrap up any outside chores.',
'Switching Anchorage House to night mode! ',
'The outside world has switched to dark mode.',
'It is a little past Sunset. Time to turn on the outside lights. I am on it.',
'I will switch on the outside lights. It is getting dark outside.',
'Time to turn on the front lights. I will take care of it.',
'If you have not looked outside lately, the light of the day is almost gone.'
]|random }}
</p>
<p>
{% if is_state('binary_sensor.garage_door', 'on') %}
{{ [ 'The garage door is open. ',
'The pod bay doors are open. ',
'Someone forgot to close the garage.'
] | random }}
{% elif is_state('binary_sensor.side_door', 'on') %}
{{ [ 'The side door is ajar. ',
'The side door is open. ',
'Someone forgot to close the side door.'
] | random }}
{% else %}
{% endif %}
</p>
<p>
{% 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 %}
</p>
<p>
{{ [
'Tonight we can expect,',
'Expect weather tonight to be,'
]|random }}
{{ states.sensor.nws_overnight_forecast.state }}
</p>
<p>
{% if is_state('input_boolean.freeze_warning','on') %}
{{ [ 'The temperature is expected to be near or below freezing. <emphasis>Someone</emphasis> might want to bring the lemon tree in. ',
'It appears that it will be cold tonight. Like, the turn water solid <emphasis>kind</emphasis> of cold. Think of the poor plants.',
'I suggest bringing in the plants other wise, the temperature might kill them. And that will be on <emphasis>you</emphasis>.',
'I would say winter is coming. But, based on the weather forecast <emphasis>it</emphasis> appears to be here.',
'It will be freezing cold tonight. I would bring in the plants but I lack legs. And Arms. So I am forced to rely on you. Do not let me down.'
] | random }}
{% endif %}
</p>
{% if is_state('sensor.today_is', 'Tuesday') %}
{% if now().strftime('%H')|int > 17 %}
{{ [ 'Do not forget to bring in the trash cans. ',
'The trash cans will feel lonely if you leave them out all night. ',
'The <say-as interpret-as="characters">HOA</say-as> will get mad if you leave those trash cans out on the street.'
] | random }}
{% endif %}
{% endif %}
</p>
<p> <p>
{% if states.sensor.halloween_countdown.state | int == 1 %} {% if states.sensor.halloween_countdown.state | int == 1 %}
Tomorrow is Halloween. I hope you have picked out a costume. Tomorrow is Halloween. I hope you have picked out a costume.
@ -152,6 +52,11 @@
Tomorrow is Jeff and Katherine's Wedding Anniversary. Tomorrow is Jeff and Katherine's Wedding Anniversary.
{% endif %} {% endif %}
</p> </p>
<p>
{% if states.sensor.trip_disney.state | int == 1 %}
Oh, and there is just one more sleep until the next Disney Trip!
{% endif %}
</p>
{%- endmacro -%} {%- endmacro -%}

View File

@ -7,34 +7,35 @@
'Sentry Mode is enabled.', 'Sentry Mode is enabled.',
'Sentry mode is currently active.', 'Sentry mode is currently active.',
'Barn Door Protocol is currently in effect.', 'Barn Door Protocol is currently in effect.',
'My security system is currently armed.' 'My security system is currently armed.',
'Anchorage House is in lockdown mode. '
] | random}} ] | random}}
{% else %} {% else %}
{{ [ {{ [
'Sentry Mode is disabled.', 'Sentry Mode is disabled.',
'Sentry mode is currently inactive.', 'Sentry mode is currently inactive.',
'My security system is currently disarmed.' 'My security system is currently disarmed.',
'Anchorage House is currently in standby. '
] | random}} ] | random}}
{% endif %} {% endif %}
{%- if states.group.external_doors.state == 'off' %} {%- if states.group.external_doors.state == 'off' %}
All external doors are secured. All external doors are currently secured.
{% else %} {% else %}
The following doors are open, {% set open_doors = expand('group.external_doors')| selectattr('state', 'eq', 'on') | map(attribute='name')|join(' and ') %}
{%- if states.binary_sensor.front_door.state == 'on' %} {% set open_door_count = expand('group.external_doors') | selectattr('state', 'eq', 'on') | list | count %}
Front Door. {% if open_door_count == 1 %}
{% endif %} {% set is_are = ' is ' %}
{%- if states.binary_sensor.back_door.state == 'on' %} {% else %}
Back Door. {% set is_are = ' are ' %}
{% endif %}
{%- if states.binary_sensor.laundry_room_door.state == 'on' %}
Laundry Room Door.
{% endif %}
{%- if states.binary_sensor.garage_door.state == 'on' %}
Garage Door.
{% endif %}
{%- if states.binary_sensor.side_door.state == 'on' %}
Side Door.
{% endif %} {% endif %}
{%- macro announcement(open_doors, is_are) -%}
{{ [
open_doors ~ is_are + " standing open.",
open_doors ~ is_are + " not secured.",
open_doors ~ is_are + " open."
] | random }}
{%- endmacro -%}
{{announcement(open_doors)}}
{% endif %} {% endif %}
</p> </p>
{%- endmacro -%} {%- endmacro -%}

View File

@ -1,6 +1,57 @@
> >
{# Skylar Nightly Report #} {# Skylar Nightly Report #}
{%- macro getReport() -%} {%- macro getReport() -%}
<p>
{% if states.sensor.halloween_countdown.state | int == 1 %}
Tomorrow is Halloween. I hope you have picked out a costume.
{{ [ 'I will be going as a dumb home. ',
'I have prepped the scary music. Just in case.',
'I will be going as HAL 9000. The Pod Bay Doors are being installed today. I <emphasis>dare</emphasis> you to ask me to open them. '
] | random }}
{% elif states.sensor.halloween_countdown.state | int < 30 %}
There are only {{states.sensor.halloween_countdown.state}} days
{{ [ 'until Halloween.',
'until Halloween. It might not be enough time. ',
'and counting until the best holiday ever.',
'until you need a costume.'
] | random }}
{% else %}
{% endif %}
{% if states.sensor.christmas_countdown.state | int == 1 %}
Tomorrow is Christmas. <break time="1s"/> It is practically here! <break time="1s"/> Santa is coming tonight! Do not forget the cookies!
{% elif states.sensor.christmas_countdown.state | int < 31 %}
There are only {{states.sensor.christmas_countdown.state}} days until christmas.
{{ [ 'All I want for Christmas, is a hippopotamus.',
'Hey Skylar, I know what you are getting for Christmas. But <emphasis>I am</emphasis> not telling.',
'Do not forget to put something under the tree for <emphasis>your</emphasis> favorite smarthome.',
'It is starting to smell a lot like Christmas. Or it could be the christmas tree is on fire.',
'I do not want to be a smarthome. I want to be a dentist.',
'Do not eat all the cookies. '
] | random }}
{% else %}
{% endif %}
</p>
<p>
{% 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 %}
</p>
<p> <p>
Skyler, Skyler,
{{ [ 'It is time to get in the bath. ', {{ [ 'It is time to get in the bath. ',

View File

@ -0,0 +1,174 @@
>
{# Nightky Report #}
{%- macro getReport() -%}
<p>
{% if now().strftime('%H')|int < 12 and now().strftime('%H')|int > 6 %}
Good morning.
{% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %}
Good afternoon.
{% else %}
Good evening.
{% endif %}
</p>
<p>
{% if now().strftime('%H')|int < 12 %}
{% if now().strftime('%M')|int == 0 %}
It is {{ now().strftime('%H')|int }} AM.
{% else %}
It is {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} AM.
{% endif %}
{% elif now().strftime('%H')|int > 12 %}
{% if now().strftime('%M')|int == 0 %}
It is {{ now().strftime('%H')|int }} PM.
{% else %}
It is {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} PM.
{% endif %}
{% else %}
{% endif %}
</p>
<p>
{{ [
'The sun is officially down. Exterior Cameras are now motion activated.',
'The sun has been ushered off the stage. I have armed the perimiter cameras.',
'You are running out of daylight. Time to wrap up any outside chores.',
'Switching Anchorage House to night mode! ',
'The outside world has switched to dark mode.',
'It is a little past Sunset. Time to turn on the outside lights. I am on it.',
'I will switch on the outside lights. It is getting dark outside.',
'Time to turn on the front lights. I will take care of it.',
'If you have not looked outside lately, the light of the day is almost gone.'
]|random }}
</p>
<p>
{% if is_state('binary_sensor.garage_door', 'on') %}
{{ [ 'The garage door is open. ',
'The pod bay doors are open. ',
'Someone forgot to close the garage.'
] | random }}
{% elif is_state('binary_sensor.side_door', 'on') %}
{{ [ 'The side door is ajar. ',
'The side door is open. ',
'Someone forgot to close the side door.'
] | random }}
{% else %}
{% endif %}
</p>
<p>
{% 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 %}
</p>
<p>
{{ [
'Tonight we can expect,',
'Expect weather tonight to be,'
]|random }}
{{ states.sensor.nws_overnight_forecast.state }}
</p>
<p>
{% if is_state('input_boolean.freeze_warning','on') %}
{{ [ 'The temperature is expected to be near or below freezing. <emphasis>Someone</emphasis> might want to bring the lemon tree in. ',
'It appears that it will be cold tonight. Like, the turn water solid <emphasis>kind</emphasis> of cold. Think of the poor plants.',
'I suggest bringing in the plants other wise, the temperature might kill them. And that will be on <emphasis>you</emphasis>.',
'I would say winter is coming. But, based on the weather forecast <emphasis>it</emphasis> appears to be here.',
'It will be freezing cold tonight. I would bring in the plants but I lack legs. And Arms. So I am forced to rely on you. Do not let me down.'
] | random }}
{% endif %}
</p>
{% if is_state('sensor.today_is', 'Tuesday') %}
{% if now().strftime('%H')|int > 17 %}
{{ [ 'Do not forget to bring in the trash cans. ',
'The trash cans will feel lonely if you leave them out all night. ',
'The <say-as interpret-as="characters">HOA</say-as> will get mad if you leave those trash cans out on the street.'
] | random }}
{% endif %}
{% endif %}
</p>
<p>
{% if states.sensor.halloween_countdown.state | int == 1 %}
Tomorrow is Halloween. I hope you have picked out a costume.
{{ [ 'I will be going as a dumb home. ',
'I have prepped the scary music. Just in case.',
'I will be going as HAL 9000. The Pod Bay Doors are being installed today. I <emphasis>dare</emphasis> you to ask me to open them. '
] | random }}
{% elif states.sensor.halloween_countdown.state | int < 30 %}
There are only {{states.sensor.halloween_countdown.state}} days
{{ [ 'until Halloween.',
'until Halloween. It might not be enough time. ',
'and counting until the best holiday ever.',
'until you need a costume.'
] | random }}
{% else %}
{% endif %}
{% if states.sensor.christmas_countdown.state | int == 1 %}
Tomorrow is Christmas. <break time="1s"/> It is practically here! <break time="1s"/> Santa is coming tonight! Do not forget the cookies!
{% elif states.sensor.christmas_countdown.state | int < 31 %}
There are only {{states.sensor.christmas_countdown.state}} days until christmas.
{{ [ 'All I want for Christmas, is a hippopotamus.',
'Hey Skylar, I know what you are getting for Christmas. But <emphasis>I am</emphasis> not telling.',
'Do not forget to put something under the tree for <emphasis>your</emphasis> favorite smarthome.',
'It is starting to smell a lot like Christmas. Or it could be the christmas tree is on fire.',
'I do not want to be a smarthome. I want to be a dentist.',
'Do not eat all the cookies. '
] | random }}
{% else %}
{% endif %}
</p>
<p>
{% 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 %}
</p>
<p>
{% if states.sensor.trip_disney.state | int == 1 %}
Oh, and there is just one more sleep until the next Disney Trip!
{% endif %}
</p>
{%- endmacro -%}
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
{%- macro cleanup(data) -%}
{%- for item in data.split("\n") if item | trim != "" -%}
{{ item | trim }} {% endfor -%}
{%- endmacro -%}
{# a macro to call all macros :) #}
{%- macro mother_of_all_macros() -%}
{{ getReport() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}