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-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:
|
|
|
|
- platform: history_stats
|
2025-05-29 13:12:16 -04:00
|
|
|
name: Downstairs AC Runtime Since Last Filter Change
|
|
|
|
entity_id: binary_sensor.downstairs_ac_cooling
|
|
|
|
state: 'on'
|
2025-05-28 17:08:23 -04:00
|
|
|
type: time
|
2025-05-29 13:12:16 -04:00
|
|
|
start: "{{ states('input_datetime.downstairs_last_filter_change') }}"
|
2025-05-28 17:08:23 -04:00
|
|
|
end: "{{ now() }}"
|
|
|
|
|
|
|
|
- platform: history_stats
|
2025-05-29 13:12:16 -04:00
|
|
|
name: Upstairs AC Runtime Since Last Filter Change
|
|
|
|
entity_id: binary_sensor.upstairs_ac_cooling
|
|
|
|
state: 'on'
|
2025-05-28 17:08:23 -04:00
|
|
|
type: time
|
2025-05-29 13:12:16 -04:00
|
|
|
start: "{{ states('input_datetime.upstairs_last_filter_change') }}"
|
2025-05-28 17:08:23 -04:00
|
|
|
end: "{{ now() }}"
|
|
|
|
|
|
|
|
script:
|
|
|
|
reset_filter_change_date:
|
|
|
|
alias: Reset Downstairs Filter Change Date
|
|
|
|
sequence:
|
|
|
|
- service: input_datetime.set_datetime
|
|
|
|
data:
|
|
|
|
entity_id: input_datetime.downstairs_last_filter_change
|
|
|
|
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
|
|
|
|
|
|
|
|
automation:
|
|
|
|
- alias: Notify Downstairs Filter Change Due
|
|
|
|
description: "Notify when AC runtime exceeds threshold since last filter change"
|
|
|
|
trigger:
|
|
|
|
- platform: numeric_state
|
|
|
|
entity_id: sensor.downstairs_ac_runtime_since_last_filter_change
|
|
|
|
above: 800
|
|
|
|
action:
|
|
|
|
- service: script.notify_engine
|
|
|
|
data:
|
|
|
|
title: "Home Maintenance Reminder"
|
|
|
|
value1: "It's time to change your Downstairs AC filter."
|
|
|
|
value2: "Runtime has exceeded 800 hours. Last changed {{ ((now() - states.input_datetime.downstairs_last_filter_change.last_changed).total_seconds() / 86400) | round(0) }} days ago."
|
|
|
|
who: "Carlo"
|
|
|
|
group: "maintenance"
|
|
|
|
level: "active"
|
|
|
|
|
|
|
|
- alias: Notify Upstairs Filter Change Due
|
|
|
|
description: "Notify when AC runtime exceeds threshold since last filter change"
|
|
|
|
trigger:
|
|
|
|
- platform: numeric_state
|
|
|
|
entity_id: sensor.upstairs_ac_runtime_since_last_filter_change
|
|
|
|
above: 450
|
|
|
|
action:
|
|
|
|
- service: script.notify_engine
|
|
|
|
data:
|
|
|
|
title: "Home Maintenance Reminder"
|
|
|
|
value1: "It's time to change your Upstairs AC filter."
|
|
|
|
value2: "Runtime has exceeded 450 hours. Last changed {{ ((now() - states.input_datetime.upstairs_last_filter_change.last_changed).total_seconds() / 86400) | round(0) }} days ago."
|
|
|
|
who: "Carlo"
|
|
|
|
group: "maintenance"
|