Coninuing with the major audible notifications overhual of 2020

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

View File

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

View File

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

View File

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

View File

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

View File

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