Necessary changes to support master bedroom air conditioner

This commit is contained in:
2022-05-11 16:02:36 -04:00
parent da2d974e0a
commit db9e1a671c
3 changed files with 76 additions and 33 deletions

View File

@ -468,7 +468,7 @@
mode: restart
- id: '1652215901673'
alias: Master Bedroom Nighttime Protocol
description: ''
description: Management of the fan and air conditioner in the master bedroom
trigger:
- platform: time
at: input_datetime.master_bedroom_cooling
@ -476,7 +476,13 @@
- platform: time
at: input_datetime.master_bedroom_wakeup
id: master-bedroom-wakeup
condition: []
- platform: time
at: input_datetime.master_bedroom_fan
id: master-bedroom-fan
condition:
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
action:
- choose:
- conditions:
@ -487,41 +493,68 @@
- condition: numeric_state
entity_id: sensor.current_forecast
attribute: overnight_low
above: '40'
above: '50'
then:
- service: fan.turn_on
- service: switch.turn_on
data: {}
target:
entity_id: fan.master_bedroom_fan_socket_1
entity_id: switch.master_bedroom_aircon
- parallel:
- service: script.text_notify_tony
data:
title: Fan Schedule Activated
message: Master bedroom fan has been activated, as scheduled based on
tonight's forecast low
title: AC Schedule Activated
message: '"Master bedroom AC has been activated, as scheduled based
on tonight''s forecast low"'
- service: script.text_notify_tina
data:
title: Fan Schedule Activated
message: Master bedroom fan has been activated, as scheduled based on
tonight's forecast low
title: AC Schedule Activated
message: '"Master bedroom AC has been activated, as scheduled based
on tonight''s forecast low"'
else:
- parallel:
- service: script.text_notify_tony
data:
title: Fan Schedule Skipped
message: Too cold outside, fan not activated
title: AC Schedule Skipped
message: Too cold outside, AC not activated
- service: script.text_notify_tina
data:
title: Fan Schedule Skipped
message: Too cold outside, fan not activated
title: AC Schedule Skipped
message: Too cold outside, AC not activated
- conditions:
- condition: trigger
id: master-bedroom-fan
sequence:
- if:
- condition: numeric_state
entity_id: sensor.current_forecast
attribute: overnight_low
above: '40'
then:
- service: switch.turn_on
data: {}
target:
entity_id: switch.master_bedroom_fan_socket_1
- parallel:
- service: script.text_notify_tony
data:
title: Fan Schedule Activated
message: '"Master bedroom fan has been activated, as scheduled based
on tonight''s forecast low"'
- service: script.text_notify_tina
data:
title: Fan Schedule Activated
message: '"Master bedroom fan has been activated, as scheduled based
on tonight''s forecast low"'
- conditions:
- condition: trigger
id: master-bedroom-wakeup
sequence:
- service: fan.turn_off
- service: switch.turn_off
data: {}
target:
entity_id: fan.master_bedroom_fan_socket_1
entity_id:
- switch.master_bedroom_fan_socket_1
- switch.master_bedroom_aircon
default:
- service: script.text_notify_tony
data:
@ -529,12 +562,4 @@
message: '"Today''s wakeup time is set to {{ states(''input_datetime.master_bedroom_wakeup'')
}} and tonight''s cooling is set to start at {{ states(''input_datetime.master_bedroom_cooling'')
}}"'
- if:
- condition: trigger
id: master-bedroom-wakeup
then:
- service: fan.turn_off
data: {}
target:
entity_id: fan.master_bedroom_fan_socket_1
mode: single
mode: queued

View File

@ -33,6 +33,11 @@ master_bedroom_cooling:
has_date: false
has_time: true
icon: mdi:fan-auto
master_bedroom_fan:
name: Master Bedroom Fan
has_date: false
has_time: true
icon: mdi:fan-auto
master_bedroom_wakeup:
name: Master Bedroom Wakeup
has_date: false

View File

@ -113,12 +113,25 @@ automation:
data_template:
time: >
{% set low = state_attr('sensor.current_forecast','overnight_low') | float %}
{% if low > 55 and low < 60 %}
{% set high = state_attr('sensor.current_forecast','high_temp') | float %}
{% if high > 85 and is_state('sensor.school_tomorrow','on') %}
20:00
{% elif high > 85 and is_state('sensor.school_tomorrow','off') %}
21:00
{% elif low > 55 and low < 60 %}
22:00
{% elif low > 60 %}
21:00
{% elif low > 48 and low < 55 %}
00:00
21:30
{% else %}
05:00
00:00
{% endif %}
- service: input_datetime.set_datetime
entity_id: input_datetime.master_bedroom_fan
data_template:
time: >
{% set low = state_attr('sensor.current_forecast','overnight_low') | float %}
{% if low > 60 %}
22:00
{% else %}
00:00
{% endif %}