From b86ff39c7969a68aa6be726bbe6993cf744ee20f Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Wed, 19 Apr 2023 12:39:40 -0400 Subject: [PATCH] Alternate pickup from school for K Same --- packages/scheduling.yaml | 17 ++++++++++++++--- packages/school.yaml | 4 ++++ templates/speech/daily_briefing.yaml | 10 +++++++--- templates/speech/kallen_morning_briefing.yaml | 3 +++ 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/packages/scheduling.yaml b/packages/scheduling.yaml index 97e537a..fd2b6ea 100644 --- a/packages/scheduling.yaml +++ b/packages/scheduling.yaml @@ -79,6 +79,11 @@ input_boolean: name: Emma Bedroom Climate Override icon: mdi:plus-circle-outline +input_text: + kallen_pickup: + name: Kallen Pickup + icon: mdi:car + ################################################ # Current order of operations is as follows: # # # @@ -417,7 +422,9 @@ script: data: time: > {% if is_state('input_boolean.kallen_school_today','on') %} - {% if is_state('input_boolean.kallen_school_early_release','on') %} + {% if is_state('input_boolean.kallen_alternate_pickup','on') %} + 15:00 + {% elif is_state('input_boolean.kallen_school_early_release','on') %} 13:15 {% else %} 14:15 @@ -500,7 +507,9 @@ script: data: time: > {% if is_state('input_boolean.kallen_school_today','on') %} - {% if is_state('input_boolean.kallen_school_early_release','on') %} + {% if is_state('input_boolean.kallen_alternate_pickup','on') %} + 14:30 + {% elif is_state('input_boolean.kallen_school_early_release','on') %} 12:30 {% else %} 13:30 @@ -581,10 +590,12 @@ script: target: entity_id: input_boolean.master_bedroom_scheduling_evening_ran -# For now, this just ties her wakeup time to the master bedroom wakeup time. In the future this will have more conditions and be independent of other rooms. emma_bedroom_scheduling_morning: alias: 'Emma Bedroom Scheduling Morning' sequence: + - service: input_boolean.turn_off + target: + entity_id: input_boolean.emma_has_napped - if: - condition: state entity_id: input_boolean.emma_wakeup_override diff --git a/packages/school.yaml b/packages/school.yaml index 34808da..476ad91 100644 --- a/packages/school.yaml +++ b/packages/school.yaml @@ -23,6 +23,9 @@ input_boolean: kallen_band_practice: name: Kallen Band Practice icon: mdi:trumpet + kallen_alternate_pickup: + name: Kallen Alternate Pickup + icon: mdi:car input_datetime: school_first_day: @@ -450,6 +453,7 @@ script: - input_boolean.kallen_school_today - input_boolean.two_hour_delay - input_boolean.school_cancelled + - input_boolean.kallen_alternate_pickup kallen_school_reset_late: alias: 'Kallen School Reset Late' diff --git a/templates/speech/daily_briefing.yaml b/templates/speech/daily_briefing.yaml index d84c09e..f33e338 100644 --- a/templates/speech/daily_briefing.yaml +++ b/templates/speech/daily_briefing.yaml @@ -301,9 +301,13 @@ 'But there was a two hour delay. ' {% endif %} {% endif %} - Pickup today will be at {{(state_attr('input_datetime.kallen_school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }} - {% if is_state('input_boolean.kallen_school_early_release','on') %} - And It is early release! + {% if is_state('input_boolean.kallen_alternate_pickup','on') %} + {{ states('input_text.kallen_pickup') }} will be picking Collin up from school today. + {% else %} + Pickup today will be at {{ state_attr('input_datetime.kallen_school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False) }} + {% if is_state('input_boolean.kallen_school_early_release','on') %} + And It is early release! + {% endif %} {% endif %} {% if states('sensor.windows_open') | int > 0 %} 'I detect that there are windows open. Make sure you close them before you leave, or else the security system will not arm. ' diff --git a/templates/speech/kallen_morning_briefing.yaml b/templates/speech/kallen_morning_briefing.yaml index c8ec394..20b836d 100644 --- a/templates/speech/kallen_morning_briefing.yaml +++ b/templates/speech/kallen_morning_briefing.yaml @@ -89,6 +89,9 @@ {% endif %} School today starts at {{ (state_attr('input_datetime.kallen_school_day_start','timestamp') | int | timestamp_custom('%I:%M %p' , False)) }} Pickup today will be at {{(state_attr('input_datetime.kallen_school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }} + {% if is_state('input_boolean.kallen_alternate_pickup','on') %} + Today, you will be picked up from school by {{ states('input_text.kallen_pickup') }}. + {% endif %} {% if states.sensor.school_end_days2go.state | int == 0 -%} But today is the last day of School! {%- endif %}