Improved alarm system scheduling
This commit is contained in:
@ -144,10 +144,24 @@ automation:
|
|||||||
{% 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','off') %}
|
||||||
{{ (state_attr('input_datetime.tina_workday_start', 'timestamp') - 3600) | timestamp_custom('%H:%M', false) }}
|
{{ (state_attr('input_datetime.tina_workday_start', 'timestamp') - 3600) | timestamp_custom('%H:%M', false) }}
|
||||||
{% elif is_state('input_boolean.school_today','on') %}
|
{% elif is_state('input_boolean.school_today','on') %}
|
||||||
08:00
|
{{ (state_attr('input_datetime.school_day_start','timestamp') - 3600) | timestamp_custom('%H:%M', false) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
11:00
|
11:00
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
- service: input_datetime.set_datetime
|
||||||
|
entity_id: input_datetime.morning_alarm_rearm
|
||||||
|
data_template:
|
||||||
|
time: >
|
||||||
|
{% if 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) }}
|
||||||
|
{% 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) }}
|
||||||
|
{% elif is_state('input_boolean.work_today','on') and is_state('input_boolean.school_today','on') %}
|
||||||
|
{{ (state_attr('input_datetime.tina_workday_start','timestamp') + 1800) | timestamp_custom('%H:%M', false) }}
|
||||||
|
{% else %}
|
||||||
|
12:00
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
- if:
|
- if:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: house-evening
|
id: house-evening
|
||||||
|
@ -39,6 +39,11 @@ input_datetime:
|
|||||||
icon: mdi:shield-off
|
icon: mdi:shield-off
|
||||||
has_date: false
|
has_date: false
|
||||||
has_time: true
|
has_time: true
|
||||||
|
morning_alarm_rearm:
|
||||||
|
name: Morning Alarm Rearm
|
||||||
|
icon: mdi:shield-home
|
||||||
|
has_date: false
|
||||||
|
has_time: true
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: template
|
- platform: template
|
||||||
@ -120,10 +125,12 @@ sensor:
|
|||||||
|
|
||||||
automation:
|
automation:
|
||||||
- id: 51819f36-2407-496c-afcd-ae160d747f0a
|
- id: 51819f36-2407-496c-afcd-ae160d747f0a
|
||||||
alias: Morning Alarm Disarm
|
alias: Scheduled Alarm Disarm
|
||||||
trigger:
|
trigger:
|
||||||
- platform: time
|
- platform: time
|
||||||
at: input_datetime.morning_alarm_disarm
|
at: input_datetime.morning_alarm_disarm
|
||||||
|
- platform: time
|
||||||
|
at: input_datetime.master_bedroom_wakeup
|
||||||
condition:
|
condition:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: group.family
|
entity_id: group.family
|
||||||
@ -131,9 +138,40 @@ automation:
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.vacation_mode
|
entity_id: input_boolean.vacation_mode
|
||||||
state: 'off'
|
state: 'off'
|
||||||
|
- condition: or
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.work_today
|
||||||
|
state: 'on'
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.school_today
|
||||||
|
state: 'on'
|
||||||
action:
|
action:
|
||||||
- service: script.security_disarm
|
- service: script.security_disarm
|
||||||
|
|
||||||
|
- id: f51eb02f-3f44-4b5d-a389-762b8ca88e2a
|
||||||
|
alias: Scheduled Alarm Rearm
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
|
at: input_datetime.morning_alarm_rearm
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: group.family
|
||||||
|
state: 'home'
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.vacation_mode
|
||||||
|
state: 'off'
|
||||||
|
- condition: or
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.work_today
|
||||||
|
state: 'on'
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.school_today
|
||||||
|
state: 'on'
|
||||||
|
action:
|
||||||
|
- service: script.security_arm_home
|
||||||
|
|
||||||
script:
|
script:
|
||||||
security_arm_home:
|
security_arm_home:
|
||||||
alias: Security Arm - Home
|
alias: Security Arm - Home
|
||||||
|
Reference in New Issue
Block a user