Major audible notification overhual. It was hard to maintain. This will be easier. Maybe

This commit is contained in:
Jeffrey Stone
2020-12-02 22:55:11 -05:00
parent 84a5e84fa5
commit d5191c9ab8
24 changed files with 1537 additions and 1564 deletions

View File

@@ -161,6 +161,25 @@ sensor:
or is_state('sensor.family_status', 'Home') }}
automation:
- id: skylar_is_awake
alias: Skylar is Awake
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.skylar_room_occupancy
to: 'on'
condition:
- condition: time
after: '05:00:00'
before: '08:30:00'
action:
- service: input_datetime.set_datetime
entity_id: input_datetime.skylar_awake_at
data:
time: "{{ now().strftime('%H:%M') }}"
- service: input_boolean.turn_on
entity_id: input_boolean.skylar_awake
- id: kat_arrives_zoo
alias: Kat Arrives at Zoo
initial_state: true
@@ -173,10 +192,10 @@ automation:
- service: input_boolean.turn_off
entity_id: input_boolean.kat_travel_monitor
- wait_template: "{{ not is_state('media_player.ha_speaker', 'playing') }}"
- service: script.ah_report
data:
speech_message: 'Kat has arrived at work.'
call_interuption: 1
- service: script.jarvis_voice
data_template:
who: '{{ states.sensor.room_audio.state }}'
message: 'Kat has arrived at work.'
- id: kat_leaves_zoo
alias: Kat Leaves Zoo Notification
@@ -190,10 +209,10 @@ automation:
- service: input_boolean.turn_on
entity_id: input_boolean.kat_travel_monitor
- wait_template: "{{ not is_state('media_player.ha_speaker', 'playing') }}"
- service: script.ah_report
data:
call_interuption: 1
call_kat_headed_home: 1
- service: script.jarvis_voice
data_template:
who: '{{ states.sensor.room_audio.state }}'
message:
- id: '1550109528753'
alias: Jeff Is Heading Home
@@ -205,10 +224,10 @@ automation:
action:
- service: script.jeff_destination_home
- wait_template: "{{ not is_state('media_player.ha_speaker', 'playing') }}"
- service: script.ah_report
data:
call_interurption: 1
call_jeff_headed_home: 1
- service: script.jarvis_voice
data_template:
who: '{{ states.sensor.room_audio.state }}'
message:
- id: jeff_heading_to_work
alias: Jeff Is Heading To Work
@@ -399,12 +418,9 @@ automation:
- service: input_boolean.turn_off
entity_id: input_boolean.jeff_traffic_alert_home
- id: welcome_home
alias: Welcome Home
mode: queued
max: 4
mode: restart
trigger:
- platform: state
entity_id:
@@ -412,38 +428,57 @@ automation:
- person.katherine
- person.uncle_matt
- person.papa
- person.skylar
from: 'not_home'
to: 'home'
condition:
- condition: state
entity_id: sensor.family_status
state: Home
action:
- service: script.family_is_home
# - wait_template: >-
# {{ states.binary_sensor.laundry_room_door.state == 'on' }}
- delay: 00:02:00
- service: script.ah_report
- service: group.set
data:
object_id: "arriving"
add_entities: >-
{{ trigger.to_state.entity_id }}
- 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'
- service: script.jarvis_voice
data_template:
call_interuption: 1
welcome_home: >
{% set person = trigger.to_state.attributes.friendly_name %}
{%- macro greeting_sentence(person) -%}
who: main
message: >
{% set person = expand('group.arriving')|map(attribute='name')|join(' and ') %}
{% set peoplecount = expand('group.arriving') | count %}
{% if peoplecount == 1 %}
{% set is_are = ' is ' %}
{% else %}
{% set is_are = ' are ' %}
{% endif %}
{%- macro greeting_sentence(person, is_are) -%}
{{ [
person + " has arrived.",
person + " is in the neighborhood.",
person + " is arriving.",
person ~ is_are + " in the neighborhood.",
person ~ is_are + " arriving.",
"My sensors are picking up the presence of additional humans. " ~ person +" has been identified as home.",
"Welcome back home " ~ person,
"Guess who is home?" ~ person +" is!",
"Guess who is home?" ~ person ~ is_are,
"I am sensing a disturbance in the force. " ~ person +" must be home!",
person + " is now in the house.",
person ~ is_are + "now in the house.",
person ~ "! You are home!",
"I know a secret! " ~ person +" is home!",
person ~ is_are + " now here. Hash tag Welcome Home.",
person ~ is_are + " now here. Hash tag Home.",
person ~ is_are + " now here. Hash tag Smart Home.",
"I know a secret! " ~ person ~ is_are +" home!",
"Just a quick announcement. " ~ person +" has arrived!",
"Hey" ~ person + "! High Five! Glad you are finally home.",
"Just a quick announcement. " ~ person +" has arrived!",
person + " has finally made it home."
] | random }}
{%- endmacro -%}
{{greeting_sentence(person)}}
- service: group.set
data:
object_id: "arriving"
entities: []
- id: guests_have_arrived
@@ -483,33 +518,6 @@ automation:
- service: input_boolean.turn_off
entity_id: input_boolean.jeff_traffic_alert_home
# - id: '1550107919204'
# alias: Family Is Home
# trigger:
# - platform: webhook
# webhook_id: home_webhook
# - entity_id: group.family
# from: not_home
# platform: state
# to: home
# condition: []
# action:
# - service: script.family_is_home
# - id: '1550108034209'
# alias: Family Is Away
# trigger:
# - platform: webhook
# webhook_id: away_webhook
# - entity_id: group.family
# from: home
# platform: state
# to: not_home
# condition: []
# action:
# - service: script.family_is_away
script:
family_is_home:
sequence:
@@ -594,3 +602,12 @@ script:
topic: kat/driving/destination
payload: na
retain: true
reset_skylar_sensors:
sequence:
- delay: 02:00:00
- service: input_datetime.set_datetime
entity_id: input_datetime.skylar_awake_at
data:
time: "00:00:00"
- service: input_boolean.turn_off
entity_id: input_boolean.skylar_awake