Scheduling changes to account for K's morning band practices #45

This commit is contained in:
2022-09-26 15:06:55 -04:00
parent 62f4fa7dbf
commit bea0809a89
2 changed files with 46 additions and 36 deletions

View File

@ -121,6 +121,17 @@ automation:
script:
kallen_scheduling_morning:
sequence:
- service: input_datetime.set_datetime
entity_id: input_datetime.school_day_start
data_template:
time: >
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
11:00
{% else %}
{{ as_timestamp(strptime(state_attr('calendar.kallen_school_days','start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%H:%M") }}
{% endif %}
- delay:
seconds: 1
- service: input_datetime.set_datetime
entity_id: input_datetime.kallen_wakeup_time
data_template:
@ -129,20 +140,11 @@ script:
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
09:30
{% else %}
07:30
{{ (state_attr('input_datetime.school_day_start','timestamp') - 5400) | timestamp_custom('%H:%M', false) }}
{% endif %}
{% else %}
10:00
{% endif %}
- service: input_datetime.set_datetime
entity_id: input_datetime.school_day_start
data_template:
time: >
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
11:00
{% else %}
09:00
{% endif %}
- service: input_select.select_option
target:
entity_id: input_select.kallen_morning_briefing_location
@ -165,7 +167,7 @@ script:
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
09:40
{% else %}
07:40
{{ (state_attr('input_datetime.school_day_start','timestamp') - 4800) | timestamp_custom('%H:%M', false) }}
{% endif %}
{% else %}
10:00
@ -177,7 +179,7 @@ script:
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
10:00
{% else %}
08:00
{{ (state_attr('input_datetime.school_day_start','timestamp') - 3600) | timestamp_custom('%H:%M', false) }}
{% endif %}
- service: input_datetime.set_datetime
entity_id: input_datetime.school_day_end_reminder
@ -229,7 +231,7 @@ script:
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
10:20
{% else %}
08:20
{{ (state_attr('input_datetime.school_day_start','timestamp') - 2400) | timestamp_custom('%H:%M', false) }}
{% endif %}
{% elif is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','off') %}
{% if (state_attr('input_datetime.tina_workday_start','timestamp')) > 43200 %}