Continuing to slowly implement the intentions of #53

This commit is contained in:
2023-02-01 17:40:20 -05:00
parent 74963b084d
commit ebc4b64d22
12 changed files with 96 additions and 96 deletions

View File

@ -197,7 +197,7 @@ automation:
to: 'on'
condition:
- condition: state
entity_id: input_boolean.school_today
entity_id: input_boolean.kallen_school_today
state: 'on'
- condition: state
entity_id: input_boolean.kallen_overnight

View File

@ -234,7 +234,7 @@ automation:
entity_id: input_boolean.kallen_at_school
state: "off"
- condition: state
entity_id: input_boolean.school_today
entity_id: input_boolean.kallen_school_today
state: "on"
action:
- service: input_boolean.turn_on

View File

@ -159,7 +159,7 @@ script:
alias: 'Kallen Scheduling Morning'
sequence:
- service: input_datetime.set_datetime
entity_id: input_datetime.school_day_start
entity_id: input_datetime.kallen_school_day_start
data_template:
time: >
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
@ -173,11 +173,11 @@ script:
entity_id: input_datetime.kallen_wakeup_time
data_template:
time: >
{% if is_state('input_boolean.school_today', 'on') %}
{% if is_state('input_boolean.kallen_school_today', 'on') %}
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
09:30
{% else %}
{{ (state_attr('input_datetime.school_day_start','timestamp') - 5400) | timestamp_custom('%H:%M', false) }}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') - 5400) | timestamp_custom('%H:%M', false) }}
{% endif %}
{% else %}
10:00
@ -187,7 +187,7 @@ script:
entity_id: input_select.kallen_morning_briefing_location
data_template:
option: >
{% if is_state('input_boolean.school_today','on') %}
{% if is_state('input_boolean.kallen_school_today','on') %}
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
Common Areas
{% else %}
@ -200,29 +200,29 @@ script:
entity_id: input_datetime.kallen_morning_briefing
data_template:
time: >
{% if is_state('input_boolean.school_today', 'on') %}
{% if is_state('input_boolean.kallen_school_today', 'on') %}
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
09:40
{% else %}
{{ (state_attr('input_datetime.school_day_start','timestamp') - 4800) | timestamp_custom('%H:%M', false) }}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') - 4800) | timestamp_custom('%H:%M', false) }}
{% endif %}
{% else %}
10:00
{% endif %}
- service: input_datetime.set_datetime
entity_id: input_datetime.school_day_start_reminder
entity_id: input_datetime.kallen_school_day_start_reminder
data_template:
time: >
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
10:00
{% else %}
{{ (state_attr('input_datetime.school_day_start','timestamp') - 3600) | timestamp_custom('%H:%M', false) }}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') - 3600) | timestamp_custom('%H:%M', false) }}
{% endif %}
- service: input_datetime.set_datetime
entity_id: input_datetime.school_day_end_reminder
entity_id: input_datetime.kallen_school_day_end_reminder
data_template:
time: >
{% if is_state('input_boolean.school_early_release','on') %}
{% if is_state('input_boolean.kallen_school_early_release','on') %}
13:30
{% else %}
14:00
@ -269,8 +269,8 @@ script:
entity_id: input_datetime.audible_notification_on
data_template:
time: >
{% if is_state('input_boolean.school_today','on') %}
{{ (state_attr('input_datetime.school_day_start','timestamp') - 5400) | timestamp_custom('%H:%M', false) }}
{% if is_state('input_boolean.kallen_school_today','on') %}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') - 5400) | timestamp_custom('%H:%M', false) }}
{% else %}
09:00
{% endif %}
@ -278,13 +278,13 @@ script:
entity_id: input_datetime.morning_report
data_template:
time: >
{% if is_state('input_boolean.school_today','on') %}
{% if is_state('input_boolean.kallen_school_today','on') %}
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
10:20
{% else %}
{{ (state_attr('input_datetime.school_day_start','timestamp') - 2400) | timestamp_custom('%H:%M', false) }}
{{ (state_attr('input_datetime.kallen_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') %}
{% elif is_state('input_boolean.work_today','on') and is_state('input_boolean.kallen_school_today','off') %}
{% if (state_attr('input_datetime.tina_workday_start','timestamp')) > 43200 %}
12:00
{% elif (state_attr('input_datetime.tina_workday_start','timestamp') - 1500 ) > (state_attr('input_datetime.audible_notification_on','timestamp')) %}
@ -299,13 +299,13 @@ script:
entity_id: input_datetime.daily_report
data_template:
time: >
{% if is_state('input_boolean.school_today','on') %}
{% if is_state('input_boolean.school_early_release','on') %}
{% if is_state('input_boolean.kallen_school_today','on') %}
{% if is_state('input_boolean.kallen_school_early_release','on') %}
13:15
{% else %}
14:15
{% endif %}
{% elif is_state('input_boolean.school_today','off') and is_state('input_boolean.work_today','off') %}
{% elif is_state('input_boolean.kallen_school_today','off') and is_state('input_boolean.work_today','off') %}
15:00
{% else %}
{% if (state_attr('input_datetime.tina_workday_end','timestamp')) > 61200 %}
@ -372,8 +372,8 @@ script:
entity_id: input_datetime.master_bedroom_wakeup
data_template:
time: >
{% if is_state('input_boolean.school_today','on') %}
{% if is_state('input_boolean.school_early_release','on') %}
{% if is_state('input_boolean.kallen_school_today','on') %}
{% if is_state('input_boolean.kallen_school_early_release','on') %}
12:30
{% else %}
13:30
@ -486,20 +486,20 @@ script:
data_template:
time: >
{% set ct = ((now().hour * 60 + now().minute) * 60 ) %}
{% if is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','on') %}
{% if ct > state_attr('input_datetime.school_day_start','timestamp') %}
{% if is_state('input_boolean.work_today','on') and is_state('input_boolean.kallen_school_today','on') %}
{% if ct > state_attr('input_datetime.kallen_school_day_start','timestamp') %}
{{ (state_attr('input_datetime.tina_workday_start','timestamp') - 1800) | timestamp_custom('%H:%M', false) }}
{% elif ct > state_attr('input_datetime.tina_workday_start','timestamp') and ct < state_attr('input_datetime.school_day_start','timestamp') %}
{{ (state_attr('input_datetime.school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
{% elif state_attr('input_datetime.tina_workday_start','timestamp') < (state_attr('input_datetime.school_day_start','timestamp')) %}
{% elif ct > state_attr('input_datetime.tina_workday_start','timestamp') and ct < state_attr('input_datetime.kallen_school_day_start','timestamp') %}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
{% elif state_attr('input_datetime.tina_workday_start','timestamp') < (state_attr('input_datetime.kallen_school_day_start','timestamp')) %}
{{ (state_attr('input_datetime.tina_workday_start','timestamp') - 1800) | timestamp_custom('%H:%M', false) }}
{% else %}
{{ (state_attr('input_datetime.school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
{% endif %}
{% elif is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','off') %}
{% elif is_state('input_boolean.work_today','on') and is_state('input_boolean.kallen_school_today','off') %}
{{ (state_attr('input_datetime.tina_workday_start', 'timestamp') - 1800) | timestamp_custom('%H:%M', false) }}
{% elif is_state('input_boolean.school_today','on') %}
{{ (state_attr('input_datetime.school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
{% elif is_state('input_boolean.kallen_school_today','on') %}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
{% else %}
11:00
{% endif %}
@ -508,20 +508,20 @@ script:
data_template:
time: >
{% set ct = ((now().hour * 60 + now().minute) * 60 ) %}
{% if is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','off') %}
{% if is_state('input_boolean.work_today','on') and is_state('input_boolean.kallen_school_today','off') %}
{{ (state_attr('input_datetime.tina_workday_start','timestamp') + 900) | timestamp_custom('%H:%M', false) }}
{% elif is_state('input_boolean.school_today','on') and is_state('input_boolean.work_today','off') %}
{{ (state_attr('input_datetime.school_day_start','timestamp') + 3600) | timestamp_custom('%H:%M', false) }}
{% elif is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','on') %}
{% if ct > state_attr('input_datetime.school_day_start','timestamp') %}
{% elif is_state('input_boolean.kallen_school_today','on') and is_state('input_boolean.work_today','off') %}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') + 3600) | timestamp_custom('%H:%M', false) }}
{% elif is_state('input_boolean.work_today','on') and is_state('input_boolean.kallen_school_today','on') %}
{% if ct > state_attr('input_datetime.kallen_school_day_start','timestamp') %}
{{ (state_attr('input_datetime.tina_workday_start','timestamp') + 900) | timestamp_custom('%H:%M', false) }}
{% elif ct > state_attr('input_datetime.tina_workday_start','timestamp') and ct < state_attr('input_datetime.school_day_start','timestamp') %}
{{ (state_attr('input_datetime.school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
{% elif state_attr('input_datetime.tina_workday_start','timestamp') < state_attr('input_datetime.school_day_start','timestamp') %}
{{ (state_attr('input_datetime.school_day_start','timestamp') + 1800) | timestamp_custom('%H:%M', false) }}
{% elif ct > state_attr('input_datetime.tina_workday_start','timestamp') and ct < state_attr('input_datetime.kallen_school_day_start','timestamp') %}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
{% elif state_attr('input_datetime.tina_workday_start','timestamp') < state_attr('input_datetime.kallen_school_day_start','timestamp') %}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') + 1800) | timestamp_custom('%H:%M', false) }}
{% else %}
{% if (state_attr('input_datetime.tina_workday_start','timestamp') - state_attr('input_datetime.school_day_start','timestamp')) > 5400 %}
{{ (state_attr('input_datetime.school_day_start','timestamp') + 1800) | timestamp_custom('%H:%M', false) }}
{% if (state_attr('input_datetime.tina_workday_start','timestamp') - state_attr('input_datetime.kallen_school_day_start','timestamp')) > 5400 %}
{{ (state_attr('input_datetime.kallen_school_day_start','timestamp') + 1800) | timestamp_custom('%H:%M', false) }}
{% else %}
{{ (state_attr('input_datetime.tina_workday_start','timestamp') + 900) | timestamp_custom('%H:%M', false) }}
{% endif %}

View File

@ -2,14 +2,14 @@ input_boolean:
school_in_session:
name: School In Session
icon: mdi:bus-school
school_today:
name: School Today
kallen_school_today:
name: Kallen School Today
icon: mdi:bus-school
school_early_release:
name: School Early Release
kallen_school_early_release:
name: Kallen School Early Release
icon: mdi:bus-school
school_today_extended:
name: School Today Extended
kallen_school_today_extended:
name: Kallen School Today Extended
icon: mdi:bus-school
kallen_two_hour_delay:
name: Kallen Two Hour Delay
@ -32,12 +32,12 @@ input_datetime:
has_date: true
has_time: false
icon: mdi:calendar
school_day_start:
kallen_school_day_start:
name: School Day Start
has_date: false
has_time: true
icon: mdi:clock-start
school_day_end:
kallen_school_day_end:
name: School Day End
has_date: false
has_time: true
@ -57,12 +57,12 @@ input_datetime:
has_date: true
has_time: false
icon: mdi:calendar-start
school_day_start_reminder:
kallen_school_day_start_reminder:
name: School Day Start Reminder
has_date: false
has_time: true
icon: mdi:clock-alert
school_day_end_reminder:
kallen_school_day_end_reminder:
name: School Day End Reminder
has_date: false
has_time: true
@ -245,7 +245,7 @@ automation:
initial_state: true
trigger:
- platform: time
at: input_datetime.school_day_end
at: input_datetime.kallen_school_day_end
id: day_end
- platform: time
at: 00:00
@ -321,9 +321,9 @@ automation:
target:
entity_id:
- input_boolean.kallen_two_hour_delay
- input_boolean.school_today
- input_boolean.school_early_release
- input_boolean.school_today_extended
- input_boolean.kallen_school_today
- input_boolean.kallen_school_early_release
- input_boolean.kallen_school_today_extended
- input_boolean.kallen_at_school
- input_boolean.kallen_band_practice
- delay:
@ -356,29 +356,29 @@ script:
state: "on"
then:
- service: input_boolean.turn_on
entity_id: input_boolean.school_early_release
entity_id: input_boolean.kallen_school_early_release
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.school_day_end
entity_id: input_datetime.kallen_school_day_end
data:
time: "14:30:00"
else:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.school_day_end
entity_id: input_datetime.kallen_school_day_end
data:
time: >
{{ as_timestamp(strptime(state_attr('calendar.kallen_school_days','end_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%H:%M") }}
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.school_day_start
entity_id: input_datetime.kallen_school_day_start
data:
time: >
{{ as_timestamp(strptime(state_attr('calendar.kallen_school_days','start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%H:%M") }}
- service: input_boolean.turn_on
entity_id:
- input_boolean.school_today
- input_boolean.school_today_extended
- input_boolean.kallen_school_today
- input_boolean.kallen_school_today_extended
- service: script.turn_on
entity_id: script.school_in_session
- delay:
@ -386,7 +386,7 @@ script:
- if:
- condition: template
value_template: >
{{ state_attr('input_datetime.school_day_start','timestamp') == 28800 }}
{{ state_attr('input_datetime.kallen_school_day_start','timestamp') == 28800 }}
then:
- service: input_boolean.turn_on
entity_id: input_boolean.kallen_band_practice
@ -396,7 +396,7 @@ script:
sequence:
- service: input_boolean.turn_off
entity_id:
- input_boolean.school_today
- input_boolean.kallen_school_today
- input_boolean.kallen_two_hour_delay
- input_boolean.kallen_school_cancelled
@ -405,9 +405,9 @@ script:
sequence:
- service: input_boolean.turn_off
entity_id:
- input_boolean.school_today_extended
- input_boolean.kallen_school_today_extended
- input_boolean.kallen_band_practice
- input_boolean.school_early_release
- input_boolean.kallen_school_early_release
school_in_session:
alias: 'School In Session'

View File

@ -135,7 +135,7 @@ automation:
entity_id: input_boolean.work_today
state: 'on'
- condition: state
entity_id: input_boolean.school_today
entity_id: input_boolean.kallen_school_today
state: 'on'
action:
- service: script.security_disarm
@ -164,7 +164,7 @@ automation:
entity_id: input_boolean.work_today
state: 'on'
- condition: state
entity_id: input_boolean.school_today
entity_id: input_boolean.kallen_school_today
state: 'on'
action:
- if:
@ -186,7 +186,7 @@ automation:
- thu
- fri
- condition: state
entity_id: input_boolean.school_early_release
entity_id: input_boolean.kallen_school_early_release
state: "on"
then:
- stop: School early release