2025-07-22 12:00:39 -04:00
######################################################################
## AC related automations
## For more info visit https://www.vcloudinfo.com/click-here
## Contact: @CCOSTAN
######################################################################
2025-07-12 17:44:42 -04:00
2025-05-28 17:08:23 -04:00
input_datetime :
downstairs_last_filter_change :
2025-05-28 17:51:13 -04:00
name : Downstairs Last Filter Change
2025-05-28 17:08:23 -04:00
has_date : true
has_time : true
upstairs_last_filter_change :
2025-05-28 17:51:13 -04:00
name : Upstairs Last Filter Change
2025-05-28 17:08:23 -04:00
has_date : true
has_time : true
2025-07-12 17:44:42 -04:00
# ---------------------------------------------------------------------------
# Binary sensors – true when the thermostat reports the compressor is running
# ---------------------------------------------------------------------------
2025-05-29 13:12:16 -04:00
binary_sensor :
- platform : template
sensors :
downstairs_ac_cooling :
friendly_name : "Downstairs AC is Cooling"
value_template : >
{{ state_attr('climate.downstairs', 'hvac_action') == 'cooling' }}
upstairs_ac_cooling :
friendly_name : "Upstairs AC is Cooling"
value_template : >
{{ state_attr('climate.upstairs', 'hvac_action') == 'cooling' }}
2025-05-28 17:08:23 -04:00
sensor :
2025-07-12 17:44:42 -04:00
- platform : template
sensors :
downstairs_ac_cooling_numeric :
friendly_name : "Downstairs AC Cooling Numeric"
value_template : "{{ 1 if is_state('binary_sensor.downstairs_ac_cooling', 'on') else 0 }}"
upstairs_ac_cooling_numeric :
friendly_name : "Upstairs AC Cooling Numeric "
value_template : "{{ 1 if is_state('binary_sensor.upstairs_ac_cooling', 'on') else 0 }}"
- platform : integration
name : Downstairs AC Runtime Raw
source : sensor.downstairs_ac_cooling_numeric
unit_time : h
method : left
round : 2
- platform : integration
name : Upstairs AC Runtime Raw
source : sensor.upstairs_ac_cooling_numeric
unit_time : h
method : left
round : 2
2025-05-28 17:08:23 -04:00
2025-07-12 17:44:42 -04:00
# ---------------------------------------------------------------------------
# Utility‑ meters that act like odometers (reset when you swap the filter)
# ---------------------------------------------------------------------------
utility_meter :
downstairs_ac_runtime_since_last_filter_change :
source : sensor.downstairs_ac_runtime_raw
upstairs_ac_runtime_since_last_filter_change :
source : sensor.upstairs_ac_runtime_raw
2025-07-13 12:18:25 -04:00
2025-07-13 12:23:49 -04:00
script :
2025-07-12 17:44:42 -04:00
reset_downstairs_filter :
alias : Reset Downstairs Filter
mode : queued
2025-05-28 17:08:23 -04:00
sequence :
- service : input_datetime.set_datetime
data :
entity_id : input_datetime.downstairs_last_filter_change
datetime : "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
2025-07-12 17:44:42 -04:00
- service : utility_meter.reset
target :
2025-07-13 12:18:25 -04:00
entity_id : sensor.downstairs_ac_runtime_since_last_filter_change
2025-07-12 17:44:42 -04:00
reset_upstairs_filter :
alias : Reset Upstairs Filter
mode : queued
sequence :
- service : input_datetime.set_datetime
data :
entity_id : input_datetime.upstairs_last_filter_change
datetime : "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- service : utility_meter.reset
target :
2025-07-13 12:18:25 -04:00
entity_id : sensor.upstairs_ac_runtime_since_last_filter_change
2025-05-28 17:08:23 -04:00
automation :
- alias : Notify Downstairs Filter Change Due
2025-07-12 17:44:42 -04:00
description : Notify when downstairs runtime exceeds threshold since last filter change
2025-05-28 17:08:23 -04:00
trigger :
- platform : numeric_state
entity_id : sensor.downstairs_ac_runtime_since_last_filter_change
2025-07-12 17:44:42 -04:00
above : 800 # hours
2025-05-28 17:08:23 -04:00
action :
2025-07-12 17:44:42 -04:00
- service : script.notify_engine # <-- keep your existing notify helper
2025-05-28 17:08:23 -04:00
data :
title : "Home Maintenance Reminder"
value1 : "It's time to change your Downstairs AC filter."
2025-07-12 17:44:42 -04:00
value2 : >
Runtime has exceeded 800 h. Last changed {{ ((now() - states.input_datetime.downstairs_last_filter_change.last_changed).total_seconds() / 86400) | round(0) }} days ago.
2025-05-28 17:08:23 -04:00
who : "Carlo"
group : "maintenance"
level : "active"
- alias : Notify Upstairs Filter Change Due
2025-07-12 17:44:42 -04:00
description : Notify when upstairs runtime exceeds threshold since last filter change
2025-05-28 17:08:23 -04:00
trigger :
- platform : numeric_state
entity_id : sensor.upstairs_ac_runtime_since_last_filter_change
2025-07-12 17:44:42 -04:00
above : 450 # hours
2025-05-28 17:08:23 -04:00
action :
- service : script.notify_engine
data :
title : "Home Maintenance Reminder"
value1 : "It's time to change your Upstairs AC filter."
2025-07-12 17:44:42 -04:00
value2 : >
Runtime has exceeded 450 h. Last changed {{ ((now() - states.input_datetime.upstairs_last_filter_change.last_changed).total_seconds() / 86400) | round(0) }} days ago.
2025-05-28 17:08:23 -04:00
who : "Carlo"
group : "maintenance"
2025-06-13 10:00:11 -04:00
2025-07-22 12:00:39 -04:00
- alias : 'AC Status off Announcement'
id : 7812fdaf-a3f8-498b-8f07-28e977e528fe
trigger :
- platform : state
entity_id :
- climate.downstairs
- climate.upstairs
from : 'off'
action :
- service : script.speech_engine
data :
NestStatus : "The {{ trigger.entity_id.split('.')[1].split('_')[0]}} {{ trigger.entity_id.split('.')[1].split('_')[1]}} has now been turned on for {{(trigger.to_state.state)}}."
call_window_check : 1
2025-07-12 17:44:42 -04:00
- alias : Prevent Upstairs Nest Below 76
2025-06-13 10:00:11 -04:00
id : 7812fdaf-a3f8-498b-8f07-28e977e528ff
trigger :
- platform : numeric_state
entity_id : climate.upstairs
attribute : temperature
below : 76
action :
2025-07-12 17:44:42 -04:00
- delay : "00:03:00"
2025-06-13 10:00:11 -04:00
- service : climate.set_temperature
data :
entity_id : climate.upstairs
temperature : 77
2025-07-22 12:00:39 -04:00
- alias : Set Downstairs Nest to 76 When both in bed
id : set_downstairs_nest_76_both_in_bed
trigger :
- platform : numeric_state
entity_id : climate.downstairs
attribute : temperature
above : 76
- platform : state
entity_id : group.bed
to : 'on'
condition :
- condition : and
conditions :
- condition : state
entity_id : binary_sensor.sleepnumber_carlo_carlo_is_in_bed
state : 'on'
- condition : state
entity_id : binary_sensor.sleepnumber_carlo_stacey_is_in_bed
state : 'on'
- condition : numeric_state
entity_id : climate.downstairs
attribute : temperature
above : 76
action :
- service : climate.set_temperature
data :
entity_id : climate.downstairs
temperature : 76