############################################################################### # @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: #ifttt: # key: !secret IFTTT_API_KEY tts: - platform: google_translate cache: true cache_dir: /tmp/tts time_memory: 300 - 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 notify: - platform: ios - name: all_ios platform: group services: - service: ios_jeffreystonesiphone - service: ios_jeffreystonesipad - service: ios_katherinestonesiphone - name: ios_parents platform: group services: - service: ios_jeffreystonesiphone - service: ios_jeffreystonesipad - service: ios_katherinestonesiphone - name: jeff_ios platform: group services: - service: ios_jeffreystonesiphone - service: ios_jeffreystonesipad - name: kat_ios platform: group services: - service: ios_katherinestonesiphone - 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: ############################################################################### # 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 }} 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 }}" ############################################################################### # 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 data_template: entity_id: media_player.hass_speaker message: > {{ message }} jarvis_alert: sequence: - service: tts.amazon_polly_say data_template: entity_id: media_player.hass_speaker message: >- {{ message }} cache: true ############################################################################### # 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 data_template: entity_id: media_player.hass_speaker message: > {{message }} jarvis_voice: sequence: - condition: template value_template: '{{ states.binary_sensor.quiet_time.state == "off" }}' - 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: entity_id: > {% if states.input_boolean.audible_notifications.state == 'on' %} media_player.hass_speaker {% else %} media_player.googlehome0715, media_player.googlehomehub3492 {% endif %} message: >- {{ message }} cache: true ############################################################################### # Twitter ############################################################################### twitter_notify: sequence: - service: notify.twitter data_template: message: > {% set msg = "" %} {% set msg = msg + " " + message %} {% set msg = msg + " #iot #smarthome" %} {{ msg }} twitter_snark: sequence: - service: notify.twitter data_template: message: !include ../templates/twitter_snark.yaml twitter_stats: sequence: - service: notify.twitter data_template: message: !include ../templates/twitter_stats.yaml 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 ############################################################################### # Morning Report ############################################################################### morning_report: sequence: - service: script.jarvis_voice data_template: message: !include ../templates/morning_report.yaml ############################################################################### # Skylar Get Dressed ############################################################################### skylar_morning_greeting: sequence: - service: script.jarvis_voice data_template: message: !include ../templates/skylar_morning.yaml ############################################################################### # Nightly Report ############################################################################### nightly_report: sequence: - service: script.jarvis_voice data_template: message: !include ../templates/nightly_report.yaml test_nightly_report: sequence: - service: script.jarvis_voice data_template: message: !include ../templates/nightly_report.yaml ############################################################################### # Weather Report ############################################################################### weather_report: sequence: - service: script.jarvis_voice data_template: message: !include ../templates/weather_report.yaml - delay: minutes: 5 - service: script.turn_off entity_id: script.weather_report ############################################################################### # Traffic Report ############################################################################### traffic_report: sequence: - service: script.jarvis_voice data_template: message: !include ../templates/traffic_report.yaml - 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 ############################################################################### # Jeff Traffic Reports ############################################################################### jeff_eta_report: sequence: - service: script.jarvis_voice data_template: message: !include ../templates/jeff_eta.yaml - 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 ############################################################################### # Kat Traffic Reports ############################################################################### kat_eta_report: sequence: - service: script.jarvis_voice data_template: message: !include ../templates/kat_eta.yaml - delay: minutes: 2 - service: script.turn_off entity_id: script.kat_eta_report 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 ############################################################################### # Prebed Routing ############################################################################### prebed_routine: sequence: - service: script.jarvis_voice 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.