diff --git a/custom_templates/status.jinja b/custom_templates/status.jinja index 40d21a3..b6162f1 100644 --- a/custom_templates/status.jinja +++ b/custom_templates/status.jinja @@ -425,6 +425,9 @@ Tony is currently streaming. The current stream category is {{ game }}. The curr 'But there was a two hour delay. ' {% endif %} {% endif %} + {% if is_state('input_boolean.kallen_btb','on') %} + Collin has Beyond The Bells today after school. + {% endif %} {% if is_state('input_boolean.kallen_alternate_pickup','on') %} {{ states('input_text.kallen_pickup') }} will be picking Collin up from school today. {% else %} @@ -490,6 +493,9 @@ Tony is currently streaming. The current stream category is {{ game }}. The curr School is currently under a two hour delay. {% elif is_state('input_boolean.kallen_at_school','on') %} {{ identKallen }} is at school right now. + {% if is_state('input_boolean.kallen_btb','on') %} + {{ identKallen }} has Beyond The Bells after school today. + {% endif %} {% if is_state('input_boolean.kallen_alternate_pickup','on') %} {{ states('input_text.kallen_pickup') }} will be picking him up from school today. {% elif is_state('input_boolean.kallen_school_early_release','on') %} @@ -508,6 +514,9 @@ Tony is currently streaming. The current stream category is {{ game }}. The curr {% endif %} {% elif is_state ('binary_sensor.early_night_mode','on') and is_state('binary_sensor.kallen_school_tomorrow','on') %} {{ identKallen }} has school tomorrow. + {% if is_state('binary_sensor.kallen_btb_tomorrow','on') %} + {{ identKallen }} will have BTB tomorrow after school. + {% endif %} {% elif is_state('binary_sensor.after_midnight','off') %} {{ identKallen }} does not have school today. {% endif %} diff --git a/packages/scheduling.yaml b/packages/scheduling.yaml index eca1044..5ae52e5 100644 --- a/packages/scheduling.yaml +++ b/packages/scheduling.yaml @@ -407,7 +407,7 @@ script: time: > {% from 'time.jinja' import time_from_calendar %} {% if is_state('input_boolean.kallen_school_today','on') %} - {% if is_state('input_boolean.kallen_alternate_pickup','on') %} + {% if is_state('input_boolean.kallen_alternate_pickup','on') or is_state('input_boolean.kallen_btb','on') %} 15:00 {% else %} {{ time_from_calendar('calendar.kallen_school_days','end_time','set','subtract',1) }} @@ -550,7 +550,7 @@ script: data: time: > {% if is_state('input_boolean.kallen_school_today','on') %} - {% if is_state('input_boolean.kallen_alternate_pickup','on') %} + {% if is_state('input_boolean.kallen_alternate_pickup','on') or is_state('input_boolean.kallen_btb','on') %} 14:30 {% elif is_state('input_boolean.kallen_school_early_release','on') %} 12:00 diff --git a/packages/school.yaml b/packages/school.yaml index 5eadc60..bfb7a34 100644 --- a/packages/school.yaml +++ b/packages/school.yaml @@ -14,6 +14,9 @@ input_boolean: kallen_school_today_extended: name: Kallen School Today Extended icon: mdi:bus-school + kallen_btb: + name: Kallen BTB + icon: mdi:bus-clock two_hour_delay: name: Kallen Two Hour Delay icon: mdi:bus-clock @@ -85,6 +88,11 @@ template: off {% endif %} icon: mdi:school + - name: Kallen BTB Tomorrow + unique_id: 68d8eb9c-d96c-4c76-a8e8-23125f1162db + state: >- + {%- set test=(as_timestamp(now()) + (86400)) | timestamp_custom("%Y-%m-%d",true) %} + {{ states.calendar.kallen_school_days.attributes.end_time == test + " 16:30:00" }} - sensor: - name: School Start Days2go unique_id: 94a53e67-c00f-4cc7-9309-f9033a9482f9 @@ -326,6 +334,7 @@ automation: - input_boolean.kallen_at_school - input_boolean.kallen_alternate_pickup - input_boolean.kallen_school_early_release + - input_boolean.kallen_btb - delay: seconds: 2 - service: script.rerun_all_scheduling_morning @@ -365,6 +374,16 @@ script: {% else %} {{ time_from_calendar('calendar.kallen_school_days','start_time','set') }} {% endif %} + - if: + - condition: template + value_template: > + {% from 'time.jinja' import time_from_calendar %} + {% set cal = time_from_calendar('calendar.kallen_school_days','end_time','read') | trim %} + {{ cal == '4:30 PM' }} + then: + - service: input_boolean.turn_on + target: + entity_id: input_boolean.kallen_btb - service: input_boolean.turn_on entity_id: - input_boolean.kallen_school_today @@ -387,4 +406,5 @@ script: - service: input_boolean.turn_off entity_id: - input_boolean.kallen_school_today_extended - - input_boolean.kallen_school_early_release \ No newline at end of file + - input_boolean.kallen_school_early_release + - input_boolean.kallen_btb \ No newline at end of file diff --git a/templates/speech/kallen_morning_briefing.yaml b/templates/speech/kallen_morning_briefing.yaml index 6862d29..4c315f0 100644 --- a/templates/speech/kallen_morning_briefing.yaml +++ b/templates/speech/kallen_morning_briefing.yaml @@ -91,6 +91,9 @@ {% if is_state('binary_sensor.raining','on') %} It appears to be raining right now, so you might get wet on your way to school. {% endif %} + {% if is_state('input_boolean.kallen_btb','on') %} + You have Beyond The Bells today after school. + {% endif %} {% if is_state('input_boolean.kallen_alternate_pickup','on') %} Today, you will be picked up from school by {{ states('input_text.kallen_pickup') }}. {% elif is_state('input_boolean.work_today','off') %} diff --git a/templates/speech/kallen_nightly_briefing.yaml b/templates/speech/kallen_nightly_briefing.yaml index 9519312..2bb62f0 100644 --- a/templates/speech/kallen_nightly_briefing.yaml +++ b/templates/speech/kallen_nightly_briefing.yaml @@ -19,6 +19,12 @@ 'Because you have to get up early tomorrow for school.', 'Because you want to be ready for school tomorrow.' ] | random }} + {% if is_state('binary_sensor.kallen_btb_tomorrow','on') %} + {{ [ 'You have Beyond The Bells tomorrow after school. ', + 'You will be staying a little later after school tomorrow to further your learning endeavors. ', + 'Tomorrow is a BTB day. ' + ] | random }} + {% endif %} {% else %} {% set month=states("sensor.date").split('-')[1] | int %} {%- if is_state('input_boolean.school_in_session', 'off') -%} diff --git a/templates/speech/kallen_school_status.yaml b/templates/speech/kallen_school_status.yaml index ffd1c9b..97e91a6 100644 --- a/templates/speech/kallen_school_status.yaml +++ b/templates/speech/kallen_school_status.yaml @@ -23,6 +23,9 @@ {% if is_state('input_boolean.kallen_school_early_release','on') %} "There will be early dismissal today. " {% endif %} + {% if is_state('input_boolean.kallen_btb','on') %} + "You have Beyond The Bells today after school. " + {% endif %} "Your school day will end at {{ input_datetime_read('input_datetime.kallen_school_day_end') }}. " {% endif %}

diff --git a/templates/speech/welcome_home.yaml b/templates/speech/welcome_home.yaml index 9baebdc..3c2ea42 100644 --- a/templates/speech/welcome_home.yaml +++ b/templates/speech/welcome_home.yaml @@ -41,6 +41,13 @@ 'Do not forget to do your homework! ', 'You must be glad that your school day is over! ' ] | random }} + {% if is_state('input_boolean.kallen_btb','on') %} + {{ [ + 'I hope you enjoyed BTB today. ', + 'I bet you are exhausted after a couple of extra hours at school. ', + 'It is my sincere hope that your extra learning today was enjoyed to the fullest! ' + ] | random }} + {% endif %} {% elif is_state('input_boolean.school_cancelled','on') and is_state('person.kallen_stork','home') %} "I hope you are enjoying your free day off from school, Collin. " {% endif %}