Prevent alarm from rearming if disarm is less than 30 minutes away
This commit is contained in:
@ -166,6 +166,16 @@ automation:
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.kallen_school_today
|
entity_id: input_boolean.kallen_school_today
|
||||||
state: 'on'
|
state: 'on'
|
||||||
|
- condition: template
|
||||||
|
value_template: >
|
||||||
|
{% set rearm = state_attr('input_datetime.morning_alarm_rearm','timestamp') %}
|
||||||
|
{% set wake = state_attr('input_datetime.master_bedroom_wakeup','timestamp') %}
|
||||||
|
{% set diff = wake - rearm %}
|
||||||
|
{% if diff <= 1800 %}
|
||||||
|
false
|
||||||
|
{% else %}
|
||||||
|
true
|
||||||
|
{% endif %}
|
||||||
action:
|
action:
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
|
Reference in New Issue
Block a user