home-assistant-configuration/packages/notify.yaml

415 lines
12 KiB
YAML
Raw Normal View History

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.
# Package modified from https://github.com/skalavala/smarthome/blob/master/packages/notify.yaml
###############################################################################
#homeassistant:
2019-02-23 04:32:32 +00:00
2019-02-21 17:49:55 +00:00
#ifttt:
# key: !secret IFTTT_API_KEY
tts:
- 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:
- service: ios_jeffreystonesiphone
- service: ios_jeffreystonesipad
- service: ios_katherinestonesiphone
2019-07-14 01:38:53 +00:00
- name: ios_parents
platform: group
services:
- service: ios_jeffreystonesiphone
- service: ios_jeffreystonesipad
- service: ios_katherinestonesiphone
2019-02-21 17:49:55 +00:00
- name: jeff_ios
platform: group
services:
- service: ios_jeffreystonesiphone
- service: ios_jeffreystonesipad
- name: kat_ios
platform: group
services:
- service: ios_katherinestonesiphone
2019-02-21 17:49:55 +00:00
- name: 'Master Bedroom Echo'
platform: command_line
command: "/home/homeassistant/bin/alexa_wrapper -d 'Master Bedroom'"
- name: 'Living Room Echo'
platform: command_line
command: "/home/homeassistant/bin/alexa_wrapper -d 'Living Room'"
- name: 'Kitchen Echo'
platform: command_line
command: "/home/homeassistant/bin/alexa_wrapper -d 'Kitchen'"
- name: 'All Echo'
platform: command_line
command: "/home/homeassistant/bin/alexa_wrapper -d 'All'"
- 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
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:
# url: "{{ url }}"
# content-type: "{{ content_type }}"
# hide-thumbnail: false
# push:
# sound: "{{ ios_sound }}"
# badge: 0
# category: "{{ ios_category }}"
# entity_id: "{{ camera_entity }}"
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:
# 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'
- service: tts.google_translate_say
2019-02-21 17:49:55 +00:00
data_template:
entity_id: media_player.hass_speaker
message: >
{{ message }}
2019-07-12 20:35:11 +00:00
jarvis_alert:
sequence:
- service: tts.amazon_polly_say
data_template:
entity_id: media_player.hass_speaker
message: >-
<speak>
{{ message }}
</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'
- condition: state
entity_id: media_player.hass_speaker
state: 'idle'
- service: tts.google_translate_say
2019-02-21 17:49:55 +00:00
data_template:
entity_id: media_player.hass_speaker
message: >
{{message }}
2019-02-21 17:49:55 +00:00
2019-07-12 20:35:11 +00:00
jarvis_voice:
sequence:
- condition: template
2019-07-14 01:38:53 +00:00
value_template: '{{ states.binary_sensor.quiet_time.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'
- wait_template: >-
{{ not is_state('media_player.hass_speaker', 'playing') }}
- service: tts.amazon_polly_say
data_template:
2019-07-14 01:38:53 +00:00
entity_id: >
{% if states.input_boolean.audible_notifications.state == 'on' %}
media_player.hass_speaker
{% else %}
media_player.googlehome0715, media_player.googlehomehub3492
{% endif %}
2019-07-12 20:35:11 +00:00
message: >-
<speak>
{{ message }}
</speak>
cache: true
2019-02-21 17:49:55 +00:00
###############################################################################
# Twitter
###############################################################################
twitter_notify:
sequence:
- service: notify.twitter
data_template:
message: >
{% set msg = "" %}
{% set msg = msg + " " + message %}
2019-02-23 04:32:32 +00:00
{% set msg = msg + " #iot #smarthome" %}
2019-02-21 17:49:55 +00:00
{{ msg }}
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:
- service: notify.twitter
data_template:
message: !include ../templates/twitter_stats.yaml
2019-02-21 17:49:55 +00:00
twitter_github:
sequence:
- service: notify.twitter
data_template:
message: >
{% set msg = "" %}
{% set msg = msg + " " + message %}
{% set msg = msg + " #smarthome #iot " %}
{{ msg }}
twitter_new_ha:
sequence:
- service: notify.twitter
data_template:
message: !include ../templates/twitter_new_ha.yaml
2019-02-23 04:32:32 +00:00
2019-02-21 17:49:55 +00:00
###############################################################################
# Morning Report
###############################################################################
morning_report:
sequence:
2019-07-12 20:35:11 +00:00
- service: script.jarvis_voice
2019-02-21 17:49:55 +00:00
data_template:
message: !include ../templates/morning_report.yaml
2019-02-23 04:32:32 +00:00
2019-02-21 17:49:55 +00:00
###############################################################################
# Skylar Get Dressed
###############################################################################
skylar_morning_greeting:
sequence:
2019-07-12 20:35:11 +00:00
- service: script.jarvis_voice
2019-02-21 17:49:55 +00:00
data_template:
message: !include ../templates/skylar_morning.yaml
2019-02-23 04:32:32 +00:00
2019-02-21 17:49:55 +00:00
###############################################################################
# Nightly Report
###############################################################################
nightly_report:
sequence:
2019-07-12 20:35:11 +00:00
- service: script.jarvis_voice
data_template:
message: !include ../templates/nightly_report.yaml
test_nightly_report:
sequence:
- service: script.jarvis_voice
2019-02-21 17:49:55 +00:00
data_template:
message: !include ../templates/nightly_report.yaml
###############################################################################
# Weather Report
###############################################################################
weather_report:
sequence:
2019-07-12 20:35:11 +00:00
- service: script.jarvis_voice
data_template:
message: !include ../templates/weather_report.yaml
2019-07-12 20:35:11 +00:00
- delay:
minutes: 5
2019-07-14 01:38:53 +00:00
- service: script.turn_off
2019-07-12 20:35:11 +00:00
entity_id: script.weather_report
###############################################################################
# Traffic Report
###############################################################################
traffic_report:
sequence:
2019-07-12 20:35:11 +00:00
- service: script.jarvis_voice
data_template:
message: !include ../templates/traffic_report.yaml
2019-07-14 01:38:53 +00:00
- delay:
minutes: 2
- service: script.turn_off
entity_id: script.traffic_report
###############################################################################
# Security Report
###############################################################################
security_report:
sequence:
- service: script.jarvis_voice
data_template:
message: !include ../templates/security_report.yaml
- delay:
minutes: 2
- service: script.turn_off
entity_id: script.security_report
###############################################################################
2019-07-14 01:38:53 +00:00
# Jeff Traffic Reports
###############################################################################
jeff_eta_report:
sequence:
2019-07-12 20:35:11 +00:00
- service: script.jarvis_voice
data_template:
message: !include ../templates/jeff_eta.yaml
2019-07-14 01:38:53 +00:00
- delay:
minutes: 2
- service: script.turn_off
entity_id: script.jeff_eta_report
jeff_headed_home_annc:
sequence:
- service: script.jarvis_voice
data_template:
message: !include ../templates/jeff_heading_home.yaml
- delay:
minutes: 2
- service: script.turn_off
entity_id: script.jeff_headed_home_annc
###############################################################################
2019-07-14 01:38:53 +00:00
# Kat Traffic Reports
###############################################################################
kat_eta_report:
sequence:
2019-07-12 20:35:11 +00:00
- service: script.jarvis_voice
data_template:
message: !include ../templates/kat_eta.yaml
2019-07-14 01:38:53 +00:00
- delay:
minutes: 2
- service: script.turn_off
entity_id: script.kat_eta_report
2019-07-14 01:38:53 +00:00
kat_headed_home_annc:
sequence:
- service: script.jarvis_voice
data_template:
message: !include ../templates/kat_heading_home.yaml
- delay:
minutes: 2
- service: script.turn_off
entity_id: script.kat_headed_home_annc
2019-02-21 17:49:55 +00:00
###############################################################################
# Prebed Routing
###############################################################################
prebed_routine:
sequence:
2019-07-12 20:35:11 +00:00
- service: script.jarvis_voice
2019-02-21 17:49:55 +00:00
data_template:
message: !include ../templates/skylar_night.yaml
# message: >
# Bed time is in 30 mins. If you are taking a bath now is the time to get in the tub, otherwise time to put on pajamas and brush teeth.