various tidyups and esphome adds
This commit is contained in:
@@ -0,0 +1,218 @@
|
||||
##########################################################################################
|
||||
# heat_pump_master_bedroom_schedules.yaml
|
||||
##########################################################################################
|
||||
|
||||
##########################################################################################
|
||||
# HELPERS
|
||||
##########################################################################################
|
||||
|
||||
input_boolean:
|
||||
master_bedroom_night_power_mode:
|
||||
name: Night Power Mode
|
||||
icon: mdi:weather-night
|
||||
|
||||
master_bedroom_9pm_on:
|
||||
name: 9pm On
|
||||
icon: mdi:clock-start
|
||||
|
||||
master_bedroom_midnight_off:
|
||||
name: Midnight Off
|
||||
icon: mdi:clock-end
|
||||
|
||||
master_bedroom_boost_restore_off:
|
||||
name: Master Bedroom Boost Restore Off
|
||||
icon: mdi:power
|
||||
|
||||
##########################################################################################
|
||||
# TIMERS
|
||||
##########################################################################################
|
||||
|
||||
timer:
|
||||
master_bedroom_boost_timer:
|
||||
name: Master Bedroom Boost Timer
|
||||
duration: "00:00:00"
|
||||
|
||||
##########################################################################################
|
||||
# SCRIPTS
|
||||
##########################################################################################
|
||||
|
||||
script:
|
||||
master_bedroom_boost_1hr:
|
||||
alias: Master Bedroom Boost 1hr
|
||||
mode: restart
|
||||
sequence:
|
||||
# Remember if the heat pump was OFF when boost started
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.master_bedroom_boost_restore_off
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: climate.master_bedroom
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.master_bedroom_boost_restore_off
|
||||
|
||||
# Start boost (this will turn it on if it was off)
|
||||
- service: climate.turn_on
|
||||
target:
|
||||
entity_id: climate.master_bedroom
|
||||
|
||||
- service: climate.set_preset_mode
|
||||
target:
|
||||
entity_id: climate.master_bedroom
|
||||
data:
|
||||
preset_mode: "boost"
|
||||
|
||||
- service: timer.start
|
||||
target:
|
||||
entity_id: timer.master_bedroom_boost_timer
|
||||
data:
|
||||
duration: "01:00:00"
|
||||
|
||||
##########################################################################################
|
||||
# AUTOMATIONS
|
||||
##########################################################################################
|
||||
|
||||
automation:
|
||||
##########################################################################################
|
||||
# CANCEL LOGIC
|
||||
##########################################################################################
|
||||
|
||||
- alias: MB Cancel Others When Night Power Enabled
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.master_bedroom_night_power_mode
|
||||
to: "on"
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id:
|
||||
- input_boolean.master_bedroom_9pm_on
|
||||
- input_boolean.master_bedroom_midnight_off
|
||||
|
||||
- alias: MB Cancel Night Power If 9pm On Enabled
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.master_bedroom_9pm_on
|
||||
to: "on"
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.master_bedroom_night_power_mode
|
||||
|
||||
- alias: MB Cancel Night Power If Midnight Off Enabled
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.master_bedroom_midnight_off
|
||||
to: "on"
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.master_bedroom_night_power_mode
|
||||
|
||||
##########################################################################################
|
||||
# 9PM LOGIC
|
||||
##########################################################################################
|
||||
|
||||
- alias: MB 9PM Start Logic
|
||||
trigger:
|
||||
- platform: time
|
||||
at: "21:00:00"
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_night_power_mode
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: climate.turn_on
|
||||
target:
|
||||
entity_id: climate.master_bedroom
|
||||
|
||||
- service: climate.set_preset_mode
|
||||
target:
|
||||
entity_id: climate.master_bedroom
|
||||
data:
|
||||
preset_mode: "boost"
|
||||
|
||||
- service: timer.start
|
||||
target:
|
||||
entity_id: timer.master_bedroom_boost_timer
|
||||
data:
|
||||
duration: "00:30:00"
|
||||
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_9pm_on
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: climate.turn_on
|
||||
target:
|
||||
entity_id: climate.master_bedroom
|
||||
|
||||
##########################################################################################
|
||||
# MIDNIGHT LOGIC
|
||||
##########################################################################################
|
||||
|
||||
- alias: MB Midnight Off Logic
|
||||
trigger:
|
||||
- platform: time
|
||||
at: "00:00:00"
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_midnight_off
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_night_power_mode
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: climate.turn_off
|
||||
target:
|
||||
entity_id: climate.master_bedroom
|
||||
|
||||
##########################################################################################
|
||||
# BOOST TIMER FINISHED
|
||||
##########################################################################################
|
||||
|
||||
- alias: MB Boost Timer Finished
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: timer.finished
|
||||
event_data:
|
||||
entity_id: timer.master_bedroom_boost_timer
|
||||
action:
|
||||
- choose:
|
||||
# If boost started while the heat pump was OFF, ensure it ends OFF
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_boost_restore_off
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: climate.turn_off
|
||||
target:
|
||||
entity_id: climate.master_bedroom
|
||||
|
||||
# Otherwise, revert to Normal (preset_mode none) and keep running
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_boost_restore_off
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: climate.set_preset_mode
|
||||
target:
|
||||
entity_id: climate.master_bedroom
|
||||
data:
|
||||
preset_mode: "none"
|
||||
|
||||
# Always clear the helper
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.master_bedroom_boost_restore_off
|
||||
Reference in New Issue
Block a user