Fix security automation, close #12
This commit is contained in:
@ -159,7 +159,13 @@ automation:
|
|||||||
entity_id: input_datetime.morning_alarm_disarm
|
entity_id: input_datetime.morning_alarm_disarm
|
||||||
data_template:
|
data_template:
|
||||||
time: >
|
time: >
|
||||||
{% if is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','off') %}
|
{% if is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','on') %}
|
||||||
|
{% if state_attr('input_datetime.tina_workday_start','timestamp') < (state_attr('input_datetime.school_day_start','timestamp')) %}
|
||||||
|
{{ (state_attr('input_datetime.tina_workday_start','timestamp') - 1800) | timestamp_custom('%H:%M', false) }}
|
||||||
|
{% else %}
|
||||||
|
{{ (state_attr('input_datetime.school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
|
||||||
|
{% endif %}
|
||||||
|
{% elif is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','off') %}
|
||||||
{{ (state_attr('input_datetime.tina_workday_start', 'timestamp') - 1800) | timestamp_custom('%H:%M', false) }}
|
{{ (state_attr('input_datetime.tina_workday_start', 'timestamp') - 1800) | timestamp_custom('%H:%M', false) }}
|
||||||
{% elif is_state('input_boolean.school_today','on') %}
|
{% elif is_state('input_boolean.school_today','on') %}
|
||||||
{{ (state_attr('input_datetime.school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
|
{{ (state_attr('input_datetime.school_day_start','timestamp') - 2700) | timestamp_custom('%H:%M', false) }}
|
||||||
@ -175,7 +181,11 @@ automation:
|
|||||||
{% elif is_state('input_boolean.school_today','on') and is_state('input_boolean.work_today','off') %}
|
{% elif is_state('input_boolean.school_today','on') and is_state('input_boolean.work_today','off') %}
|
||||||
{{ (state_attr('input_datetime.school_day_start','timestamp') + 3600) | timestamp_custom('%H:%M', false) }}
|
{{ (state_attr('input_datetime.school_day_start','timestamp') + 3600) | timestamp_custom('%H:%M', false) }}
|
||||||
{% elif is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','on') %}
|
{% elif is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','on') %}
|
||||||
{{ (state_attr('input_datetime.tina_workday_start','timestamp') + 900) | timestamp_custom('%H:%M', false) }}
|
{% if state_attr('input_datetime.tina_workday_start','timestamp') < state_attr('input_datetime.school_day_start','timestamp') %}
|
||||||
|
{{ (state_attr('input_datetime.school_day_start','timestamp') + 1800) | timestamp_custom('%H:%M', false) }}
|
||||||
|
{% else %}
|
||||||
|
{{ (state_attr('input_datetime.tina_workday_start','timestamp') + 900) | timestamp_custom('%H:%M', false) }}
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
12:00
|
12:00
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -232,9 +242,9 @@ automation:
|
|||||||
{% elif high > 85 and is_state('sensor.school_tomorrow','off') %}
|
{% elif high > 85 and is_state('sensor.school_tomorrow','off') %}
|
||||||
21:00
|
21:00
|
||||||
{% elif low > 55 and low < 60 %}
|
{% elif low > 55 and low < 60 %}
|
||||||
22:00
|
22:30
|
||||||
{% elif low > 60 %}
|
{% elif low > 60 %}
|
||||||
21:30
|
21:45
|
||||||
{% else %}
|
{% else %}
|
||||||
00:00
|
00:00
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -244,7 +254,7 @@ automation:
|
|||||||
time: >
|
time: >
|
||||||
{% set low = state_attr('sensor.current_forecast','overnight_low') | float %}
|
{% set low = state_attr('sensor.current_forecast','overnight_low') | float %}
|
||||||
{% if low > 60 %}
|
{% if low > 60 %}
|
||||||
22:00
|
22:30
|
||||||
{% else %}
|
{% else %}
|
||||||
00:00
|
00:00
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user