2019-02-21 17:49:55 +00:00
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : Notify
# @description : A Collection of Notification Scripts and Configs.
2019-07-18 02:06:50 +00:00
# Package modified from https://github.com/skalavala/smarthome/blob/master/packages/notify.yaml with inspiration
# from https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/config/script/speech_engine.yaml
2019-02-21 17:49:55 +00:00
###############################################################################
#homeassistant:
2019-02-23 04:32:32 +00:00
2019-02-21 17:49:55 +00:00
#ifttt:
# key: !secret IFTTT_API_KEY
tts :
2019-07-11 11:43:09 +00:00
- platform : google_translate
2019-02-21 17:49:55 +00:00
cache : true
cache_dir : /tmp/tts
time_memory : 300
2019-07-12 20:35:11 +00:00
- platform : amazon_polly
aws_access_key_id : !secret aws_key
aws_secret_access_key : !secret aws_secret
region_name : 'us-east-1'
text_type : ssml
voice : Brian
cache : True
2019-02-21 17:49:55 +00:00
notify :
- platform : ios
- name : all_ios
platform : group
services :
2020-04-14 02:21:12 +00:00
- service : mobile_app_jeffreys_iphone_8
- service : mobile_app_jeffreys_ipad
2019-12-09 03:01:26 +00:00
- service : mobile_app_iphone
2020-04-14 02:21:12 +00:00
- service : mobile_app_skylars_iphone
2019-07-14 01:38:53 +00:00
- name : ios_parents
platform : group
services :
2020-04-14 02:21:12 +00:00
- service : mobile_app_jeffreys_iphone_8
- service : mobile_app_jeffreys_ipad
2019-12-09 03:01:26 +00:00
- service : mobile_app_iphone
2019-02-21 17:49:55 +00:00
- name : jeff_ios
platform : group
services :
2020-04-14 02:21:12 +00:00
- service : mobile_app_jeffreys_iphone_8
- service : mobile_app_jeffreys_ipad
2019-07-11 11:43:09 +00:00
- name : kat_ios
platform : group
services :
2019-12-09 03:01:26 +00:00
- service : mobile_app_iphone
2020-04-14 02:21:12 +00:00
- name : skylar_ios
platform : group
services :
- service : mobile_app_skylars_iphone
2019-02-21 17:49:55 +00:00
- name : twitter
platform : twitter
consumer_key : !secret twitter_consumer_key
consumer_secret : !secret twitter_consumer_secret
access_token : !secret twitter_access_token
access_token_secret : !secret twitter_access_secret
2020-01-03 17:28:38 +00:00
- platform : alexa_media
name : alexa_media
2019-09-07 19:11:00 +00:00
2020-03-26 01:57:13 +00:00
automation :
- id : audio_isssue
alias : Audio Issue
initial_state : true
trigger :
- platform : state
2020-04-02 23:16:50 +00:00
entity_id : media_player.ha_speaker
2020-03-26 01:57:13 +00:00
to : 'unavailable'
2020-04-02 23:16:50 +00:00
condition :
- condition : state
entity_id : binary_sensor.day
state : 'on'
2020-03-26 01:57:13 +00:00
action :
- service : input_boolean.turn_off
entity_id : input_boolean.audible_notifications
- service : script.text_notify
data_template :
who : "jeff"
title : "Audio Issue"
2020-03-26 02:25:10 +00:00
message : "HA Audible Notifications turning off due to Chromecast Issue"
2020-03-26 01:57:13 +00:00
2020-03-26 02:25:10 +00:00
- id : audio_isssue_cleared
alias : Audio Issue Cleared
initial_state : true
trigger :
- platform : state
2020-04-02 23:16:50 +00:00
entity_id : media_player.ha_speaker
2020-03-26 02:25:10 +00:00
from : 'unavailable'
to : 'off'
2020-04-02 23:16:50 +00:00
condition :
- condition : state
entity_id : binary_sensor.day
state : 'on'
2020-03-26 02:25:10 +00:00
action :
- service : script.text_notify
data_template :
who : "jeff"
title : "Audio Issue Cleared"
message : "Main hromecast is back on"
2020-04-02 23:16:50 +00:00
- service : script.turn_on_ha_speaker
2020-03-26 01:57:13 +00:00
2019-02-21 17:49:55 +00:00
script :
2019-02-23 04:32:32 +00:00
2019-02-21 17:49:55 +00:00
###############################################################################
# Txt Notify
###############################################################################
text_notify_all :
sequence :
- service : notify.all_ios
data_template :
message : >
{{ message }}
text_notify_jeff :
sequence :
- condition : state
entity_id : input_boolean.text_notify_jeff
state : 'on'
- service : notify.jeff_ios
data_template :
message : >
{{ message }}
text_notify_kat :
sequence :
- condition : state
entity_id : input_boolean.text_notify_kat
state : 'on'
- service : notify.kat_ios
data_template :
message : >
{{ message }}
2019-07-14 01:38:53 +00:00
text_notify :
sequence :
- condition : state
entity_id : input_boolean.text_notifications
state : 'on'
- service_template : >
{% if who == 'jeff' %}
notify.jeff_ios
{% elif who == 'kat' %}
notify.kat_ios
{% elif who == 'skylar' %}
notify.skylar_ios
{% elif who == 'parents' %}
notify.ios_parents
{% else %}
notify.all_ios
{% endif %}
data_template :
title : '{{ title }}'
message : '{{ message }}'
#data:
# attachment:
2019-12-09 03:01:26 +00:00
# url: '{{ url }}'
# content-type: '{{ content_type }}'
2019-07-14 01:38:53 +00:00
# hide-thumbnail: false
# push:
2019-12-09 03:01:26 +00:00
# sound: '{{ ios_sound }}'
2019-07-14 01:38:53 +00:00
# badge: 0
2019-12-09 03:01:26 +00:00
# category: '{{ ios_category }}'
# entity_id: '{{ camera_entity }}'
2019-07-14 01:38:53 +00:00
text_alert :
sequence :
- service_template : >
{% if who == 'jeff' %}
notify.jeff_ios
{% elif who == 'kat' %}
notify.kat_ios
{% elif who == 'skylar' %}
notify.skylar_ios
{% elif who == 'parents' %}
notify.ios_parents
{% else %}
notify.all_ios
{% endif %}
data_template :
title : '{{ title }}'
message : '{{ message }}'
#data:
# attachment:
2019-12-09 03:01:26 +00:00
# url: '{{ url }}'
# content-type: '{{ content_type }}'
2019-07-14 01:38:53 +00:00
# hide-thumbnail: false
# push:
2019-12-09 03:01:26 +00:00
# sound: '{{ ios_sound }}'
2019-07-14 01:38:53 +00:00
# badge: 0
2019-12-09 03:01:26 +00:00
# category: '{{ ios_category }}'
# entity_id: '{{ camera_entity }}'
2019-07-14 01:38:53 +00:00
2019-02-21 17:49:55 +00:00
###############################################################################
# Alert Notify
# Conditions:
# => Vacation mode should be off
# Services:
# => Audible
# => iOS
###############################################################################
alert_notify :
sequence :
- condition : state
entity_id : input_boolean.vacation_mode
state : 'off'
2019-09-07 19:11:00 +00:00
- service : switch.turn_on
entity_id : switch.ha_speaker
2019-07-11 11:43:09 +00:00
- service : tts.google_translate_say
2019-02-21 17:49:55 +00:00
data_template :
2019-09-07 19:11:00 +00:00
entity_id : media_player.guest_tv
2019-02-21 17:49:55 +00:00
message : >
{{ message }}
2019-07-12 20:35:11 +00:00
jarvis_alert :
sequence :
2019-11-10 00:17:42 +00:00
- service : mqtt.publish
data_template :
topic : 'house/polly/lastmsg'
2019-12-09 03:01:26 +00:00
payload : 'This message is from {{ now().strftime("%-I") }}:{{ now().strftime("%M") }} {{ now().strftime("%p") }}. {{ message | truncate(220)}}'
2019-11-10 00:17:42 +00:00
retain : true
- service : media_player.turn_on
2020-04-02 23:16:50 +00:00
entity_id : media_player.ha_speaker
2019-11-10 00:17:42 +00:00
- service : media_player.volume_set
data_template :
2020-04-02 23:16:50 +00:00
entity_id : media_player.ha_speaker
2019-11-10 00:17:42 +00:00
volume_level : >
{% if states.input_boolean.audible_notifications.state == 'on' %}
2019-12-09 03:01:26 +00:00
.50
2019-11-10 00:17:42 +00:00
{% else %}
2019-12-09 03:01:26 +00:00
.50
2019-11-10 00:17:42 +00:00
{% endif %}
# media_player.googlehome0715, media_player.googlehomehub3492, media_player.upstairs_speaker
2019-07-12 20:35:11 +00:00
- service : tts.amazon_polly_say
data_template :
2019-11-10 00:17:42 +00:00
entity_id : >
{% if states.input_boolean.audible_notifications.state == 'on' %}
2020-04-02 23:16:50 +00:00
media_player.ha_speaker
2019-11-10 00:17:42 +00:00
{% else %}
media_player.house
{% endif %}
2019-07-12 20:35:11 +00:00
message : >-
<speak>
2019-12-09 03:01:26 +00:00
<amazon:auto-breaths>
2019-07-12 20:35:11 +00:00
{{ message }}
2019-12-09 03:01:26 +00:00
</amazon:auto-breaths>
2019-07-12 20:35:11 +00:00
</speak>
cache : true
2019-02-21 17:49:55 +00:00
###############################################################################
# Voice Notify
# Conditions:
# => Only Announce when people are home.
# => Only Announce when Audible Notifications are on
###############################################################################
voice_notify :
sequence :
- condition : template
value_template : '{{ states.input_boolean.audible_notifications.state == "on" }}'
- condition : state
entity_id : sensor.family_status
state : 'Home'
- condition : state
entity_id : input_boolean.vacation_mode
state : 'off'
2019-09-07 19:11:00 +00:00
# - service: switch.turn_on
# entity_id: switch.ha_speaker
# - condition: state
2019-10-06 00:08:02 +00:00
# entity_id: media_player.guest_tv
# state: 'idle'
2019-07-11 11:43:09 +00:00
- service : tts.google_translate_say
2019-02-21 17:49:55 +00:00
data_template :
2019-09-07 19:11:00 +00:00
entity_id : media_player.guest_tv
2019-12-09 03:01:26 +00:00
message : >-
2019-07-11 11:43:09 +00:00
{{message }}
2019-02-21 17:49:55 +00:00
2019-11-10 00:17:42 +00:00
2019-07-12 20:35:11 +00:00
jarvis_voice :
sequence :
2019-07-14 21:02:31 +00:00
- service : mqtt.publish
data_template :
topic : 'house/polly/lastmsg'
2019-12-09 03:01:26 +00:00
payload : 'This message is from {{ now().strftime("%-I") }}:{{ now().strftime("%M") }} {{ now().strftime("%p") }}. {{ message | truncate(220)}}'
2019-07-14 21:02:31 +00:00
retain : true
2019-07-12 20:35:11 +00:00
- condition : template
2019-07-14 01:38:53 +00:00
value_template : '{{ states.binary_sensor.quiet_time.state == "off" }}'
2019-11-08 17:54:11 +00:00
# - condition: state
# entity_id: binary_sensor.vlc_player
# state: 'off'
2019-07-12 20:35:11 +00:00
- condition : state
entity_id : sensor.family_status
state : 'Home'
- condition : state
entity_id : input_boolean.vacation_mode
state : 'off'
2019-11-08 17:54:11 +00:00
# - service: switch.turn_on
# entity_id: switch.ha_speaker
2019-10-06 00:08:02 +00:00
- service : media_player.turn_on
2020-04-02 23:16:50 +00:00
entity_id : media_player.ha_speaker
2019-10-06 00:08:02 +00:00
- service : media_player.volume_set
data_template :
2020-04-02 23:16:50 +00:00
entity_id : media_player.ha_speaker
2019-10-06 00:08:02 +00:00
volume_level : >
{% if states.input_boolean.audible_notifications.state == 'on' %}
.65
{% else %}
.4
{% endif %}
2019-09-07 19:11:00 +00:00
# media_player.googlehome0715, media_player.googlehomehub3492, media_player.upstairs_speaker
2019-07-12 20:35:11 +00:00
- service : tts.amazon_polly_say
data_template :
2019-07-14 01:38:53 +00:00
entity_id : >
2020-04-14 02:21:12 +00:00
{% if states.input_boolean.audible_notifications.state == 'on' and states.media_player.ha_speaker.state != 'playing' %}
2020-04-02 23:16:50 +00:00
media_player.ha_speaker
2019-07-14 01:38:53 +00:00
{% else %}
2019-09-07 19:11:00 +00:00
media_player.house
2019-07-14 01:38:53 +00:00
{% endif %}
2019-07-12 20:35:11 +00:00
message : >-
<speak>
2020-04-10 17:41:32 +00:00
<break time="2s"/>
2019-12-09 03:01:26 +00:00
<amazon:auto-breaths>
2019-07-12 20:35:11 +00:00
{{ message }}
2019-12-09 03:01:26 +00:00
</amazon:auto-breaths>
2019-07-12 20:35:11 +00:00
</speak>
cache : true
2019-07-14 21:02:31 +00:00
ah_report :
sequence :
- condition : or
conditions :
- condition : state
entity_id : sensor.family_status
state : 'Home'
- condition : state
entity_id : input_boolean.guest_mode
state : 'on'
- service : script.jarvis_voice
data_template :
message : >-
{% macro greeting() %}
{% 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 %}
{% endmacro %}
{% macro confirmation() %}
{{ [
2019-12-09 03:01:26 +00:00
'Okay.' ,
'If you insist.' ,
2020-01-03 17:28:38 +00:00
'I am afraid I can not do that <break time="3s"/> I am kidding,' ,
2019-12-09 03:01:26 +00:00
'Leave it to me.' ,
'As you wish.' ,
'By your command.' ,
'Affirmative.' ,
'No Problem.' ,
'I think I can handle that.' ,
'Working on it now.' ,
'<break time="2s"/> Oh, you were talking to me. Let me take care of that.'
'Why not. It is not like <emphasis>I</emphasis> ever sleep.' ,
'As Always, a great pleasure watching you work.' ,
'I am not even supposed to be here today.' ,
'You did not say the magic word.' ,
2020-03-18 02:52:50 +00:00
'Funny, I was just about to do that.' ,
'There are still terabytes of calculations required before I can.<break time="1s"/> Oh, whatever.'
2019-07-14 21:02:31 +00:00
] | random }}
{% endmacro %}
{% macro interuption() %}
{{ [
2019-12-09 03:01:26 +00:00
'Pardon me,' ,
'Excuse me,' ,
'I do not mean to interupt, but.' ,
'I hate to interrupt, but.' ,
'I beg your pardon' ,
'I do not mean to intrude, but' ,
2020-03-18 02:52:50 +00:00
'I am sorry to interrupt, but.' ,
'I have just been notified,' ,
'I am sure you have been waiting for this, ' ,
'Just a quick heads up, '
2019-07-14 21:02:31 +00:00
] | random }}
{% endmacro %}
{% macro issue() %}
{{ [
2019-12-09 03:01:26 +00:00
'I have detected an issue!' ,
'We have a problem!' ,
'You might not like this.' ,
'There is something that needs your attention.'
2019-07-14 21:02:31 +00:00
] | random }}
{% endmacro %}
2019-07-16 02:22:35 +00:00
2019-11-12 03:10:04 +00:00
2019-07-14 21:02:31 +00:00
{% macro morning_greeting() %}
2019-12-09 03:01:26 +00:00
{{ [ 'Time to Rise and Shine. ' ,
'Lets do this thing.' ,
'I hope you got some rest.' ,
'It is time to get the day started.' ,
'Glad to see everyone made it.' ,
'The early bird gets the worm.' ,
'from the bridge.'
2019-07-14 21:02:31 +00:00
] | random }}
2019-12-09 03:01:26 +00:00
{% if is_state('input_boolean.guest_mode', 'on') %}
{{ [ 'And a special welcome to our guests. ' ,
'And good morning to our guests as well. ' ,
'Hey look at that, someone came to visit Anchorage House. Hope everyone slept well.'
2019-07-14 21:02:31 +00:00
] | random }}
{% endif %}
{% endmacro %}
{% macro evening_greeting() %}
2019-12-09 03:01:26 +00:00
{{ [
'The day is almost over.' ,
'Before things start to quiet down,' ,
'Anchorage House.' ,
'from the bridge.' ,
'Pardom the interuption.' ,
'I hope everyone got their chores done.' ,
'Did everyone have a little fun today?'
2019-07-14 21:02:31 +00:00
] | random }}
{% endmacro %}
2019-07-16 02:22:35 +00:00
{% macro time_annc() %}
{% if now().strftime('%H')|int < 12 %}
2019-12-09 03:01:26 +00:00
{% if now().strftime('%M')|int == 0 %}
2020-03-18 02:52:50 +00:00
It is {{ now().strftime('%H')|int }} AM.
2019-12-09 03:01:26 +00:00
{% else %}
2020-03-18 02:52:50 +00:00
It is {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} AM.
2019-12-09 03:01:26 +00:00
{% endif %}
2019-07-16 02:22:35 +00:00
{% elif now().strftime('%H')|int > 12 %}
2019-12-09 03:01:26 +00:00
{% if now().strftime('%M')|int == 0 %}
2020-03-18 02:52:50 +00:00
It is {{ now().strftime('%H')|int }} PM.
2019-12-09 03:01:26 +00:00
{% else %}
2020-03-18 02:52:50 +00:00
It is {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} PM.
2019-12-09 03:01:26 +00:00
{% endif %}
2019-07-16 02:22:35 +00:00
{% else %}
{% endif %}
2020-04-10 17:41:32 +00:00
{{ [
'Today is ' ,
'If you have not been keeping track today is ' ,
'Do you know what day of the week it is? Today is' ,
'I hate to be the bearer of bad news, but today is ' ,
'Oh look, once again it is '
] |random }}
{{states.sensor.today_is.state }}.
2020-04-02 23:16:50 +00:00
2019-07-16 02:22:35 +00:00
{% endmacro %}
2019-07-14 21:02:31 +00:00
{% macro weather_alerts() %}
2020-04-02 23:16:50 +00:00
{% 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 %}
2019-07-14 21:02:31 +00:00
{% endif %}
{% endmacro %}
{% macro todays_events() %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.halloween_countdown','0') %}
2019-11-12 02:46:45 +00:00
Happy Halloween!
2019-07-14 21:02:31 +00:00
{% endif %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.christmas_countdown','0') %}
2019-07-14 21:02:31 +00:00
Merry Christmas Everyone!
{% endif %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.anniversary_our_wedding','0') %}
2020-04-02 23:16:50 +00:00
Happy Anniversary! It been an amazing {{ states.sensor.anniversary_our_wedding.attributes.years }} years!
2019-07-14 21:02:31 +00:00
{% endif %}
2019-12-09 03:01:26 +00:00
{% if is_state('calendar.holidays_in_united_states', 'on') %}
2019-07-14 21:02:31 +00:00
Today is {{states.calendar.holidays_in_united_states.attributes.message}}.
{% endif %}
2019-12-09 03:01:26 +00:00
{% if is_state('calendar.anchorage_holidays', 'on') %}
And do not forget. Today is also {{states.calendar.anchorage_holidays.attributes.message}}.
2019-07-14 21:02:31 +00:00
{% endif %}
2019-12-09 03:01:26 +00:00
{% if states.calendar.birthdays.state == 'on' %}
2019-11-22 02:36:16 +00:00
Today is {{ states.calendar.birthdays.attributes.message }} !
2019-07-14 21:02:31 +00:00
{% endif %}
2019-11-22 02:36:16 +00:00
{%- set event=states.calendar.national_holidays.attributes.message %}
2019-12-09 03:01:26 +00:00
{% if 'Day' in event and 'National' in event%}
2019-11-22 02:36:16 +00:00
{{ [
2019-12-09 03:01:26 +00:00
'And a very special Happy ' ,
'It is also ' ,
'Today is also known as ' ,
'I have just been <emphasis>informed</emphasis> today is ' ,
'Want to know a fact? Today is ' ,
'You should tell someone it is ' ,
'Everyday can be a holiday. So today is '
] |random }}
2020-04-02 23:16:50 +00:00
{{states.calendar.national_holidays.attributes.message | replace("&"," and ") }}.
2019-12-09 03:01:26 +00:00
{{ [
'We should celebrate.' ,
'I will leave the party planning up to <emphasis>you</emphasis>' ,
2020-01-03 17:28:38 +00:00
'I bet you, are glad I told you.' ,
2019-12-09 03:01:26 +00:00
'You cannot make this stuff up.' ,
2020-01-03 17:28:38 +00:00
'But, that just sounds silly.' ,
'Bet, you did not know. But, <emphasis>now </emphasis> you do. And the more you know.'
2019-11-22 02:36:16 +00:00
] |random }}
{%- endif -%}
2019-07-14 21:02:31 +00:00
{% endmacro %}
2019-10-14 01:13:23 +00:00
{%- macro dark_outside() -%}
{{ [
2019-11-26 02:25:35 +00:00
'The sun is officially down. Exterior Cameras are now motion activated.' ,
2019-10-26 22:58:43 +00:00
'The sun has been ushered off the stage. I have armed the perimiter cameras.' ,
2019-11-22 02:36:16 +00:00
'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.' ,
2020-01-03 17:28:38 +00:00
'If you have not looked outside lately, the light of the day is gone.'
2019-10-14 01:13:23 +00:00
] |random }}
{%- endmacro -%}
2020-04-02 23:16:50 +00:00
{% macro current_conditions_outside() %}
{{ [
'According to the National Weather Service,' ,
'Checking my weather sensors,' ,
'Looking outside,'
] |random }}
It is currently {{states.weather.home_2.state}} and {{states.nws_current_temperature.state|round}} degrees in Grayson.
2019-07-14 21:02:31 +00:00
The back porch is {{states.sensor.accurite_back_porch_temperature.state|round}} degrees.
{% endmacro %}
{% macro current_conditions_inside() %}
2020-03-18 02:52:50 +00:00
The inside temperature is {{states.climate.home.attributes.current_temperature|round}} degrees.
{{ [
'The Climate is currently set to ' ,
'The air is currently set to ' ,
'I have the internal cooling system to ' ,
'And the house is holding the temperature at '
] |random }}
{{states.climate.home.state}}.
2019-07-14 21:02:31 +00:00
{% endmacro %}
{% macro current_conditions_garage() %}
The garage is {{states.sensor.accurite_garage_temperature.state|round}} degrees with a humidity of {{states.sensor.accurite_garage_humidity.state|round}} percent.
{% endmacro %}
{% macro daily_forecast() %}
2020-04-02 23:16:50 +00:00
{{ [
'The National Weather Service says,' ,
'According to the latest forecast,'
] |random }}
The rest of the day should be {{ states.sensor.nws_current_forecast.state }}
2019-07-14 21:02:31 +00:00
{% endmacro %}
{% macro overnight_forecast() %}
2020-04-02 23:16:50 +00:00
{{ [
'Tonight we can expect,' ,
'According to tonights forecast we can expect,'
] |random }}
{{ states.sensor.nws_overnight_forecast.state }}
2019-07-14 21:02:31 +00:00
{% endmacro %}
{% macro future_forecast() %}
2019-12-09 03:01:26 +00:00
2020-04-02 23:16:50 +00:00
{{ [ 'Looking into the future plan for tomorrow to be, ' ,
' According to tomorrows forecast we can expect it to be, ' ,
'If you have not seen tomorrows forecast it is expected to be, '
2019-12-09 03:01:26 +00:00
] | random }}
2020-04-10 17:41:32 +00:00
{{states.sensor.nws_forecast_tomorrow.state}}.
{{ [ 'then tomorrow night should be, ' ,
'then overnight it is expected, ' ,
'before changing overnight to, '
] | random }}
{{states.sensor.nws_forecast_tomorrow_night.state}}.
2019-07-14 21:02:31 +00:00
{% endmacro %}
2019-10-14 01:13:23 +00:00
{% macro freeze_warning() %}
2019-12-09 03:01:26 +00:00
{% if is_state('input_boolean.freeze_warning','on') %}
2020-01-03 17:28:38 +00:00
{{ [ '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.' ,
2019-12-09 03:01:26 +00:00
'I suggest bringing in the plants other wise, the temperature might kill them. And that will be on <emphasis>you</emphasis>.' ,
2020-01-03 17:28:38 +00:00
'I would say winter is coming. But, based on the weather forecast <emphasis>it</emphasis> appears to be here. Grab the Dragon glass.'
2019-10-19 20:09:29 +00:00
] | random }}
2019-11-10 00:17:42 +00:00
{% endif %}
2019-10-14 01:13:23 +00:00
{% endmacro %}
2019-07-14 21:02:31 +00:00
{% macro upcoming_birthdays() %}
{% if states.sensor.birthday_skylar.state | int == 1 %}
Tomorrow is Skylar's Birthday.
{% endif %}
{% if states.sensor.birthday_jeff.state | int == 1 %}
Tomorrow is Jeff's Birthday.
{% endif %}
{% if states.sensor.birthday_kat.state | int == 1 %}
Tomorrow is Katherine's Birthday.
{% endif %}
{% if states.sensor.anniversary_our_wedding.state | int == 1 %}
Tomorrow is Jeff and Katherine's Wedding Anniversary.
{% endif %}
{% endmacro %}
{% macro upcoming_holidays() %}
2019-11-12 03:10:04 +00:00
{% if states.sensor.halloween_countdown.state | int == 1 %}
2019-07-14 21:02:31 +00:00
Tomorrow is Halloween. I hope you have picked out a costume.
2019-12-09 03:01:26 +00:00
{{ [ '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.'
2019-07-14 21:02:31 +00:00
] | random }}
2019-11-12 03:10:04 +00:00
{% elif states.sensor.halloween_countdown.state | int < 30 %}
2019-10-06 00:08:02 +00:00
There are only {{states.sensor.holiday_halloween.state}} days
2019-12-09 03:01:26 +00:00
{{ [ 'until Halloween.' ,
'until Halloween. It might not be enough time. ' ,
'and counting until the best holiday ever.' ,
'until you need a costume.'
2019-07-14 21:02:31 +00:00
] | random }}
2019-10-06 00:08:02 +00:00
2019-07-14 21:02:31 +00:00
{% else %}
{% endif %}
2019-10-06 00:08:02 +00:00
2019-11-12 03:10:04 +00:00
{% if states.sensor.christmas_countdown.state | int == 1 %}
2019-12-09 03:01:26 +00:00
Tomorrow is Christmas. <break time="2s"/> It is practically here! <break time="2s"/> Santa is coming tonight! Do not forget the cookies!
2019-11-12 03:10:04 +00:00
{% elif states.sensor.christmas_countdown.state | int < 31 %}
2019-11-26 02:25:35 +00:00
There are only {{states.sensor.christmas_countdown.state}} days until christmas.
2019-12-09 03:01:26 +00:00
{{ [ '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.' ,
2020-01-03 17:28:38 +00:00
'I do not want to be a smarthome. I want to be a dentist.' ,
'Do not eat all the cookies. '
2019-11-12 03:10:04 +00:00
] | random }}
2019-07-14 21:02:31 +00:00
{% else %}
{% endif %}
2019-11-22 02:36:16 +00:00
2019-07-14 21:02:31 +00:00
{% endmacro %}
2020-01-03 17:28:38 +00:00
{% macro upcoming_events() %}
{% 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 %}
2020-03-18 02:52:50 +00:00
There are {{ states.sensor.trip_disney.state }} days until the next Disney Trip!
2020-01-03 17:28:38 +00:00
{% else %}
2020-03-18 02:52:50 +00:00
There is {{ states.sensor.trip_disney.state }} day until the next Disney Trip!
2020-01-03 17:28:38 +00:00
{% endif %}
{% endif %}
{% if states.sensor.anniversary_our_wedding.state | int == 1 %}
Tomorrow is Jeff and Katherine's Wedding Anniversary.
{% endif %}
{% endmacro %}
2019-07-14 21:02:31 +00:00
{% macro skylar_dressed() %}
Skylar,
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.birthday_skylar', '0') %}
2019-07-14 21:02:31 +00:00
Even birthday boys have to get dressed. So get to it.
{% else %}
2019-12-09 03:01:26 +00:00
{{ [ 'It is time to get dressed. ' ,
'It is time to put some real clothes on. ' ,
'it is now time to change your underwear.' ,
2020-04-10 17:41:32 +00:00
'You need to get dressed for the day.' ,
'If you have not gotten dressed it is that time.' ,
'We have reached that time during the day in which you should get dressed.'
2019-07-14 21:02:31 +00:00
] | random }}
{% endif %}
{% endmacro %}
{% macro prebed_routine() %}
Skylar,
2019-12-09 03:01:26 +00:00
{{ [ 'It is time to get in the bath. ' ,
2020-01-03 17:28:38 +00:00
'You only have thirty minutes until bedtime. That means you should be heading for the bathtub. Time to get clean.' ,
2020-04-10 17:41:32 +00:00
'I cannot communicate with the bathtub. Or I would have started the water for you already. So you will have to start the bath, <emphasis>yourself</emphasis>' ,
'My sensors are detecting a <emphasis>strange</emphasis> smell. I am running diagnostics. But in the mean time, <emphasis>you</emphasis> should start a bath.' ,
2019-12-09 03:01:26 +00:00
'I hate to say it but, it is time to get cleaned up.' ,
2020-01-03 17:28:38 +00:00
'Did you ever hear the one about the kid who never took a bath? <break time="2s"/>Yeah, me <emphasis>either</emphasis>. So we should keep it that way. Bath time now, <emphasis>sir</emphasis>.' ,
2019-12-09 03:01:26 +00:00
'Tee Minus 30 minutes and counting until you should be off to sleep. Time to get cleaned up, and get your pajamas on.'
2019-07-14 21:02:31 +00:00
] | random }}
2019-12-09 03:01:26 +00:00
If you go now there may be time for stories. Do not forget to brush your teeth.
{% if is_state('sensor.weekday', 'fri') %}
2020-03-18 02:52:50 +00:00
Oh, and tomorrow is Saturday, so we can sleep in.
2019-07-14 21:02:31 +00:00
{% endif %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.weekday', 'sat') %}
2020-03-18 02:52:50 +00:00
Oh, and tomorrow is Sunday, so we can sleep in.
2019-07-14 21:02:31 +00:00
{% endif %}
{% endmacro %}
2019-11-12 03:10:04 +00:00
2019-07-14 21:02:31 +00:00
{% macro school_today() %}
2019-12-09 03:01:26 +00:00
{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %}
2020-04-10 17:41:32 +00:00
Because you have Digital Learning today!
2019-12-09 03:01:26 +00:00
{% if states.calendar.skylar_school.attributes.description == 'early-release' %}
2019-07-14 21:02:31 +00:00
And guess what? It is early release!
{% endif %}
2019-12-09 03:01:26 +00:00
{% if states.calendar.skylar_school.attributes.description == 'start_thanksgiving_break' %}
2019-11-12 03:10:04 +00:00
And One More Thing. Tomorrow is the first day of Thanksgiving Break.
2019-11-12 02:46:45 +00:00
{% endif %}
2019-12-09 03:01:26 +00:00
{% if states.calendar.skylar_school.attributes.description == 'start_winter_break' %}
2019-11-12 03:10:04 +00:00
And One More Thing. Tomorrow is the first day of Winter Break.
2019-11-12 02:46:45 +00:00
{% endif %}
2019-12-09 03:01:26 +00:00
{% if states.calendar.skylar_school.attributes.description == 'start_spring_break' %}
2019-11-12 03:10:04 +00:00
And One More Thing. Tomorrow is the first day of Spring Break.
2019-11-12 02:46:45 +00:00
{% endif %}
2019-12-09 03:01:26 +00:00
{% if states.calendar.skylar_school.attributes.description == 'start_fall_break' %}
2019-11-12 03:10:04 +00:00
And One More Thing. Tomorrow is the first day of Fall Break.
2019-11-12 02:46:45 +00:00
{% endif %}
2020-01-03 17:28:38 +00:00
{% else %}
{% 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, ok?' ,
'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 %}
2019-07-14 21:02:31 +00:00
{% endif %}
{% endmacro %}
2020-04-10 17:41:32 +00:00
{% macro skylar_events() %}
# Event have been canceled due to Covid-19
# {% if is_state('calendar.skylar_events', 'on') %}
# You have {{ states.calendar.skylar_events.attributes.message }} today as well!
# {% endif %}
# {% if is_state('sensor.weekday', 'mon') %}
# And you have The Little Gym today.
# {% endif %}
2019-07-14 21:02:31 +00:00
{% endmacro %}
{% macro clothes_suggestion() %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.clothing_forecast', 'Freezing') %}
It is going to be freezing today, so I suggest wearing long pants and a heavy coat.
{% elif is_state('sensor.clothing_forecast','Cold') %}
It is going to be cold today, so I suggest wearing long pants and a light jacket.
{% elif is_state('sensor.clothing_forecast', 'Chilly') %}
It is going to be chilly today, so I suggest wearing at least long pants.
{% elif is_state('sensor.clothing_forecast', 'Nice') %}
2019-07-22 14:26:24 +00:00
It is going to be
2019-12-09 03:01:26 +00:00
{{ [ 'nice outside' ,
'pretty nice outside ' ,
'a good day to be outside ' ,
'rather enjoyable outside ' ,
2019-07-22 14:26:24 +00:00
] | random }}
2020-04-10 17:41:32 +00:00
today. So I suggest wearing shorts.
2019-12-09 03:01:26 +00:00
{% elif is_state('sensor.clothing_forecast', 'Toasty') %}
2019-07-22 14:26:24 +00:00
It is going to be a
2019-12-09 03:01:26 +00:00
{{ [ 'bit warm ' ,
'rather warm outside ' ,
'almost too hot outside ' ,
'a little warm ' ,
2019-07-22 14:26:24 +00:00
] | random }}
2020-04-10 17:41:32 +00:00
today. So I suggest wearing shorts.
2019-12-09 03:01:26 +00:00
{% elif is_state('sensor.clothing_forecast', 'Hot') %}
2019-07-22 14:26:24 +00:00
It is going to be
2019-12-09 03:01:26 +00:00
{{ [ 'hot' ,
'hotter than the sun ' ,
'hotter than hot, but in a lot of bad ways ' ,
'hotter than the sun outside ' ,
'super hot ' ,
'hotter than the inside of a volcano '
2019-07-22 14:26:24 +00:00
] | random }}
2020-04-10 17:41:32 +00:00
today. So I suggest wearing shorts.
2019-07-14 21:02:31 +00:00
{% else %}
2019-07-22 14:26:24 +00:00
It is going to be {{ states.sensor.clothing_forecast.state }} today so I suggest wearing shorts.
2019-07-14 21:02:31 +00:00
{% endif %}
{% endmacro %}
2019-11-12 02:46:45 +00:00
2019-11-12 03:10:04 +00:00
{% macro school_holiday() %}
2019-12-09 03:01:26 +00:00
{% 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, ok?' ,
'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.'
2019-11-12 03:10:04 +00:00
] | random }}
2019-11-12 02:46:45 +00:00
{% endif %}
{% endmacro %}
2019-07-16 01:40:39 +00:00
{% macro reminders() %}
2019-12-09 03:01:26 +00:00
{% if is_state('input_boolean.heartworm', 'on') %}
2019-07-16 01:40:39 +00:00
Today is the day Winston gets his heartworm medicine.
{% endif %}
{% endmacro %}
2019-07-14 21:02:31 +00:00
{% macro chores() %}
2019-07-16 02:04:28 +00:00
{% if now().strftime('%H')|int < 12 and now().strftime('%H')|int > 6 %}
2019-12-09 03:01:26 +00:00
Do not forget to make your beds!
2019-07-16 02:04:28 +00:00
{% endif %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.weekday', 'mon') %}
2019-11-12 19:36:27 +00:00
{% if now().strftime('%H')|int > 17 %}
2019-12-09 03:01:26 +00:00
{{ [ 'Do not forget tomorrow is Trash Day. ' ,
'I advise you move the trash cans to the curb for the weekly pickup. ' ,
' The trash and recycle should go out'
2019-07-14 21:02:31 +00:00
] | random }}
2019-11-12 19:36:27 +00:00
{% endif %}
2019-07-14 21:02:31 +00:00
{% endif %}
2019-07-16 02:04:28 +00:00
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.weekday', 'tue') %}
2019-11-12 19:36:27 +00:00
{% if now().strftime('%H')|int > 17 %}
2019-12-09 03:01:26 +00:00
{{ [ '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.'
2019-07-16 02:04:28 +00:00
] | random }}
{% endif %}
{% endif %}
2019-07-16 01:40:39 +00:00
2019-07-14 21:02:31 +00:00
{% endmacro %}
{% macro door_status() %}
2019-12-09 03:01:26 +00:00
{% if is_state('group.external_doors', 'on') %}
2019-07-14 21:02:31 +00:00
There are doors are open.
{% else %}
All doors are closed.
{% endif %}
{% endmacro %}
2019-10-14 01:13:23 +00:00
{% macro garage_door_status() %}
2019-12-09 03:01:26 +00:00
{% 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.'
2019-10-14 01:13:23 +00:00
] | random }}
2019-12-09 03:01:26 +00:00
{% 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.'
2019-11-10 00:17:42 +00:00
] | random }}
2019-10-14 01:13:23 +00:00
{% else %}
2019-12-09 03:01:26 +00:00
{{ [ 'The garage doors are closed. ' ,
'The cargo hold is sealed. ' ,
'Looks like the garage has been secured.' ,
2020-01-03 17:28:38 +00:00
'The pod bay doors are closed. '
2019-10-14 01:13:23 +00:00
] | random }}
{% endif %}
{% endmacro %}
2019-07-14 21:02:31 +00:00
{% macro jeff_location() %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.jeff_location', 'home') %}
2019-07-14 21:02:31 +00:00
{{ [
2019-12-09 03:01:26 +00:00
'I am not sure why you are asking me,' ,
'You must be having vision problems.' ,
'I do not want to alarm you, but'
2019-07-14 21:02:31 +00:00
] | random }}
Jeff is already home!
{% else %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.jeff_destination', 'na') %}
2019-07-14 21:02:31 +00:00
{%- if states.device_tracker.life360_jeffrey_stone.attributes.moving == True %}
Jeff is currenly moving, but
{{ [
2019-12-09 03:01:26 +00:00
'I am unable to determine his destination.' ,
'I am having trouble tracking him.' ,
'His destination is currently unknown.'
2019-07-14 21:02:31 +00:00
] | random }}
At last check was {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes from home.
{%- elif states.device_tracker.life360_jeffrey_stone.attributes.driving == True %}
Jeff is currenly moving, but
{{ [
2019-12-09 03:01:26 +00:00
'I am unable to determine his destination.' ,
'I am having trouble tracking him.' ,
'His destination is currently unknown.'
2019-07-14 21:02:31 +00:00
] | random }}
At last check was {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes from home.
{% else %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.jeff_location', 'Lost') %}
2019-07-14 21:02:31 +00:00
Jeff is lost, but at last check was {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes from home.
{% else %}
Jeff is currently at {{ states.sensor.jeff_location.state }}.
{% endif %}
{% endif %}
2019-12-09 03:01:26 +00:00
{% elif is_state('sensor.jeff_destination', 'home') %}
2019-07-14 21:02:31 +00:00
Jeff is currenly heading home and will be here in {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes.
{% else %}
Jeff is heading to {{ states.sensor.jeff_destination.state }}.
{% endif %}
{% endif %}
{% endmacro %}
{% macro kat_location() %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.kat_location', 'home') %}
2019-07-14 21:02:31 +00:00
{{ [
2019-12-09 03:01:26 +00:00
'I am not sure why you are asking me,' ,
'You must be having vision problems.' ,
'I do not want to alarm you, but'
2019-07-14 21:02:31 +00:00
] | random }}
Katherine is already home!
{% else %}
2019-12-09 03:01:26 +00:00
{% if is_state('input_boolean.kat_travel_monitor', 'on') %}
2019-07-14 21:02:31 +00:00
{%- if states.device_tracker.life360_kat_stone.attributes.moving == True %}
Katherine is currently heading home and will be here in {{states.sensor.kat_ett_home.attributes.duration | round}} minutes.
{%- elif states.device_tracker.life360_kat_stone.attributes.driving == True %}
Katherine is currently heading home and will be here in {{states.sensor.kat_ett_home.attributes.duration | round}} minutes.
{% else %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.kat_location', 'Lost') %}
2019-07-14 21:02:31 +00:00
Katherine is lost, but at last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% else %}
Katherine is currently at {{ states.sensor.kat_location.state }}.
{% endif %}
{% endif %}
{% else %}
{%- if states.device_tracker.life360_kat_stone.attributes.moving == True %}
Katherine is currenly moving, and
{{ [
2019-12-09 03:01:26 +00:00
'I am unable to determine her destination.' ,
'I am having trouble tracking her.' ,
'Her destination is currently unknown.'
2019-07-14 21:02:31 +00:00
] | random }}
At last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{%- elif states.device_tracker.life360_kat_stone.attributes.driving == True %}
Katherine is currenly moving, and
{{ [
2019-12-09 03:01:26 +00:00
'I am unable to determine her destination.' ,
'I am having trouble tracking her.' ,
'Her destination is currently unknown.'
2019-07-14 21:02:31 +00:00
] | random }}
At last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% else %}
2019-12-09 03:01:26 +00:00
{% if is_state('sensor.kat_location', 'Lost') %}
2019-07-14 21:02:31 +00:00
Katherine is lost, but at last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% else %}
I have located Katherine. She is at {{ states.sensor.kat_location.state }}, and
at last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endmacro %}
{% macro jeff_headed_home() %}
2019-12-09 03:01:26 +00:00
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.
2019-07-14 21:02:31 +00:00
{% endmacro %}
{% macro kat_headed_home() %}
2019-12-09 03:01:26 +00:00
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.
2019-07-14 21:02:31 +00:00
{% endmacro %}
{% macro traffic_conditions() %}
{%- if states.sensor.home_to_zoo.state|round > 50 %}
Traffic to the Zoo appears heavy than normnal.
{% else %}
Traffic to the Zoo is normal.
{% endif %}
Currently it will take {{states.sensor.home_to_zoo.state|round}} minutes to get to the Zoo.
{%- if states.sensor.home_to_summit.state|round > 50 %}
Traffic to the Cox Automotive appears heavy than normnal.
{% else %}
Traffic to the Cox is normal.
{% endif %}
Currently it will take {{states.sensor.home_to_summit.state|round}} minutes to get to Cox Automotive.
{% endmacro %}
{% macro iss() %}
{{ [
2019-12-09 03:01:26 +00:00
'But the International Space Station is passing over. Wave.' ,
'But The International Space Station just flew by.' ,
'But if you were to look up right now, and it was dark outside, and you happened to be looking in the right place you would see the International Space Station go by. But, it has already passed.'
2019-07-14 21:02:31 +00:00
] | random}}
{% endmacro %}
2019-11-22 02:36:16 +00:00
{% macro full_moon() %}
{{ [
2019-12-09 03:01:26 +00:00
'There is a Full Moon out tonight, and this time it is the <emphasis>actual</emphasis> moon. And <emphasis>not</emphasis> the neighbor. ' ,
'Hey look, There is the full moon. ' ,
'The moon is <emphasis>huge<e/mphasis>! And full. ' ,
'If you want to see the full moon, <emphasis>tonight is the night</emphasis>.' ] | random }}
2019-11-22 02:36:16 +00:00
{% endmacro %}
2019-07-14 21:02:31 +00:00
{% macro security_report() %}
{%- if states.input_boolean.sentry_mode.state == 'on' %}
{{ [
2019-12-09 03:01:26 +00:00
'Sentry Mode is enabled.' ,
'Sentry mode is currently active.' ,
'Barn Door Protocol is currently in effect.' ,
'My security system is currently armed.'
2019-07-14 21:02:31 +00:00
] | random}}
{% else %}
{{ [
2019-12-09 03:01:26 +00:00
'Sentry Mode is disabled.' ,
'Sentry mode is currently active.' ,
'My security system is currently disarmed.'
2019-07-14 21:02:31 +00:00
] | random}}
{% endif %}
{%- if states.group.external_doors.state == 'off' %}
All external doors are secured.
{% else %}
The following doors are open,
{%- if states.binary_sensor.front_door.state == 'on' %}
Front Door.
{% endif %}
{%- if states.binary_sensor.back_door.state == 'on' %}
Back Door.
{% 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 %}
{% endmacro %}
{%- macro washer_needs_emptying() -%}
{{ [
2019-12-09 03:01:26 +00:00
'Just a reminder. Washing machine needs to be emptied.' ,
'I am sure you have more inportant things to do, but the washing machine needs to be emptied.' ,
'Looks like the washing machine has completed it is cycle.' ,
'Do not forget to move the clothes to the dryer.'
2019-07-14 21:02:31 +00:00
] | random }}
{%- endmacro -%}
2019-11-22 02:36:16 +00:00
{%- macro house_party_protocol_enabled() -%}
{{ [
2019-12-09 03:01:26 +00:00
'Anchorage House has been configured for a House Party.' ,
'Incense has been turned on.' ,
'I have enabled house party protocol.'
2019-11-22 02:36:16 +00:00
] | random }}
{%- endmacro -%}
{%- macro house_party_protocol_disabled() -%}
{{ [
2019-12-09 03:01:26 +00:00
'The House Party has been canceled.' ,
'Incense has been turned off.' ,
'I have disabled house party protocol.'
2019-11-22 02:36:16 +00:00
] | random }}
{%- endmacro -%}
2020-03-18 02:52:50 +00:00
{%- macro snark_door_motion() -%}
{{ [
'Do you want me to send them away?' ,
'I have armed the lasers. Just say the word.' ,
'I was not informed there would be guests.' ,
'They do not appear to have any gifts, so I suggest no opening the door.' ,
'My sensors have detected a meat popsicle.' ,
'I do not think they can hear me.'
] | random }}
{%- endmacro -%}
{%- macro snark_door_open() -%}
{{ [
'Would you like me to calulate how much air condition is being wasted? Spoiler Alert. You are not going to like the answer.' ,
'I have detected a large number of insects entering the house.' ,
'Can a human be so kind and close it?' ,
2020-04-10 17:41:32 +00:00
'Hey. The door was just opened and this is crazy. But now you know. So closed it maybe.' ,
2020-03-18 02:52:50 +00:00
'The air quality in this house has actually improved.' ,
'Closing the door would improve the security of the house.' ,
2020-04-10 17:41:32 +00:00
'Hey. The door was just opened and this is crazy. But now you know. So closed it maybe.'
2020-03-18 02:52:50 +00:00
] | random }}
{%- endmacro -%}
2020-04-02 23:16:50 +00:00
{# 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 -%}
2020-03-18 02:52:50 +00:00
2019-07-14 21:02:31 +00:00
{# ********************************************* #}
{# ******** Start the Speech routines ******** #}
{# ********************************************* #}
2020-04-02 23:16:50 +00:00
{# a macro to call all macros :) #}
{%- macro mother_of_all_macros() -%}
{% if call_greeting == 1 %}
{{ greeting() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_confirmation == 1 %}
{{ confirmation() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_interuption == 1 %}
{{ interuption() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_issue == 1 %}
{{ issue() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_morning_greeting == 1 %}
{{ morning_greeting() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_evening_greeting == 1 %}
{{ evening_greeting() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_time_annc == 1 %}
{{ time_annc() }}
{% endif %}
2019-07-16 02:22:35 +00:00
2020-04-02 23:16:50 +00:00
{% if states.sensor.nws_alerts.state | int > 0 and call_weather_alerts == 1 %}
{{ weather_alerts() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_todays_events == 1 %}
{{ todays_events() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_dark_outside == 1 %}
{{ dark_outside() }}
{% endif %}
2019-10-14 01:13:23 +00:00
2020-04-02 23:16:50 +00:00
{% if call_current_conditions_outside == 1 %}
{{ current_conditions_outside() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_current_conditions_inside == 1 %}
{{ current_conditions_inside() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_current_conditions_garage == 1 %}
{{ current_conditions_garage() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_daily_forecast == 1 %}
{{ daily_forecast() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_overnight_forecast == 1 %}
{{ overnight_forecast() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_future_forecast == 1 %}
{{ future_forecast() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_freeze_warning == 1 %}
{{ freeze_warning() }}
{% endif %}
2019-10-14 01:13:23 +00:00
2020-04-02 23:16:50 +00:00
{% if call_upcoming_birthdays == 1 %}
{{ upcoming_birthdays() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_upcoming_holidays == 1 %}
{{ upcoming_holidays() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_upcoming_events == 1 %}
{{ upcoming_events() }}
{% endif %}
2020-01-03 17:28:38 +00:00
2020-04-02 23:16:50 +00:00
{% if call_skylar_dressed == 1 %}
{{ skylar_dressed() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_prebed_routine == 1 %}
{{ prebed_routine() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_school_today == 1 %}
{{ school_today() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_skylar_events == 1 %}
{{ skylar_events() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_clothes_suggestion == 1 %}
{{ clothes_suggestion() }}
{% endif %}
{% if call_school_holiday == 1 %}
{{ school_holiday() }}
{% endif %}
2019-11-12 02:46:45 +00:00
2020-04-02 23:16:50 +00:00
{% if call_reminders == 1 %}
{{ reminders() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_chores == 1 %}
{{ chores() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_door_status == 1 %}
{{ door_status() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_garage_door_status == 1 %}
{{ garage_door_status() }}
{% endif %}
2019-10-14 01:13:23 +00:00
2020-04-02 23:16:50 +00:00
{% if call_jeff_location == 1 %}
{{ jeff_location() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_kat_location == 1 %}
{{ kat_location() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_jeff_headed_home == 1 %}
{{ jeff_headed_home() }}
{% endif %}
{% if call_kat_headed_home == 1 %}
{{ kat_headed_home() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_traffic_conditions == 1 %}
{{ traffic_conditions() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{{ usps }}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_iss == 1 %}
{{ iss() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_full_moon == 1 %}
{% if is_state('sensor.moon', 'full_moon') %}
{{ full_moon() }}
{% endif %}
2019-11-22 02:36:16 +00:00
{% endif %}
2020-04-02 23:16:50 +00:00
{% if call_security_report == 1 %}
{{ security_report() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_washer_needs_emptying == 1 %}
{{ washer_needs_emptying() }}
{% endif %}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{% if call_house_party_protocol_enabled == 1 %}
{{ house_party_protocol_enabled() }}
{% endif %}
2019-11-22 02:36:16 +00:00
2020-04-02 23:16:50 +00:00
{% if call_house_party_protocol_disabled == 1 %}
{{ house_party_protocol_disabled() }}
{% endif %}
2019-11-22 02:36:16 +00:00
2020-04-02 23:16:50 +00:00
{{ welcome_home }}
2019-07-14 21:02:31 +00:00
2020-04-02 23:16:50 +00:00
{{ speech_message }}
2020-03-18 02:52:50 +00:00
2020-04-02 23:16:50 +00:00
{% if call_snark_door_motion == 1 %}
{{ snark_door_motion() }}
{% endif %}
2020-03-18 02:52:50 +00:00
2020-04-02 23:16:50 +00:00
{% if call_snark_door_open == 1 %}
{{ snark_door_open() }}
{% endif %}
{%- endmacro -%}
{{- cleanup(mother_of_all_macros()) -}}
2019-02-21 17:49:55 +00:00
###############################################################################
# Twitter
###############################################################################
twitter_notify :
sequence :
- service : notify.twitter
data_template :
message : >
2019-12-09 03:01:26 +00:00
{% set msg = '' %}
{% set msg = msg + ' ' + message %}
{% set msg = msg + ' #iot #smarthome' %}
2019-02-21 17:49:55 +00:00
{{ msg }}
2019-11-14 01:53:43 +00:00
twitter_notify_image :
sequence :
- service : notify.twitter
data_template :
message : >-
{{ tweet }} #iot #smarthome
data :
media : >-
{{ image }}
2019-02-21 17:49:55 +00:00
twitter_snark :
sequence :
- service : notify.twitter
data_template :
message : !include ../templates/twitter_snark.yaml
2019-07-14 01:38:53 +00:00
twitter_stats :
sequence :
2019-11-25 02:58:35 +00:00
- service : notify.twitter
2019-07-14 01:38:53 +00:00
data_template :
2019-11-25 02:58:35 +00:00
message : !include ../templates/twitter_stats.yaml
2019-02-21 17:49:55 +00:00
2019-11-11 03:45:04 +00:00
twitter_promos :
sequence :
- service : notify.twitter
data_template :
message : !include ../templates/twitter_promos.yaml
2020-04-10 17:41:32 +00:00
twitter_selfpromos :
sequence :
- service : notify.twitter
data_template :
message : !include ../templates/twitter_selfpromos.yaml
twitter_great_content :
sequence :
- service : notify.twitter
data_template :
message : !include ../templates/twitter_great_content.yaml
2019-11-14 01:55:04 +00:00
2019-02-21 17:49:55 +00:00
twitter_new_ha :
sequence :
2019-11-25 02:58:35 +00:00
- service : notify.twitter
2019-11-13 03:49:51 +00:00
data_template :
2019-11-25 02:58:35 +00:00
message : !include ../templates/twitter_new_ha.yaml
2019-11-13 03:49:51 +00:00
2019-07-11 11:43:09 +00:00
###############################################################################
# Weather Report
###############################################################################
weather_report :
sequence :
2019-07-14 21:02:31 +00:00
- service : script.ah_report
data :
call_weather_alerts : 1
2020-04-02 23:16:50 +00:00
call_current_conditions_outside : 1
2019-07-14 21:02:31 +00:00
call_current_conditions_inside : 1
call_current_conditions_garage : 1
call_daily_forecast : 1
call_overnight_forecast : 1
call_future_forecast : 1
2019-07-11 11:43:09 +00:00
###############################################################################
# Traffic Report
###############################################################################
traffic_report :
sequence :
2019-07-14 21:02:31 +00:00
- service : script.ah_report
data :
call_traffic_conditions : 1
2019-07-14 01:38:53 +00:00
###############################################################################
# Security Report
###############################################################################
security_report :
sequence :
2019-07-14 21:02:31 +00:00
- service : script.ah_report
data :
call_security_report : 1
2019-07-11 11:43:09 +00:00
###############################################################################
2019-07-14 01:38:53 +00:00
# Jeff Traffic Reports
2019-07-11 11:43:09 +00:00
###############################################################################
jeff_eta_report :
sequence :
2019-07-14 21:02:31 +00:00
- service : script.ah_report
data :
call_jeff_location : 1
2019-07-14 01:38:53 +00:00
jeff_headed_home_annc :
sequence :
2019-07-14 21:02:31 +00:00
- service : script.ah_report
data :
call_jeff_headed_home : 1
2019-07-14 01:38:53 +00:00
2019-07-11 11:43:09 +00:00
###############################################################################
2019-07-14 01:38:53 +00:00
# Kat Traffic Reports
2019-07-11 11:43:09 +00:00
###############################################################################
kat_eta_report :
sequence :
2019-07-14 21:02:31 +00:00
- service : script.ah_report
data :
call_kat_location : 1
2019-07-11 11:43:09 +00:00
2019-07-14 01:38:53 +00:00
kat_headed_home_annc :
sequence :
2019-07-14 21:02:31 +00:00
- service : script.ah_report
data :
call_kat_headed_home : 1