Adjustments for K having summer BTB
This commit is contained in:
@ -519,7 +519,9 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
{% set identKallen = 'He' %}
|
{% set identKallen = 'He' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if is_state('input_boolean.school_in_session','on') %}
|
{% if is_state('input_boolean.school_in_session','off') and is_state('input_boolean.kallen_btb','on') %}
|
||||||
|
{{ identKallen }} has Beyond The Bells today. It is scheduled to end at {{ input_datetime_read('input_datetime.kallen_school_day_end') | trim }}.
|
||||||
|
{% elif is_state('input_boolean.school_in_session','on') %}
|
||||||
{% if is_state('input_boolean.kallen_school_today','on') %}
|
{% if is_state('input_boolean.kallen_school_today','on') %}
|
||||||
{% if is_state('input_boolean.two_hour_delay','on') %}
|
{% if is_state('input_boolean.two_hour_delay','on') %}
|
||||||
School is currently under a two hour delay.
|
School is currently under a two hour delay.
|
||||||
|
@ -155,7 +155,7 @@ script:
|
|||||||
sequence:
|
sequence:
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.school_in_session
|
entity_id: input_boolean.kallen_school_today
|
||||||
state: 'on'
|
state: 'on'
|
||||||
then:
|
then:
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
@ -269,12 +269,18 @@ script:
|
|||||||
entity_id: input_datetime.kallen_bedtime
|
entity_id: input_datetime.kallen_bedtime
|
||||||
data:
|
data:
|
||||||
time: >
|
time: >
|
||||||
{% if is_state('binary_sensor.kallen_school_tomorrow', 'on') %}
|
{% if is_state('input_boolean.school_in_session','on') %}
|
||||||
21:00
|
{% if is_state('binary_sensor.kallen_school_tomorrow', 'on') %}
|
||||||
{% elif is_state('input_boolean.school_in_session','on') %}
|
21:00
|
||||||
22:00
|
{% else %}
|
||||||
|
22:00
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
23:00
|
{% if is_state('binary_sensor.kallen_btb_tomorrow','on') %}
|
||||||
|
22:00
|
||||||
|
{% else %}
|
||||||
|
23:00
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- delay:
|
- delay:
|
||||||
seconds: 1
|
seconds: 1
|
||||||
|
@ -92,7 +92,11 @@ template:
|
|||||||
unique_id: 68d8eb9c-d96c-4c76-a8e8-23125f1162db
|
unique_id: 68d8eb9c-d96c-4c76-a8e8-23125f1162db
|
||||||
state: >-
|
state: >-
|
||||||
{%- set test=(as_timestamp(now()) + (86400)) | timestamp_custom("%Y-%m-%d",true) %}
|
{%- set test=(as_timestamp(now()) + (86400)) | timestamp_custom("%Y-%m-%d",true) %}
|
||||||
{{ states.calendar.kallen_school_days.attributes.end_time == test + " 16:30:00" }}
|
{% if is_state('input_boolean.school_in_session','on') %}
|
||||||
|
{{ states.calendar.kallen_school_days.attributes.end_time == test + " 16:30:00" }}
|
||||||
|
{% else %}
|
||||||
|
{{ states.calendar.kallen_school_days.attributes.start_time == test + " 08:00:00" }}
|
||||||
|
{% endif %}
|
||||||
- sensor:
|
- sensor:
|
||||||
- name: School Start Days2go
|
- name: School Start Days2go
|
||||||
unique_id: 94a53e67-c00f-4cc7-9309-f9033a9482f9
|
unique_id: 94a53e67-c00f-4cc7-9309-f9033a9482f9
|
||||||
@ -394,7 +398,9 @@ script:
|
|||||||
value_template: >
|
value_template: >
|
||||||
{% from 'time.jinja' import time_from_calendar %}
|
{% from 'time.jinja' import time_from_calendar %}
|
||||||
{% set cal = time_from_calendar('calendar.kallen_school_days','end_time','read') | trim %}
|
{% set cal = time_from_calendar('calendar.kallen_school_days','end_time','read') | trim %}
|
||||||
{{ cal == '4:30 PM' }}
|
{% set current = as_timestamp(now()) %}
|
||||||
|
{% set lastday = state_attr('input_datetime.school_last_day','timestamp') %}
|
||||||
|
{{ (current > lastday) or (current <= lastday and cal == '4:30 PM') }}
|
||||||
then:
|
then:
|
||||||
- service: input_boolean.turn_on
|
- service: input_boolean.turn_on
|
||||||
target:
|
target:
|
||||||
@ -403,7 +409,17 @@ script:
|
|||||||
entity_id:
|
entity_id:
|
||||||
- input_boolean.kallen_school_today
|
- input_boolean.kallen_school_today
|
||||||
- input_boolean.kallen_school_today_extended
|
- input_boolean.kallen_school_today_extended
|
||||||
- input_boolean.school_in_session
|
- if:
|
||||||
|
- condition: template
|
||||||
|
value_template: >
|
||||||
|
{% set current = as_timestamp(now()) %}
|
||||||
|
{% set firstday = state_attr('input_datetime.school_first_day','timestamp') %}
|
||||||
|
{% set lastday = state_attr('input_datetime.school_last_day','timestamp') %}
|
||||||
|
{{ firstday <= current <= lastday }}
|
||||||
|
then:
|
||||||
|
- service: input_boolean.turn_on
|
||||||
|
target:
|
||||||
|
entity_id: input_boolean.school_in_session
|
||||||
|
|
||||||
kallen_school_reset:
|
kallen_school_reset:
|
||||||
alias: 'Kallen School Reset'
|
alias: 'Kallen School Reset'
|
||||||
|
@ -54,7 +54,9 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{% if is_state('input_boolean.school_in_session','on') %}
|
{% if is_state('input_boolean.school_in_session','off') and is_state('input_boolean.kallen_btb','on') %}
|
||||||
|
You have Beyond The Bells today. It is scheduled to end at {{ input_datetime_read('input_datetime.kallen_school_day_end') | trim }}.
|
||||||
|
{% elif is_state('input_boolean.school_in_session','on') %}
|
||||||
{% if is_state('input_boolean.kallen_school_today', 'on') %}
|
{% if is_state('input_boolean.kallen_school_today', 'on') %}
|
||||||
{% if count_the_days('input_datetime.school_first_day') | int == 0 %}
|
{% if count_the_days('input_datetime.school_first_day') | int == 0 %}
|
||||||
Today is the first day of school!
|
Today is the first day of school!
|
||||||
|
@ -20,10 +20,14 @@
|
|||||||
'Because you want to be ready for school tomorrow.'
|
'Because you want to be ready for school tomorrow.'
|
||||||
] | random }}
|
] | random }}
|
||||||
{% if is_state('binary_sensor.kallen_btb_tomorrow','on') %}
|
{% if is_state('binary_sensor.kallen_btb_tomorrow','on') %}
|
||||||
{{ [ 'You have Beyond The Bells tomorrow after school. ',
|
{% if is_state('input_boolean.school_in_session','on') %}
|
||||||
'You will be staying a little later after school tomorrow to further your learning endeavors. ',
|
{{ [ 'You have Beyond The Bells tomorrow after school. ',
|
||||||
'Tomorrow is a BTB day. '
|
'You will be staying a little later after school tomorrow to further your learning endeavors. ',
|
||||||
] | random }}
|
'Tomorrow is a BTB day. '
|
||||||
|
] | random }}
|
||||||
|
{% else %}
|
||||||
|
'You have a summer session of Beyond The Bells tomorrow. '
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set month=states("sensor.date").split('-')[1] | int %}
|
{% set month=states("sensor.date").split('-')[1] | int %}
|
||||||
|
Reference in New Issue
Block a user