Improve method of setting E's bedtime after a nap

This commit is contained in:
2023-04-22 21:11:06 -04:00
parent 93db9c45a1
commit 4ff38f76f6

View File

@ -93,6 +93,16 @@ automation:
datetime: "{{ as_timestamp(now()) | timestamp_custom('%Y-%m-%d %H:%M:%S') }}" datetime: "{{ as_timestamp(now()) | timestamp_custom('%Y-%m-%d %H:%M:%S') }}"
- delay: - delay:
milliseconds: 500 milliseconds: 500
- if:
- condition: template
value_template: >
{% from 'time.jinja' import ct %}
{% set ct = ct() | int %}
{% set proposed = ct + 10800 %}
{{ proposed < 82800 }}
then:
- service: script.emma_bedroom_scheduling_evening
else:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
target: target:
entity_id: input_datetime.emma_bedtime entity_id: input_datetime.emma_bedtime