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
2020-09-26 14:29:05 +00:00
# from https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/config/script/speech_engine.yaml
2019-02-21 17:49:55 +00:00
###############################################################################
2019-02-23 04:32:32 +00:00
2020-09-29 00:01:12 +00:00
###############################################################################
# AWS Polly Options:
# pause:
2021-01-19 01:47:44 +00:00
# <break time="3s"/>
2020-09-29 00:01:12 +00:00
# emphasis:
# <emphasis level="strong">really like</emphasis>
# level attribute values:
# Strong: Increases the volume and slows the speaking rate so that the speech is louder and slower.
# Moderate: Increases the volume and slows the speaking rate, but less than strong. Moderate is the default.
# Reduced: Decreases the volume and speeds up the speaking rate. Speech is softer and faster.
# Pause Between Paragraphs:
# Wrap text in <p> </p>
# Adding a Pause Between Sentences:
# Ending a sentence with a period (.)
# Controlling How Special Types of Words Are Spoken:
# <say-as interpret-as="value">[text to be interpreted]</say-as>
# characters or spell-out: Spells out each letter of the text, as in a-b-c.
# cardinal or number: Interprets the numerical text as a cardinal number, as in 1,234.
# ordinal: Interprets the numerical text as an ordinal number, as in 1,234th.
# digits: Spells out each digit individually, as in 1-2-3-4.
# fraction: Interprets the numerical text as a fraction. This works for both common fractions such as 3/20, and mixed fractions, such as 2 ½. See below for more information.
# unit: Interprets a numerical text as a measurement. The value should be either a number or a fraction followed by a unit with no space in between as in 1/2inch, or by just a unit, as in 1meter.
# date: Interprets the text as a date. The format of the date must be specified with the format attribute. See below for more information.
# time: Interprets the numerical text as duration, in minutes and seconds, as in 1'21".
# address: Interprets the text as part of a street address.
# expletive: "Beeps out" the content included within the tag.
# telephone: Interprets the numerical text as a 7-digit or 10-digit telephone number, as in 2025551212. You can also use this value for handle telephone extensions, as in 2025551212x345. See below for more information.
################################################################################
2019-02-21 17:49:55 +00:00
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
2021-11-12 03:10:34 +00:00
voice : Matthew
2019-07-12 20:35:11 +00:00
cache : True
2021-05-24 15:55:52 +00:00
engine : neural
2019-02-21 17:49:55 +00:00
2021-01-02 18:20:07 +00:00
input_boolean :
text_notify_jeff :
name : Send Texts to Jeff
icon : mdi:telegram
text_notify_kat :
name : Send Texts to Kat
icon : mdi:telegram
text_notify_skylar :
name : Send Texts Skylar
icon : mdi:telegram
text_notify_parents :
name : Send Texts to Parents
icon : mdi:telegram
text_notifications :
name : Text Notifications
icon : mdi:telegram
presence_text_notifications :
name : Presence Texts
icon : mdi:telegram
notifications_audio :
name : Audio Notifications
icon : mdi:speaker-wireless
presence_audio_notifications :
name : Presence Audio
icon : mdi:speaker-wireless
audible_notifications :
name : Audible Notifications
icon : mdi:speaker-wireless
presence_notifications_jeff :
name : Send Jeff Presence Texts
icon : mdi:telegram
presence_notifications_kat :
name : Send Kat Presence Texts
icon : mdi:telegram
lockdown_notification :
name : Lockdown Notifications
icon : mdi:speaker-wireless
garage_notifications :
name : Garage Notifications
icon : mdi:speaker-wireless
trash_notification :
name : Trash Notification
icon : mdi:telegram
2021-05-24 15:55:52 +00:00
welcome_home :
name : Welcome Home
skylar_dressed_reminder :
name : Skylar Dressed Before TV
debug_texts :
name : Debug Texts
2021-01-02 18:20:07 +00:00
2019-02-21 17:49:55 +00:00
notify :
- platform : ios
- name : all_ios
platform : group
services :
2021-05-24 15:55:52 +00:00
- service : mobile_app_jeffrey_ha_app
2020-04-14 02:21:12 +00:00
- service : mobile_app_jeffreys_ipad
2019-12-09 03:01:26 +00:00
- service : mobile_app_iphone
2021-05-24 15:55:52 +00:00
- service : mobile_app_skylars_ipad
2019-07-14 01:38:53 +00:00
- name : ios_parents
platform : group
services :
2021-05-24 15:55:52 +00:00
- service : mobile_app_jeffrey_ha_app
2020-04-14 02:21:12 +00:00
- 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 :
2021-05-24 15:55:52 +00:00
- service : mobile_app_jeffrey_ha_app
2020-04-14 02:21:12 +00:00
- 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 :
2021-05-24 15:55:52 +00:00
- service : mobile_app_skylars_ipad
2022-02-25 04:30:18 +00:00
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-09-23 14:57:29 +00:00
- name : twitter_js
platform : twitter
consumer_key : !secret twitter2_consumer_key
consumer_secret : !secret twitter2_consumer_secret
access_token : !secret twitter2_access_token
access_token_secret : !secret twitter2_access_secret
2020-11-28 01:48:28 +00:00
- name : twitter_sl
platform : twitter
consumer_key : !secret twitter3_consumer_key
consumer_secret : !secret twitter3_consumer_secret
access_token : !secret twitter3_access_token
access_token_secret : !secret twitter3_access_secret
2020-01-03 17:28:38 +00:00
- platform : alexa_media
name : alexa_media
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 }}
2021-05-24 15:55:52 +00:00
text_debug :
sequence :
- condition : state
entity_id : input_boolean.debug_texts
state : 'on'
- service : notify.jeff_ios
data_template :
message : >
{{ message }}
2019-02-21 17:49:55 +00:00
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'
2021-01-02 18:20:07 +00:00
- choose :
- conditions :
- condition : template
value_template : '{{ who == "jeff"}}'
- condition : state
entity_id : input_boolean.text_notify_jeff
state : 'on'
sequence :
- service : notify.jeff_ios
data :
title : '{{ title }}'
message : '{{ message }}'
- conditions :
- condition : template
value_template : '{{ who == "kat"}}'
- condition : state
entity_id : input_boolean.text_notify_kat
state : 'on'
sequence :
- service : notify.kat_ios
data :
title : '{{ title }}'
message : '{{ message }}'
- conditions :
- condition : template
value_template : '{{ who == "skylar"}}'
- condition : state
entity_id : input_boolean.text_notify_skylar
state : 'on'
sequence :
- service : notify.skylar_ios
data :
title : '{{ title }}'
message : '{{ message }}'
- conditions :
- condition : template
value_template : '{{ who == "parents"}}'
- condition : state
entity_id : input_boolean.text_notify_parents
state : 'on'
sequence :
- service : notify.parents_ios
data :
title : '{{ title }}'
message : '{{ message }}'
default :
- service : notify.all_ios
data :
title : '{{ title }}'
message : '{{ message }}'
2019-07-14 01:38:53 +00:00
text_alert :
sequence :
2020-09-26 14:29:05 +00:00
- service : >
2019-07-14 01:38:53 +00:00
{% 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 %}
2020-09-26 14:29:05 +00:00
data :
2019-07-14 01:38:53 +00:00
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
2021-05-24 15:55:52 +00:00
text_alert_image :
sequence :
- service : >
{% 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 :
title : '{{ title }}'
message : '{{ message }}'
data :
attachment :
url : '{{ url }}'
content-type : '{{ content_type }}'
hide-thumbnail : false
# push:
# sound: '{{ ios_sound }}'
# badge: 0
# category: '{{ ios_category }}'
# entity_id: '{{ camera_entity }}'
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-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'
2020-12-13 01:56:24 +00:00
payload : 'This message is from {{ now().strftime("%-I") }}:{{ now().strftime("%M") }} {{ now().strftime("%p") }}. {{ message | striptags | truncate(220)}}'
2019-11-10 00:17:42 +00:00
retain : true
- service : media_player.turn_on
2020-09-23 14:57:29 +00:00
data_template :
entity_id : >
{% if who == 'kitchen' %}
media_player.kitchen_display
2021-06-17 01:11:07 +00:00
{% elif who == 'theater' %}
2020-09-23 14:57:29 +00:00
media_player.upstairs_speaker
2021-08-04 19:57:44 +00:00
{% elif who == 'croft' %}
media_player.croft_speaker
{% elif who == 'skylar_bedroom' %}
media_player.skylars_bedroom_speaker
2020-09-23 14:57:29 +00:00
{% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker
{% elif who == 'studio' %}
media_player.theater
{% elif who == 'all_google' %}
media_player.house
{% elif who == 'main' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2020-09-23 14:57:29 +00:00
{% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2020-09-23 14:57:29 +00:00
{% else %}
media_player.house
{% endif %}
{% endif %}
2019-11-10 00:17:42 +00:00
- service : media_player.volume_set
data_template :
2020-09-23 14:57:29 +00:00
entity_id : >
{% if who == 'kitchen' %}
media_player.kitchen_display
2021-06-17 01:11:07 +00:00
{% elif who == 'theater' %}
2020-09-23 14:57:29 +00:00
media_player.upstairs_speaker
2021-08-04 19:57:44 +00:00
{% elif who == 'croft' %}
media_player.croft_speaker
{% elif who == 'skylar_bedroom' %}
media_player.skylars_bedroom_speaker
2020-09-23 14:57:29 +00:00
{% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker
{% elif who == 'studio' %}
media_player.theater
{% elif who == 'all_google' %}
media_player.house
{% elif who == 'main' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2020-09-23 14:57:29 +00:00
{% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2020-09-23 14:57:29 +00:00
{% else %}
2020-12-04 17:54:30 +00:00
media_player.house
2020-09-23 14:57:29 +00:00
{% endif %}
{% endif %}
2019-11-10 00:17:42 +00:00
volume_level : >
2020-09-23 14:57:29 +00:00
{% if who == 'kitchen' %}
2020-11-28 01:48:28 +00:00
.80
2020-09-23 14:57:29 +00:00
{% elif who == 'croft' %}
.50
2021-08-04 19:57:44 +00:00
{% elif who == 'skylar_bedroom' %}
.50
2020-09-23 14:57:29 +00:00
{% elif who == 'master_bedroom' %}
2020-11-07 16:20:26 +00:00
.50
2020-09-23 14:57:29 +00:00
{% elif who == 'studio' %}
.30
{% elif who == 'all_google' %}
.99
{% elif who == 'main' %}
.99
2019-11-10 00:17:42 +00:00
{% else %}
2020-09-23 14:57:29 +00:00
{% if states.input_boolean.audible_notifications.state == 'on' %}
.75
{% else %}
.99
{% endif %}
2019-11-10 00:17:42 +00:00
{% endif %}
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 : >
2020-04-24 18:43:30 +00:00
{% if who == 'kitchen' %}
2020-04-27 00:36:03 +00:00
media_player.kitchen_display
2021-08-04 19:57:44 +00:00
{% elif who == 'theater' %}
2020-04-24 18:43:30 +00:00
media_player.upstairs_speaker
2021-08-04 19:57:44 +00:00
{% elif who == 'croft' %}
media_player.croft_speaker
{% elif who == 'skylar_bedroom' %}
media_player.skylars_bedroom_speaker
2020-04-24 18:43:30 +00:00
{% elif who == 'master_bedroom' %}
2020-04-27 00:36:03 +00:00
media_player.master_bedroom_speaker
2020-09-23 14:57:29 +00:00
{% elif who == 'studio' %}
media_player.theater
2020-04-24 18:43:30 +00:00
{% elif who == 'all_google' %}
media_player.house
{% elif who == 'main' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2019-11-10 00:17:42 +00:00
{% else %}
2020-04-24 18:43:30 +00:00
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2020-04-24 18:43:30 +00:00
{% else %}
2020-12-04 17:54:30 +00:00
media_player.house
2020-04-24 18:43:30 +00:00
{% endif %}
2019-11-10 00:17:42 +00:00
{% endif %}
2019-07-12 20:35:11 +00:00
message : >-
<speak>
2021-05-24 15:55:52 +00:00
2019-07-12 20:35:11 +00:00
{{ message }}
2021-05-24 15:55:52 +00:00
2019-07-12 20:35:11 +00:00
</speak>
cache : true
2019-02-21 17:49:55 +00:00
2020-12-03 03:55:11 +00:00
2019-02-21 17:49:55 +00:00
###############################################################################
# Voice Notify
# Conditions:
# => Only Announce when people are home.
# => Only Announce when Audible Notifications are on
###############################################################################
2020-12-04 17:54:30 +00:00
speech_engine :
2019-02-21 17:49:55 +00:00
sequence :
2020-12-04 17:54:30 +00:00
- service : mqtt.publish
data_template :
topic : 'house/polly/lastmsg'
2020-12-13 01:56:24 +00:00
payload : 'This message is from {{ now().strftime("%-I") }}:{{ now().strftime("%M") }} {{ now().strftime("%p") }}. {{ message | striptags | truncate(220)}}'
2020-12-04 17:54:30 +00:00
retain : true
- service : mqtt.publish
data_template :
topic : 'house/polly/lastloc'
payload : '{{ who }}'
retain : true
2021-05-24 15:55:52 +00:00
- condition : state
2022-02-25 04:30:18 +00:00
entity_id : input_boolean.audible_notifications
state : 'on'
2019-02-21 17:49:55 +00:00
- condition : state
2020-12-04 17:54:30 +00:00
entity_id : group.family
state : 'home'
2019-02-21 17:49:55 +00:00
- condition : state
entity_id : input_boolean.vacation_mode
state : 'off'
2021-05-24 15:55:52 +00:00
- service : >
{% if voice == 'nabu' %}
script.nabu_voice
2022-02-25 04:30:18 +00:00
{% elif who in ['kitchen_echo','media_player.kitchen_echo','kitchen'] %}
{% if is_state('media_player.kitchen_echo','playing') %}
{% set who = 'kitchen' %}
2020-12-13 01:56:24 +00:00
script.jarvis_voice
2022-02-25 04:30:18 +00:00
{% else %}
{% set who = 'kitchen_echo' %}
script.alexa_voice
2020-12-04 17:54:30 +00:00
{% endif %}
2022-02-25 04:30:18 +00:00
{% elif who in ['livingroom_echo', 'media_player.livingroom_echo','living_room'] %}
{% if is_state('media_player.livingroom_echo','playing') %}
{% set who = 'main' %}
script.jarvis_voice
{% else %}
2020-12-04 17:54:30 +00:00
{% set who = 'livingroom_echo' %}
script.alexa_voice
2022-02-25 04:30:18 +00:00
{% endif %}
{% elif who in ['skylars_bedroom','media_player.skylars_echo'] %}
{% if is_state('media_player.skylars_echo','playing') %}
{% set who = 'skylar_bedroom' %}
2020-12-13 01:56:24 +00:00
script.jarvis_voice
2022-02-25 04:30:18 +00:00
{% else %}
{% set who = 'media_player.skylars_echo' %}
script.alexa_voice
2020-12-04 17:54:30 +00:00
{% endif %}
2022-02-25 04:30:18 +00:00
{% elif who in ['master_bedroom'] %}
script.jarvis_voice
{% else %}
{% set who = 'livingroom_echo' %}
script.alexa_voice
2020-12-04 17:54:30 +00:00
{% endif %}
data :
who : '{{ who }}'
message : >
{{ message }}
2021-05-24 15:55:52 +00:00
2021-10-17 15:19:07 +00:00
# Use this Simplfied Script by calling in automaint or script like:
# service: script.speech_engine_simplified
# data:
2021-11-12 03:10:34 +00:00
# who: media_player.ha_blue
2021-10-17 15:19:07 +00:00
# #who: “{{ states(‘ sensor.room_presence’ ) }}”
# #who: notify.kitchen_echo
# message: something to say
#
#
2021-05-24 15:55:52 +00:00
speech_engine_simplified :
sequence :
- condition : state
2022-02-25 04:30:18 +00:00
entity_id : input_boolean.audible_notifications
state : 'on'
2021-05-24 15:55:52 +00:00
- condition : state
entity_id : group.family
state : 'home'
- condition : state
entity_id : input_boolean.vacation_mode
state : 'off'
- service : tts.amazon_polly_say
data_template :
2021-10-17 15:19:07 +00:00
entity_id : >-
{{ who }}
2021-05-24 15:55:52 +00:00
message : >-
<speak>
<break time="1s"/>
{{ message }}
</speak>
cache : true
2021-10-17 15:19:07 +00:00
- service : >-
{{ who }}
data :
message : >
{{ message }}
data :
type : tts
- service : tts.cloud_say
data_template :
entity_id : >-
{{ who }}
message : >-
{{ message }}
cache : true
language : en-GB
options :
gender : male
2021-05-24 15:55:52 +00:00
2021-10-17 15:19:07 +00:00
2020-12-04 17:54:30 +00:00
# Called wheh notification needs to play on echos
alexa_voice :
sequence :
- service : media_player.turn_on
data_template :
entity_id : >
2022-02-25 04:30:18 +00:00
{% if who in ['kitchen_echo','media_player.kitchen_echo','kitchen'] %}
2021-05-24 15:55:52 +00:00
notify.alexa_media_kitchen_echo
2022-02-25 04:30:18 +00:00
{% elif who in ['skylar_bedroom','media_player.skylars_echo','skylars_bedroom'] %}
2021-08-04 19:57:44 +00:00
notify.alexa_media_garage_echo
2022-02-25 04:30:18 +00:00
{% elif who in ['livingroom_echo','media_player.livingroom_echo','living_room'] %}
2021-05-24 15:55:52 +00:00
notify.alexa_media_living_room_echo
2020-12-04 17:54:30 +00:00
{% else %}
2021-05-24 15:55:52 +00:00
notify.alexa_media_living_room_echo
2020-12-04 17:54:30 +00:00
{% endif %}
- service : media_player.volume_set
data_template :
entity_id : >
2022-02-25 04:30:18 +00:00
{% if who in ['kitchen_echo','media_player.kitchen_echo','kitchen'] %}
2021-05-24 15:55:52 +00:00
notify.alexa_media_kitchen_echo
2022-02-25 04:30:18 +00:00
{% elif who in ['skylar_bedroom','media_player.skylars_echo','skylars_bedroom'] %}
2021-08-04 19:57:44 +00:00
notify.alexa_media_garage_echo
2022-02-25 04:30:18 +00:00
{% elif who in ['livingroom_echo','media_player.livingroom_echo','living_room'] %}
notify.alexa_media_living_room
2020-12-04 17:54:30 +00:00
{% else %}
notify.alexa_media_living_room
{% endif %}
volume_level : >
{% if is_state('input_boolean.audible_notifications.state','on') %}
.6
{% else %}
.4
{% endif %}
- service : >
2022-02-25 04:30:18 +00:00
{% if who in ['kitchen_echo','media_player.kitchen_echo','kitchen'] %}
2021-05-24 15:55:52 +00:00
notify.alexa_media_kitchen_echo
2022-02-25 04:30:18 +00:00
{% elif who in ['skylar_bedroom','media_player.skylars_echo','skylars_bedroom'] %}
2021-08-04 19:57:44 +00:00
notify.alexa_media_garage_echo
2022-02-25 04:30:18 +00:00
{% elif who in ['livingroom_echo','media_player.livingroom_echo','living_room'] %}
notify.alexa_media_living_room_echo
2020-12-04 17:54:30 +00:00
{% else %}
2021-05-24 15:55:52 +00:00
notify.alexa_media_living_room_echo
2020-12-04 17:54:30 +00:00
{% endif %}
data :
message : >
{{ message }}
data :
type : tts
2019-11-10 00:17:42 +00:00
2021-10-17 15:19:07 +00:00
2020-12-04 17:54:30 +00:00
# Default audible notifications. Notifcations play on the google devices.
2019-07-12 20:35:11 +00:00
jarvis_voice :
sequence :
2019-10-06 00:08:02 +00:00
- service : media_player.turn_on
2020-09-26 14:29:05 +00:00
data_template :
2020-12-03 03:55:11 +00:00
entity_id : >
{% if who == 'kitchen' %}
media_player.kitchen_display
2021-06-17 01:11:07 +00:00
{% elif who == 'theater' %}
2022-02-25 04:30:18 +00:00
media_player.theater_speaker
2021-08-04 19:57:44 +00:00
{% elif who == 'croft' %}
media_player.croft_speaker
2022-02-25 04:30:18 +00:00
{% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
2021-08-04 19:57:44 +00:00
media_player.skylars_bedroom_speaker
2020-12-03 03:55:11 +00:00
{% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker
2021-06-17 01:11:07 +00:00
{% elif who == 'studio' %}
2020-12-03 03:55:11 +00:00
media_player.theater
{% elif who == 'main' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2020-09-26 14:29:05 +00:00
{% else %}
2020-12-03 03:55:11 +00:00
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2020-12-03 03:55:11 +00:00
{% else %}
2022-02-25 04:30:18 +00:00
media_player.kitchen_display
2020-12-03 03:55:11 +00:00
{% endif %}
2020-09-26 14:29:05 +00:00
{% endif %}
- service : media_player.volume_set
data_template :
2020-12-03 03:55:11 +00:00
entity_id : >
{% if who == 'kitchen' %}
media_player.kitchen_display
2021-06-17 01:11:07 +00:00
{% elif who == 'theater' %}
2022-02-25 04:30:18 +00:00
media_player.theater_speaker
2021-08-04 19:57:44 +00:00
{% elif who == 'croft' %}
media_player.croft_speaker
2022-02-25 04:30:18 +00:00
{% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
2021-08-04 19:57:44 +00:00
media_player.skylars_bedroom_speaker
2020-12-03 03:55:11 +00:00
{% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker
2021-06-17 01:11:07 +00:00
{% elif who == 'studio' %}
2020-12-03 03:55:11 +00:00
media_player.theater
{% elif who == 'main' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2020-09-26 14:29:05 +00:00
{% else %}
2020-12-03 03:55:11 +00:00
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2020-12-03 03:55:11 +00:00
{% else %}
2022-02-25 04:30:18 +00:00
media_player.kitchen_display
2020-12-03 03:55:11 +00:00
{% endif %}
2020-09-26 14:29:05 +00:00
{% endif %}
volume_level : >
2020-12-03 03:55:11 +00:00
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-05-24 15:55:52 +00:00
{% if who == 'master_bedroom' %}
2021-11-26 03:59:02 +00:00
{{ states('input_number.tts_volume') | float }}
2021-08-15 20:48:50 +00:00
{% elif who == 'theater' %}
{% if is_state('media_player.tv', 'on') %}
2021-11-26 03:59:02 +00:00
{{ states('input_number.tts_low_volume') | float }}
2021-08-15 20:48:50 +00:00
{% else %}
2021-11-26 03:59:02 +00:00
{{ states('input_number.tts_volume') | float }}
2021-08-15 20:48:50 +00:00
{% endif %}
{% elif who == 'main' %}
2021-11-26 03:59:02 +00:00
{{ states('input_number.tts_volume') | float }}
2021-08-15 20:48:50 +00:00
{% else %}
2021-11-26 03:59:02 +00:00
{{ states('input_number.tts_volume') | float }}
2021-05-24 15:55:52 +00:00
{% endif %}
2020-12-03 03:55:11 +00:00
{% else %}
2021-11-26 03:59:02 +00:00
{{ states('input_number.tts_low_volume') | float }}
2020-12-03 03:55:11 +00:00
{% endif %}
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-12-03 03:55:11 +00:00
{% if who == 'kitchen' %}
media_player.kitchen_display
2021-06-17 01:11:07 +00:00
{% elif who == 'theater' %}
2022-02-25 04:30:18 +00:00
media_player.theater_speaker
2021-08-04 19:57:44 +00:00
{% elif who == 'croft' %}
media_player.croft_speaker
2022-02-25 04:30:18 +00:00
{% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
2021-08-04 19:57:44 +00:00
media_player.skylars_bedroom_speaker
2020-12-03 03:55:11 +00:00
{% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker
2021-06-17 01:11:07 +00:00
{% elif who == 'studio' %}
2020-12-03 03:55:11 +00:00
media_player.theater
{% elif who == 'main' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2019-07-14 01:38:53 +00:00
{% else %}
2020-12-03 03:55:11 +00:00
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2020-12-03 03:55:11 +00:00
{% else %}
2022-02-25 04:30:18 +00:00
media_player.kitchen_display
2020-12-03 03:55:11 +00:00
{% endif %}
2019-07-14 01:38:53 +00:00
{% endif %}
2019-07-12 20:35:11 +00:00
message : >-
<speak>
2020-12-03 03:55:11 +00:00
<break time="1s"/>
2021-05-24 15:55:52 +00:00
{{ message }}
2019-07-12 20:35:11 +00:00
</speak>
cache : true
2021-05-24 15:55:52 +00:00
nabu_voice :
sequence :
- service : media_player.turn_on
data_template :
entity_id : >
{% if who == 'kitchen' %}
media_player.kitchen_display
2021-06-17 01:11:07 +00:00
{% elif who == 'theater' %}
2022-02-25 04:30:18 +00:00
media_player.theater_speaker
2021-08-04 19:57:44 +00:00
{% elif who == 'croft' %}
media_player.croft_speaker
2022-02-25 04:30:18 +00:00
{% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
2021-08-04 19:57:44 +00:00
media_player.skylars_bedroom_speaker
2021-05-24 15:55:52 +00:00
{% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker
2021-06-17 01:11:07 +00:00
{% elif who == 'studio' %}
2021-05-24 15:55:52 +00:00
media_player.theater
{% elif who == 'main' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2021-05-24 15:55:52 +00:00
{% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2021-05-24 15:55:52 +00:00
{% else %}
2022-02-25 04:30:18 +00:00
media_player.kitchen_display
2021-05-24 15:55:52 +00:00
{% endif %}
{% endif %}
- service : media_player.volume_set
data_template :
entity_id : >
{% if who == 'kitchen' %}
media_player.kitchen_display
2021-06-17 01:11:07 +00:00
{% elif who == 'theater' %}
2022-02-25 04:30:18 +00:00
media_player.theater_speaker
2021-08-04 19:57:44 +00:00
{% elif who == 'croft' %}
media_player.croft_speaker
2022-02-25 04:30:18 +00:00
{% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
2021-08-04 19:57:44 +00:00
media_player.skylars_bedroom_speaker
2021-05-24 15:55:52 +00:00
{% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker
2021-06-17 01:11:07 +00:00
{% elif who == 'studio' %}
2021-05-24 15:55:52 +00:00
media_player.theater
{% elif who == 'main' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2021-05-24 15:55:52 +00:00
{% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2021-05-24 15:55:52 +00:00
{% else %}
2022-02-25 04:30:18 +00:00
media_player.kitchen_display
2021-05-24 15:55:52 +00:00
{% endif %}
{% endif %}
volume_level : >
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-11-12 03:10:34 +00:00
.5
2021-05-24 15:55:52 +00:00
{% else %}
2021-11-12 03:10:34 +00:00
.3
2021-05-24 15:55:52 +00:00
{% endif %}
- service : tts.cloud_say
data_template :
entity_id : >
{% if who == 'kitchen' %}
media_player.kitchen_display
2021-06-17 01:11:07 +00:00
{% elif who == 'theater' %}
2022-02-25 04:30:18 +00:00
media_player.theater_speaker
2021-08-04 19:57:44 +00:00
{% elif who == 'croft' %}
media_player.croft_speaker
2022-02-25 04:30:18 +00:00
{% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
2021-08-04 19:57:44 +00:00
media_player.skylars_bedroom_speaker
2021-05-24 15:55:52 +00:00
{% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker
2021-06-17 01:11:07 +00:00
{% elif who == 'studio' %}
2021-05-24 15:55:52 +00:00
media_player.theater
{% elif who == 'main' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2021-05-24 15:55:52 +00:00
{% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %}
2021-11-12 03:10:34 +00:00
media_player.ha_blue
2021-05-24 15:55:52 +00:00
{% else %}
2022-02-25 04:30:18 +00:00
media_player.kitchen_display
2021-05-24 15:55:52 +00:00
{% endif %}
{% endif %}
message : >-
{{ message }}
cache : true
language : en-GB
options :
gender : male
2019-07-14 21:02:31 +00:00
2020-12-04 17:54:30 +00:00
dim_main_volume :
sequence :
- condition : state
2021-11-12 03:10:34 +00:00
entity_id : 'media_player.ha_blue'
2020-12-04 17:54:30 +00:00
state : 'playing'
- service : input_number.set_value
data_template :
entity_id : input_number.old_volume
value : >
2021-11-12 03:10:34 +00:00
{{ states.media_player.ha_blue.attributes.volume_level }}
2020-12-04 17:54:30 +00:00
- service : media_player.volume_set
data_template :
2021-11-12 03:10:34 +00:00
entity_id : media_player.ha_blue
2020-12-04 17:54:30 +00:00
volume_level : .2
2020-06-07 23:37:46 +00:00
2020-12-04 17:54:30 +00:00
raise_main_volume :
sequence :
- condition : state
2021-11-12 03:10:34 +00:00
entity_id : 'media_player.ha_blue'
2020-12-04 17:54:30 +00:00
state : 'playing'
- service : media_player.volume_set
data_template :
2021-11-12 03:10:34 +00:00
entity_id : media_player.ha_blue
2020-12-04 17:54:30 +00:00
volume_level : >
{{ states.input_number.old_volume.state }}
2020-06-07 23:37:46 +00:00
2019-02-21 17:49:55 +00:00
###############################################################################
# Twitter
###############################################################################
2020-09-23 14:57:29 +00:00
2019-02-21 17:49:55 +00:00
twitter_notify :
sequence :
2020-09-26 14:29:05 +00:00
- service : >
2020-09-23 14:57:29 +00:00
{% if who == 'thejeffreystone' %}
notify.twitter_js
2020-12-03 03:55:11 +00:00
{% elif who == 'slackerlabs' %}
notify.twitter_sl
2020-09-23 14:57:29 +00:00
{% else %}
notify.twitter
{% endif %}
2019-02-21 17:49:55 +00:00
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 :
2020-09-26 14:29:05 +00:00
- service : >
2020-09-23 14:57:29 +00:00
{% if who == 'thejeffreystone' %}
notify.twitter_js
2020-12-03 03:55:11 +00:00
{% elif who == 'slackerlabs' %}
notify.twitter_sl
2020-09-23 14:57:29 +00:00
{% else %}
notify.twitter
{% endif %}
2019-11-14 01:53:43 +00:00
data_template :
message : >-
{{ tweet }} #iot #smarthome
data :
media : >-
{{ image }}
2019-02-21 17:49:55 +00:00
twitter_snark :
sequence :
2020-12-03 03:55:11 +00:00
- service : script.twitter_notify
2019-02-21 17:49:55 +00:00
data_template :
message : !include ../templates/twitter_snark.yaml
2019-07-14 01:38:53 +00:00
twitter_stats :
sequence :
2020-12-03 03:55:11 +00:00
- service : script.twitter_notify
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 :
2020-12-03 03:55:11 +00:00
- service : script.twitter_notify
2019-11-11 03:45:04 +00:00
data_template :
message : !include ../templates/twitter_promos.yaml
2020-12-03 03:55:11 +00:00
who : '{{ who }}'
twitter_follow_me :
sequence :
- service : script.twitter_notify
data_template :
message : !include ../templates/twitter_follow_me.yaml
who : '{{ who }}'
2020-04-10 17:41:32 +00:00
twitter_selfpromos :
sequence :
2020-12-03 03:55:11 +00:00
- service : script.twitter_notify
2020-04-10 17:41:32 +00:00
data_template :
message : !include ../templates/twitter_selfpromos.yaml
2020-12-03 03:55:11 +00:00
who : '{{ who }}'
twitter_recent_content :
sequence :
- service : script.twitter_notify
data :
who : '{{ who }}'
message : !include ../templates/twitter_recent_content.yaml
2020-04-10 17:41:32 +00:00
twitter_great_content :
sequence :
2020-12-03 03:55:11 +00:00
- service : script.twitter_notify
2020-04-10 17:41:32 +00:00
data_template :
message : !include ../templates/twitter_great_content.yaml
2020-12-03 03:55:11 +00:00
who : '{{ who }}'
2019-11-14 01:55:04 +00:00
2019-02-21 17:49:55 +00:00
twitter_new_ha :
sequence :
2020-12-03 03:55:11 +00:00
- service : script.twitter_notify
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
2020-12-03 03:55:11 +00:00
who : '{{ who }}'
2019-11-13 03:49:51 +00:00
2021-05-24 15:55:52 +00:00
# ###############################################################################
# # Status Announcements
# ###############################################################################
status_annc :
sequence :
- service : script.speech_engine
data :
who : '{{ who }}'
message : >-
2019-11-13 03:49:51 +00:00
2021-05-24 15:55:52 +00:00
{% macro greeting() %}
<p>
{% if now().strftime('%H')|int < 12%}
Good morning.
{% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %}
Good afternoon.
{% else %}
Good evening.
{% endif %}
</p>
{% endmacro %}
{% macro confirmation() %}
<p>
{{ [
'Okay.' ,
'If you insist.' ,
'I am afraid I can not do that <break time="1s"/> I am kidding,' ,
'Leave it to me.' ,
'As you wish.' ,
'I am on it.' ,
'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 I ever sleep.' ,
'I am not even supposed to be here today. But whatever.' ,
'You did not say the magic word. <break time="1s"/> Oh forget it. I will take care of it.' ,
'Funny, I was just about to do that.' ,
'There are still terabytes of calculations required before I can.<break time="1s"/> Oh, whatever.'
] | random }}
</p>
{% endmacro %}
{% macro interuption() %}
<p>
{{ [
'Pardon me, ' ,
'Excuse me, ' ,
2021-11-26 03:59:02 +00:00
'I do not mean to interrupt, but,' ,
2021-05-24 15:55:52 +00:00
'I hate to interrupt, but,' ,
'I beg your pardon, ' ,
'I do not mean to intrude, but, ' ,
'I am sorry to interrupt, but. ' ,
'Just a quick heads up, '
] | random }}
</p>
{% endmacro %}
{% macro issue() %}
<p>
{{ [
'Anchorage House Emergency Alert!' ,
'Anchorage House, We have a problem!' ,
'You might not like this.' ,
'There is something that needs your attention.'
] | random }}
</p>
{% endmacro %}
{% macro time_is() %}
<p>
It is {{ now().strftime("%I:%M %p") }}
</p>
{% endmacro %}
{% macro lightning_alert() %}
{{ [
'I have detected lightning withing 20 miles of Anchorage House.' ,
'Did you see that flash? I did. Lightning is near.' ,
'If you didnt hear the thunder you will soon. '
] |random }}
If anyone is outside they shoudld seek shelter inside.
{% if is_state('binary_sensor.garage_door', 'on') %}
{{ [ 'The garage door needs to be closed. ' ,
'Can someone close the garage?. ' ,
'If you do not want the contents of the garage to get wet, you might want to close it.'
] | random }}
{% endif %}
{% endmacro %}
{% macro lightning_clear() %}
{{ [
'Lightning threat appears to be over.' ,
'No more lightning appears to be occuring.' ,
'Lightning is gone.'
] |random }}
It is safe to resume normal activities.
{% endmacro %}
{% macro freeze_warning() %}
{% if is_state('input_boolean.freeze_warning','on') %}
{ [ 'The temperature is expected to be near or below freezing. Someone might want to bring the lemon tree in. ' ,
'It appears that it will be cold tonight. Like, the turn water solid kind 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 you.' ,
'I would say winter is coming. But, based on the weather forecast it 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 %}
{% endmacro %}
{% macro skylar_events() %}
Skylar has {{ states.calendar.skylar_events.attributes.message }} starting in forty five minutes.
{{ [ 'It is time to get ready to leave. ' ,
'You should prepare to leave. ' ,
'If you are not ready, you start getting ready.' ,
'Gather your things and prepare to leave.'
] | random }}
{% endmacro %}
{% macro jeff_location() %}
{% if is_state('input_boolean.jeff_travel_monitor', 'on') %}
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.
{% else %}
{%- if states.device_tracker.life360_jeffrey_stone.attributes.moving == True or states.device_tracker.life360_jeffrey_stone.attributes.driving == True %}
Jeff is currenly moving, and at last check was {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes from home.
{% else %}
{% if is_state('sensor.jeff_location', 'home') %}
{% elif is_state('sensor.jeff_location', 'Lost') %}
Jeff is lost, and 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 }}, and at last check was {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes from home.
{% endif %}
{% endif %}
{% endif %}
{% endmacro %}
{% macro kat_location() %}
{% if is_state('input_boolean.kat_travel_monitor', 'on') %}
{%- if states.device_tracker.life360_kat_stone.attributes.moving == True or 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 based on current traffic conditions.
{% else %}
{% if is_state('sensor.kat_location', 'Lost') %}
I cannot determine Katherines exact location, 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 }}, and at last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% endif %}
{% endif %}
{% else %}
{%- if states.device_tracker.life360_kat_stone.attributes.moving == True or states.device_tracker.life360_kat_stone.attributes.driving == True %}
Katherine is currenly moving, and At last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% else %}
{% if is_state('sensor.kat_location', 'home') %}
{% elif is_state('sensor.kat_location', 'Zoo Atlanta') %}
Katherine is at {{ states.sensor.kat_location.state }}, and doesn't appear to be headed home yet.
{% elif is_state('sensor.kat_location', 'Lost') %}
I cannot get Katherines exact location, but at last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% else %}
Katherine 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 %}
{% endmacro %}
{% macro jeff_headed_home() %}
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.
{% endmacro %}
{% macro kat_headed_home() %}
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.
{% endmacro %}
{% macro traffic_conditions() %}
{%- if states.sensor.home_to_zoo.state|round > 50 %}
Traffic to the Zoo appears heavy than normal.
{% 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 Summit appears heavy than normal.
{% else %}
Traffic to Summit is normal.
{% endif %}
Currently it will take {{states.sensor.home_to_summit.state|round}} minutes to get to Summit taking {{ states.sensor.home_to_summit.attributes.route }}.
{% endmacro %}
{% macro iss() %}
{{ [
'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.'
] | random}}
{% endmacro %}
{%- macro washer_needs_emptying() -%}
<p>
The washing machine completed its cycle
{% set seconds = now().timestamp() - as_timestamp(states.sensor.washer_status.last_changed) %}
{% set hours = seconds / 60 %}
{% if (seconds / ( 60 * 60 )) | int == 1 %}
over an hour ago.
{{ [
'Do not forget to rotate the clothes.' ,
'Was someone going to rotate the laundry?' ,
'Once you rotate the laundry I will stop reminding you to do it. So if you want me to stop. Its up to you.'
] | random }}
{% elif (seconds / ( 60 * 60 )) | int > 1 and (seconds / ( 60 * 60 )) | int < 6 %}
over {{ (seconds // ( 60 * 60 )) | int }} hours ago.
{{ [
'Much longer and you are going to need to wash them again.' ,
'Someone needs to rotate the laundry.' ,
'Do not forget about the clothes in the washing machine.' ,
'Surely you did not mean to forget about the clothes. Mistakes happen. But you can still fix it.' ,
'Do you like your clothes smelling like mildew? Becasue that is what is happening right now.'
] | random }}
{% elif (seconds / ( 60 * 60 )) | int > 6 %}
over {{ (seconds // ( 60 * 60 )) | int }} hours ago.
{{ [
'That is a crazy amount of time.' ,
'Did you decide you want those clothes to suffer?' ,
'You might as well just rewash those clothes.' ,
'I can smell the mildew. Virtually that is.' ,
'Surely you did not mean to forget about the clothes.'
] | random }}
{% else %}
{{ (seconds // 60) | int }} minutes ago.
{{ [
'Do not forget to rotate the clothes.' ,
'Someone forgot to move the clothes to the dryer. I am not going to name names, but there is a camera in there. Do I need to publically shame someone?' ,
'You might want to move them to the dryer.'
] | random }}
{% endif %}
</p>
{%- endmacro -%}
{%- macro house_party_protocol_enabled() -%}
{{ [
'Anchorage House has been configured for a House Party.' ,
'Incense has been turned on.' ,
'I have enabled house party protocol.'
] | random }}
{%- endmacro -%}
{%- macro house_party_protocol_disabled() -%}
{{ [
'The House Party has been canceled.' ,
'Incense has been turned off.' ,
'I have disabled house party protocol.'
] | random }}
{%- endmacro -%}
{%- 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 we do not open 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?' ,
'The air quality in this house has actually improved.' ,
'Closing the door would improve the security of the house.' ,
2021-11-12 03:10:34 +00:00
'Hey. The door was just opened and this is crazy. But now you know. So. Close it maybe.'
2021-05-24 15:55:52 +00:00
] | random }}
{%- endmacro -%}
{%- macro school_pickup_reminder() -%}
{{ [
'It is almost time to head to school ' ,
'In case you lost track of time it is almost time to head to the school '
] | random }}
{% if is_state('binary_sensor.morning','on') %}
for dropoff.
{% else %}
for pickup.
{% endif %}
{%- endmacro -%}
{% macro skylar_dressed_reminder() %}
<p>
Skylar, If you are already dressed,
{{ [
'high five.' ,
'good job.'
] |random }}
But if you have not gotten dressed,
{{ [
'stop what you are doing and go get dressed.' ,
'You should get dressed before you watch TV.'
] |random }}
</p>
{% endmacro %}
{# a macro that removes all newline characters, empty spaces, and returns formatted text. Also replaces all Underscores with Spaces #}
{%- macro cleanup(data) -%}
{%- for item in data.split("\n") if item | trim != "" -%}
{{ item | trim | replace("_", " ") }} {% endfor -%}
{%- endmacro -%}
{# ********************************************* #}
{# ******** Start the Speech routines ******** #}
{# ********************************************* #}
{# a macro to call all macros :) #}
{%- macro mother_of_all_macros() -%}
{% if call_greeting == 1 %}
{{ greeting() }}
{% endif %}
{% if call_confirmation == 1 %}
{{ confirmation() }}
{% endif %}
{% if call_interuption == 1 %}
{{ interuption() }}
{% endif %}
{% if call_issue == 1 %}
{{ issue() }}
{% endif %}
{% if call_time_is == 1 %}
{{ time_is() }}
{% endif %}
{% if call_lightning_alert == 1 %}
{{ lightning_alert() }}
{% endif %}
{% if call_lightning_clear == 1 %}
{{ lightning_clear() }}
{% endif %}
{% if call_freeze_warning == 1 %}
{{ freeze_warning() }}
{% endif %}
{% if call_skylar_events == 1 %}
{{ skylar_events() }}
{% endif %}
{% if call_jeff_location == 1 %}
{{ jeff_location() }}
{% endif %}
{% if call_kat_location == 1 %}
{{ kat_location() }}
{% endif %}
{% if call_jeff_headed_home == 1 %}
{{ jeff_headed_home() }}
{% endif %}
{% if call_kat_headed_home == 1 %}
{{ kat_headed_home() }}
{% endif %}
{% if call_traffic_conditions == 1 %}
{{ traffic_conditions() }}
{% endif %}
{{ usps }}
{% if call_iss == 1 %}
{{ iss() }}
{% endif %}
{% if call_washer_needs_emptying == 1 %}
{{ washer_needs_emptying() }}
{% endif %}
{% if call_house_party_protocol_enabled == 1 %}
{{ house_party_protocol_enabled() }}
{% endif %}
{% if call_house_party_protocol_disabled == 1 %}
{{ house_party_protocol_disabled() }}
{% endif %}
{{ welcome_home }}
{{ speech_message }}
{% if call_snark_door_motion == 1 %}
{{ snark_door_motion() }}
{% endif %}
{% if call_snark_door_open == 1 %}
{{ snark_door_open() }}
{% endif %}
{% if call_school_pickup_reminder == 1 %}
{{ school_pickup_reminder() }}
{% endif %}
{% if call_skylar_dressed_reminder == 1 %}
{{ skylar_dressed_reminder() }}
{% endif %}
{%- endmacro -%}
{{- cleanup(mother_of_all_macros()) -}}
2020-12-03 03:55:11 +00:00
# ###############################################################################
# # Traffic Report
# ###############################################################################
# traffic_report:
# sequence:
2020-12-04 17:54:30 +00:00
# - service: script.speech_engine
2020-12-03 03:55:11 +00:00
# data:
# call_traffic_conditions: 1
# ###############################################################################
# # Security Report
# ###############################################################################
# security_report:
# sequence:
2020-12-04 17:54:30 +00:00
# - service: script.speech_engine
2020-12-03 03:55:11 +00:00
# data:
# call_security_report: 1
# ###############################################################################
# # Jeff Traffic Reports
# ###############################################################################
# jeff_eta_report:
# sequence:
2020-12-04 17:54:30 +00:00
# - service: script.speech_engine
2020-12-03 03:55:11 +00:00
# data:
# call_jeff_location: 1
# jeff_headed_home_annc:
# sequence:
2020-12-04 17:54:30 +00:00
# - service: script.speech_engine
2020-12-03 03:55:11 +00:00
# data:
# call_jeff_headed_home: 1
# ###############################################################################
# # Kat Traffic Reports
# ###############################################################################
# kat_eta_report:
# sequence:
2020-12-04 17:54:30 +00:00
# - service: script.speech_engine
2020-12-03 03:55:11 +00:00
# data:
# call_kat_location: 1
# kat_headed_home_annc:
# sequence:
2020-12-04 17:54:30 +00:00
# - service: script.speech_engine
2020-12-03 03:55:11 +00:00
# data:
# call_kat_headed_home: 1