Can now override certain schedule parameters for manual settings

This commit is contained in:
2023-03-22 13:53:03 -04:00
parent 41f780b4e9
commit 665d5f7d83
2 changed files with 306 additions and 200 deletions

View File

@@ -11,6 +11,8 @@ input_datetime:
icon: mdi:weather-night icon: mdi:weather-night
input_boolean: input_boolean:
# Turned on when scheduling automations run, reset at midnight
# This tracks whether scheduling has already been run, to be used as conditions in automations/scripts
work_today_ran: work_today_ran:
name: Work Today Ran name: Work Today Ran
icon: mdi:clock-outline icon: mdi:clock-outline
@@ -41,6 +43,41 @@ input_boolean:
master_bedroom_scheduling_evening_ran: master_bedroom_scheduling_evening_ran:
name: Master Bedroom Scheduling Evening Ran name: Master Bedroom Scheduling Evening Ran
icon: mdi:clock-outline icon: mdi:clock-outline
# Overrides
# These will prevent certain schedules from being modified by the scripts, in case you want to set them yourself
kallen_wakeup_override:
name: Kallen Wakeup Override
icon: mdi:plus-circle-outline
kallen_bedtime_override:
name: Kallen Bedtime Override
icon: mdi:plus-circle-outline
emma_wakeup_override:
name: Emma Wakeup Override
icon: mdi:plus-circle-outline
emma_bedtime_override:
name: Emma Bedtime Override
icon: mdi:plus-circle-outline
master_bedroom_wakeup_override:
name: Master Bedroom Wakeup Override
icon: mdi:plus-circle-outline
tina_work_schedule_override:
name: Tina Work Schedule Override
icon: mdi:plus-circle-outline
house_briefing_times_override:
name: House Briefing Times Override
icon: mdi:plus-circle-outline
kallen_briefing_times_override:
name: Kallen Briefing Times Override
icon: mdi:plus-circle-outline
master_bedroom_climate_override:
name: Master Bedroom Climate Override
icon: mdi:plus-circle-outline
kallen_bedroom_climate_override:
name: Kallen Bedroom Climate Override
icon: mdi:plus-circle-outline
emma_bedroom_climate_override:
name: Emma Bedroom Climate Override
icon: mdi:plus-circle-outline
################################################ ################################################
# Current order of operations is as follows: # # Current order of operations is as follows: #
@@ -170,6 +207,11 @@ script:
{% endif %} {% endif %}
- delay: - delay:
seconds: 1 seconds: 1
- if:
- condition: state
entity_id: input_boolean.kallen_wakeup_override
state: 'off'
then:
- 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: data:
@@ -197,6 +239,11 @@ script:
{% else %} {% else %}
Common Areas Common Areas
{% endif %} {% endif %}
- if:
- condition: state
entity_id: input_boolean.kallen_briefing_times_override
state: 'off'
then:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
entity_id: input_datetime.kallen_morning_briefing entity_id: input_datetime.kallen_morning_briefing
data: data:
@@ -235,6 +282,11 @@ script:
kallen_scheduling_evening: kallen_scheduling_evening:
alias: 'Kallen Scheduling Evening' alias: 'Kallen Scheduling Evening'
sequence: sequence:
- if:
- condition: state
entity_id: input_boolean.kallen_bedtime_override
state: 'off'
then:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
entity_id: input_datetime.kallen_bedtime entity_id: input_datetime.kallen_bedtime
data: data:
@@ -246,10 +298,20 @@ script:
{% endif %} {% endif %}
- delay: - delay:
seconds: 1 seconds: 1
- if:
- condition: state
entity_id: input_boolean.kallen_briefing_times_override
state: 'off'
then:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
entity_id: input_datetime.kallen_nightly_briefing entity_id: input_datetime.kallen_nightly_briefing
data: data:
time: "{{ (state_attr('input_datetime.kallen_bedtime','timestamp') - 1200) | timestamp_custom('%H:%M', false) }}" time: "{{ (state_attr('input_datetime.kallen_bedtime','timestamp') - 1200) | timestamp_custom('%H:%M', false) }}"
- if:
- condition: state
entity_id: input_boolean.kallen_bedroom_climate_override
state: 'off'
then:
- service: input_select.select_option - service: input_select.select_option
target: target:
entity_id: input_select.scheduled_climate_mode_kallen_fan entity_id: input_select.scheduled_climate_mode_kallen_fan
@@ -287,6 +349,11 @@ script:
entity_id: input_datetime.kallen_nightly_briefing entity_id: input_datetime.kallen_nightly_briefing
data: data:
time: "{{ (state_attr('input_datetime.kallen_nightly_briefing','timestamp') + 3600) | timestamp_custom('%H:%M', false) }}" time: "{{ (state_attr('input_datetime.kallen_nightly_briefing','timestamp') + 3600) | timestamp_custom('%H:%M', false) }}"
- if:
- condition: state
entity_id: input_boolean.kallen_bedroom_climate_override
state: 'off'
then:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
target: target:
entity_id: input_datetime.kallen_fan entity_id: input_datetime.kallen_fan
@@ -308,6 +375,11 @@ script:
{% else %} {% else %}
09:00 09:00
{% endif %} {% endif %}
- if:
- condition: state
entity_id: input_boolean.house_briefing_times_override
state: 'off'
then:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
entity_id: input_datetime.morning_briefing entity_id: input_datetime.morning_briefing
data: data:
@@ -387,6 +459,11 @@ script:
house_scheduling_evening: house_scheduling_evening:
alias: 'House Scheduling Evening' alias: 'House Scheduling Evening'
sequence: sequence:
- if:
- condition: state
entity_id: input_boolean.house_briefing_times_override
state: 'off'
then:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
entity_id: input_datetime.nightly_briefing entity_id: input_datetime.nightly_briefing
data: data:
@@ -412,6 +489,11 @@ script:
master_bedroom_scheduling_morning: master_bedroom_scheduling_morning:
alias: 'Master Bedroom Scheduling Morning' alias: 'Master Bedroom Scheduling Morning'
sequence: sequence:
- if:
- condition: state
entity_id: input_boolean.master_bedroom_wakeup_override
state: 'off'
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: data:
@@ -432,6 +514,11 @@ script:
master_bedroom_scheduling_evening: master_bedroom_scheduling_evening:
alias: 'Master Bedroom Scheduling Evening' alias: 'Master Bedroom Scheduling Evening'
sequence: sequence:
- if:
- condition: state
entity_id: input_boolean.master_bedroom_climate_override
state: 'off'
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: data:
@@ -497,6 +584,11 @@ script:
emma_bedroom_scheduling_morning: emma_bedroom_scheduling_morning:
alias: 'Emma Bedroom Scheduling Morning' alias: 'Emma Bedroom Scheduling Morning'
sequence: sequence:
- if:
- condition: state
entity_id: input_boolean.emma_wakeup_override
state: 'off'
then:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
entity_id: input_datetime.emma_wakeup entity_id: input_datetime.emma_wakeup
data: data:
@@ -508,6 +600,11 @@ script:
emma_bedroom_scheduling_evening: emma_bedroom_scheduling_evening:
alias: 'Emma Bedroom Scheduling Evening' alias: 'Emma Bedroom Scheduling Evening'
sequence: sequence:
- if:
- condition: state
entity_id: input_boolean.emma_bedtime_override
state: 'off'
then:
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
entity_id: input_datetime.emma_bedtime entity_id: input_datetime.emma_bedtime
data: data:
@@ -521,6 +618,11 @@ script:
{% else %} {% else %}
23:45 23:45
{% endif %} {% endif %}
- if:
- condition: state
entity_id: input_boolean.emma_bedroom_climate_override
state: 'off'
then:
- service: input_select.select_option - service: input_select.select_option
target: target:
entity_id: input_select.scheduled_climate_mode_emma_aircon entity_id: input_select.scheduled_climate_mode_emma_aircon

View File

@@ -24,6 +24,10 @@ automation:
trigger: trigger:
- platform: time - platform: time
at: '04:00:00' at: '04:00:00'
condition:
- condition: state
entity_id: input_boolean.tina_work_schedule_override
state: 'off'
action: action:
- if: - if:
- condition: template - condition: template