Update work today and school today automations/scripts

This commit is contained in:
2023-03-22 13:14:54 -04:00
parent 6a63faa7aa
commit 41f780b4e9
2 changed files with 24 additions and 14 deletions

View File

@ -266,14 +266,18 @@ automation:
trigger:
- platform: time
at: '04:00:10'
condition:
- condition: template
value_template: >
{%- if as_timestamp(strptime(state_attr('calendar.kallen_school_days', 'start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%Y-%m-%d") == now().strftime("%Y-%m-%d") %}
true
{%- endif -%}
action:
- if:
- condition: template
value_template: >
{%- if as_timestamp(strptime(state_attr('calendar.kallen_school_days', 'start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%Y-%m-%d") == now().strftime("%Y-%m-%d") %}
true
{%- endif -%}
then:
- service: script.kallen_school_today
- service: input_boolean.turn_on
target:
entity_id: input_boolean.school_today_ran
- id: b9028665-401c-4de3-8f13-1099160b011f
alias: Kallen School Reset

View File

@ -24,14 +24,18 @@ automation:
trigger:
- platform: time
at: '04:00:00'
condition:
- condition: template
value_template: >
{%- if as_timestamp(strptime(state_attr('calendar.family_tinawork','start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%Y-%m-%d") == now().strftime("%Y-%m-%d") %}
true
{%- endif -%}
action:
- if:
- condition: template
value_template: >
{%- if as_timestamp(strptime(state_attr('calendar.family_tinawork','start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%Y-%m-%d") == now().strftime("%Y-%m-%d") %}
true
{%- endif -%}
then:
- service: script.tina_work_today
- service: input_boolean.turn_on
target:
entity_id: input_boolean.work_today_ran
- id: a6eeb075-d21b-436c-983f-39188ee9b016
alias: Work Reset
@ -59,13 +63,15 @@ script:
time: >
{{ as_timestamp(strptime(state_attr('calendar.family_tinawork','end_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%H:%M") }}
- service: input_boolean.turn_on
entity_id: input_boolean.work_today
target:
entity_id: input_boolean.work_today
tina_work_reset:
alias: 'Tina Work Reset'
sequence:
- service: input_boolean.turn_off
entity_id: input_boolean.work_today
target:
entity_id: input_boolean.work_today
# This is in case her schedule changes after the regular 4:00AM scheduling scripts run
tina_schedule_change: