Refactor AC media player scripts and add binary sensors for cooling status AC filter changing. #273

This commit is contained in:
Carlo Costanzo 2025-05-29 13:12:16 -04:00
parent b227b3d01d
commit 7dd07a011d
2 changed files with 21 additions and 18 deletions

View File

@ -42,14 +42,6 @@ script:
- delay: "00:01:30"
- service: media_player.play_media
data:
entity_id: media_player.garage
media_content_id: 'turn off c life 4'
media_content_type: custom
- delay: "00:01:30"
- service: media_player.play_media
data:
entity_id: media_player.garage

View File

@ -9,23 +9,34 @@ input_datetime:
has_date: true
has_time: true
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' }}
sensor:
- platform: history_stats
name: Upstairs AC Runtime Since Last Filter Change
entity_id: climate.upstairs
attribute: hvac_action
value: 'cooling'
name: Downstairs AC Runtime Since Last Filter Change
entity_id: binary_sensor.downstairs_ac_cooling
state: 'on'
type: time
start: "{{ states('input_datetime.upstairs_last_filter_change') }}"
start: "{{ states('input_datetime.downstairs_last_filter_change') }}"
end: "{{ now() }}"
- platform: history_stats
name: Downstairs AC Runtime Since Last Filter Change
entity_id: climate.downstairs
attribute: hvac_action
value: 'cooling'
name: Upstairs AC Runtime Since Last Filter Change
entity_id: binary_sensor.upstairs_ac_cooling
state: 'on'
type: time
start: "{{ states('input_datetime.downstairs_last_filter_change') }}"
start: "{{ states('input_datetime.upstairs_last_filter_change') }}"
end: "{{ now() }}"
script: