Improve method of setting E's bedtime after a nap
This commit is contained in:
@ -93,6 +93,16 @@ automation:
|
||||
datetime: "{{ as_timestamp(now()) | timestamp_custom('%Y-%m-%d %H:%M:%S') }}"
|
||||
- delay:
|
||||
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
|
||||
target:
|
||||
entity_id: input_datetime.emma_bedtime
|
||||
|
Reference in New Issue
Block a user