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
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:
name: Work Today Ran
icon: mdi:clock-outline
@ -41,6 +43,41 @@ input_boolean:
master_bedroom_scheduling_evening_ran:
name: Master Bedroom Scheduling Evening Ran
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: #
@ -170,6 +207,11 @@ script:
{% endif %}
- delay:
seconds: 1
- if:
- condition: state
entity_id: input_boolean.kallen_wakeup_override
state: 'off'
then:
- service: input_datetime.set_datetime
entity_id: input_datetime.kallen_wakeup_time
data:
@ -197,6 +239,11 @@ script:
{% else %}
Common Areas
{% endif %}
- if:
- condition: state
entity_id: input_boolean.kallen_briefing_times_override
state: 'off'
then:
- service: input_datetime.set_datetime
entity_id: input_datetime.kallen_morning_briefing
data:
@ -235,6 +282,11 @@ script:
kallen_scheduling_evening:
alias: 'Kallen Scheduling Evening'
sequence:
- if:
- condition: state
entity_id: input_boolean.kallen_bedtime_override
state: 'off'
then:
- service: input_datetime.set_datetime
entity_id: input_datetime.kallen_bedtime
data:
@ -246,10 +298,20 @@ script:
{% endif %}
- delay:
seconds: 1
- if:
- condition: state
entity_id: input_boolean.kallen_briefing_times_override
state: 'off'
then:
- service: input_datetime.set_datetime
entity_id: input_datetime.kallen_nightly_briefing
data:
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
target:
entity_id: input_select.scheduled_climate_mode_kallen_fan
@ -287,6 +349,11 @@ script:
entity_id: input_datetime.kallen_nightly_briefing
data:
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
target:
entity_id: input_datetime.kallen_fan
@ -308,6 +375,11 @@ script:
{% else %}
09:00
{% endif %}
- if:
- condition: state
entity_id: input_boolean.house_briefing_times_override
state: 'off'
then:
- service: input_datetime.set_datetime
entity_id: input_datetime.morning_briefing
data:
@ -387,6 +459,11 @@ script:
house_scheduling_evening:
alias: 'House Scheduling Evening'
sequence:
- if:
- condition: state
entity_id: input_boolean.house_briefing_times_override
state: 'off'
then:
- service: input_datetime.set_datetime
entity_id: input_datetime.nightly_briefing
data:
@ -412,6 +489,11 @@ script:
master_bedroom_scheduling_morning:
alias: 'Master Bedroom Scheduling Morning'
sequence:
- if:
- condition: state
entity_id: input_boolean.master_bedroom_wakeup_override
state: 'off'
then:
- service: input_datetime.set_datetime
entity_id: input_datetime.master_bedroom_wakeup
data:
@ -432,6 +514,11 @@ script:
master_bedroom_scheduling_evening:
alias: 'Master Bedroom Scheduling Evening'
sequence:
- if:
- condition: state
entity_id: input_boolean.master_bedroom_climate_override
state: 'off'
then:
- service: input_datetime.set_datetime
entity_id: input_datetime.master_bedroom_cooling
data:
@ -497,6 +584,11 @@ script:
emma_bedroom_scheduling_morning:
alias: 'Emma Bedroom Scheduling Morning'
sequence:
- if:
- condition: state
entity_id: input_boolean.emma_wakeup_override
state: 'off'
then:
- service: input_datetime.set_datetime
entity_id: input_datetime.emma_wakeup
data:
@ -508,6 +600,11 @@ script:
emma_bedroom_scheduling_evening:
alias: 'Emma Bedroom Scheduling Evening'
sequence:
- if:
- condition: state
entity_id: input_boolean.emma_bedtime_override
state: 'off'
then:
- service: input_datetime.set_datetime
entity_id: input_datetime.emma_bedtime
data:
@ -521,6 +618,11 @@ script:
{% else %}
23:45
{% endif %}
- if:
- condition: state
entity_id: input_boolean.emma_bedroom_climate_override
state: 'off'
then:
- service: input_select.select_option
target:
entity_id: input_select.scheduled_climate_mode_emma_aircon

View File

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