Fix scheduling mixup when alternate pickup is used with later wake times

This commit is contained in:
2023-11-02 16:09:09 -04:00
parent a7c4b1373a
commit 4a09d1ee8e

View File

@ -312,13 +312,14 @@ automation:
id: cancelled
- platform: state
entity_id: input_boolean.kallen_alternate_pickup
not_from:
- unknown
- unavailable
not_to:
- unknown
- unavailable
id: alternate-pickup
from: 'off'
to: 'on'
id: alternate-pickup-on
- platform: state
entity_id: input_boolean.kallen_alternate_pickup
from: 'on'
to: 'off'
id: alternate-pickup-off
action:
- if:
- condition: trigger
@ -337,6 +338,20 @@ automation:
- input_boolean.kallen_btb
- delay:
seconds: 2
- if:
- condition: and
conditions:
- condition: trigger
id: alternate-pickup-off
- condition: template
value_template: >
{% from 'time.jinja' import ct %}
{% set ct = ct() | int %}
{% set cutoff = state_attr('input_datetime.kallen_school_day_end','timestamp') | int - 3600 %}
{{ ct >= cutoff }}
then:
- stop: After cutoff
else:
- service: script.rerun_all_scheduling_morning
script: