Scheduling now uses scripts for more modularity, preparing for #38
This commit is contained in:
@ -61,6 +61,78 @@ automation:
|
|||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: kallen-morning
|
id: kallen-morning
|
||||||
then:
|
then:
|
||||||
|
- service: script.kallen_scheduling_morning
|
||||||
|
- if:
|
||||||
|
- condition: trigger
|
||||||
|
id: kallen-evening
|
||||||
|
then:
|
||||||
|
- service: script.kallen_scheduling_evening
|
||||||
|
|
||||||
|
- id: 1c9f7e4b-2d5a-4b95-bd80-d9aa2244a6db
|
||||||
|
alias: House Scheduling
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
|
at: '05:00:00'
|
||||||
|
id: house-morning
|
||||||
|
- platform: time
|
||||||
|
at: '16:05:00'
|
||||||
|
id: house-evening
|
||||||
|
action:
|
||||||
|
- if:
|
||||||
|
- condition: trigger
|
||||||
|
id: house-morning
|
||||||
|
then:
|
||||||
|
- service: script.house_scheduling_morning
|
||||||
|
- if:
|
||||||
|
- condition: trigger
|
||||||
|
id: house-evening
|
||||||
|
then:
|
||||||
|
- service: script.house_scheduling_evening
|
||||||
|
|
||||||
|
- id: 89470712-f94d-4c01-8215-ed15b3bc799a
|
||||||
|
alias: Master Bedroom Scheduling
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
|
at: '06:07:00'
|
||||||
|
id: mrbedroom-morning
|
||||||
|
- platform: time
|
||||||
|
at: '16:30:00'
|
||||||
|
id: mrbedroom-evening
|
||||||
|
action:
|
||||||
|
- if:
|
||||||
|
- condition: trigger
|
||||||
|
id: mrbedroom-morning
|
||||||
|
then:
|
||||||
|
- service: script.master_bedroom_scheduling_morning
|
||||||
|
- if:
|
||||||
|
- condition: trigger
|
||||||
|
id: mrbedroom-evening
|
||||||
|
then:
|
||||||
|
- service: script.master_bedroom_scheduling_evening
|
||||||
|
|
||||||
|
- id: a69d3d36-09d6-4ef3-a245-c564c7cb577c
|
||||||
|
alias: Nursery Scheduling
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
|
at: '06:06:00'
|
||||||
|
action:
|
||||||
|
- service: input_datetime.set_datetime
|
||||||
|
entity_id: input_datetime.nursery_cooling
|
||||||
|
data_template:
|
||||||
|
time: >
|
||||||
|
{% set high = state_attr('sensor.current_forecast','high_temp') | float %}
|
||||||
|
{% set low = state_attr('sensor.current_forecast','overnight_low') | float %}
|
||||||
|
{% if high >= 85 %}
|
||||||
|
20:30
|
||||||
|
{% elif high >= 80 or low >= 60 %}
|
||||||
|
21:30
|
||||||
|
{% else %}
|
||||||
|
22:30
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
script:
|
||||||
|
kallen_scheduling_morning:
|
||||||
|
sequence:
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
entity_id: input_datetime.kallen_wakeup_time
|
entity_id: input_datetime.kallen_wakeup_time
|
||||||
data_template:
|
data_template:
|
||||||
@ -89,10 +161,9 @@ automation:
|
|||||||
{% else %}
|
{% else %}
|
||||||
Common Areas
|
Common Areas
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- if:
|
|
||||||
- condition: trigger
|
kallen_scheduling_evening:
|
||||||
id: kallen-evening
|
sequence:
|
||||||
then:
|
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
entity_id: input_datetime.kallen_bedtime
|
entity_id: input_datetime.kallen_bedtime
|
||||||
data_template:
|
data_template:
|
||||||
@ -112,20 +183,8 @@ automation:
|
|||||||
21:40
|
21:40
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- id: 1c9f7e4b-2d5a-4b95-bd80-d9aa2244a6db
|
house_scheduling_morning:
|
||||||
alias: House Scheduling
|
sequence:
|
||||||
trigger:
|
|
||||||
- platform: time
|
|
||||||
at: '05:00:00'
|
|
||||||
id: house-morning
|
|
||||||
- platform: time
|
|
||||||
at: '16:05:00'
|
|
||||||
id: house-evening
|
|
||||||
action:
|
|
||||||
- if:
|
|
||||||
- condition: trigger
|
|
||||||
id: house-morning
|
|
||||||
then:
|
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
entity_id: input_datetime.audible_notification_on
|
entity_id: input_datetime.audible_notification_on
|
||||||
data_template:
|
data_template:
|
||||||
@ -202,10 +261,8 @@ automation:
|
|||||||
12:00
|
12:00
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- if:
|
house_scheduling_evening:
|
||||||
- condition: trigger
|
sequence:
|
||||||
id: house-evening
|
|
||||||
then:
|
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
entity_id: input_datetime.audible_notification_off
|
entity_id: input_datetime.audible_notification_off
|
||||||
data_template:
|
data_template:
|
||||||
@ -216,20 +273,8 @@ automation:
|
|||||||
23:00
|
23:00
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- id: 89470712-f94d-4c01-8215-ed15b3bc799a
|
master_bedroom_scheduling_morning:
|
||||||
alias: Master Bedroom Scheduling
|
sequence:
|
||||||
trigger:
|
|
||||||
- platform: time
|
|
||||||
at: '06:07:00'
|
|
||||||
id: mrbedroom-morning
|
|
||||||
- platform: time
|
|
||||||
at: '16:30:00'
|
|
||||||
id: mrbedroom-evening
|
|
||||||
action:
|
|
||||||
- if:
|
|
||||||
- condition: trigger
|
|
||||||
id: mrbedroom-morning
|
|
||||||
then:
|
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
entity_id: input_datetime.master_bedroom_wakeup
|
entity_id: input_datetime.master_bedroom_wakeup
|
||||||
data_template:
|
data_template:
|
||||||
@ -239,10 +284,9 @@ automation:
|
|||||||
{% else %}
|
{% else %}
|
||||||
13:00
|
13:00
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- if:
|
|
||||||
- condition: trigger
|
master_bedroom_scheduling_evening:
|
||||||
id: mrbedroom-evening
|
sequence:
|
||||||
then:
|
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
entity_id: input_datetime.master_bedroom_cooling
|
entity_id: input_datetime.master_bedroom_cooling
|
||||||
data_template:
|
data_template:
|
||||||
@ -270,23 +314,3 @@ automation:
|
|||||||
{% else %}
|
{% else %}
|
||||||
00:00
|
00:00
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- id: a69d3d36-09d6-4ef3-a245-c564c7cb577c
|
|
||||||
alias: Nursery Scheduling
|
|
||||||
trigger:
|
|
||||||
- platform: time
|
|
||||||
at: '06:06:00'
|
|
||||||
action:
|
|
||||||
- service: input_datetime.set_datetime
|
|
||||||
entity_id: input_datetime.nursery_cooling
|
|
||||||
data_template:
|
|
||||||
time: >
|
|
||||||
{% set high = state_attr('sensor.current_forecast','high_temp') | float %}
|
|
||||||
{% set low = state_attr('sensor.current_forecast','overnight_low') | float %}
|
|
||||||
{% if high >= 85 %}
|
|
||||||
20:30
|
|
||||||
{% elif high >= 80 or low >= 60 %}
|
|
||||||
21:30
|
|
||||||
{% else %}
|
|
||||||
22:30
|
|
||||||
{% endif %}
|
|
Reference in New Issue
Block a user