diff --git a/config/packages/climate.yaml b/config/packages/climate.yaml index 48a0d566..a286a8f9 100644 --- a/config/packages/climate.yaml +++ b/config/packages/climate.yaml @@ -7,6 +7,7 @@ # Thermostat helpers for upstairs/downstairs comfort. # ------------------------------------------------------------------- # Related Issue: 1571 +# Notes: Filter due alerts include 3-day snooze and Filter Changed push actions. ###################################################################### # Contact: @CCOSTAN | Entity reference details below # Entity reference and attribute summaries: @@ -69,10 +70,18 @@ input_datetime: name: Downstairs Last Filter Change has_date: true has_time: true + downstairs_filter_snooze_until: + name: Downstairs Filter Snooze Until + has_date: true + has_time: true upstairs_last_filter_change: name: Upstairs Last Filter Change has_date: true has_time: true + upstairs_filter_snooze_until: + name: Upstairs Filter Snooze Until + has_date: true + has_time: true # --------------------------------------------------------------------------- # Integration sensors tally runtime based on compressor state @@ -109,6 +118,10 @@ script: data: entity_id: input_datetime.downstairs_last_filter_change datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}" + - service: input_datetime.set_datetime + data: + entity_id: input_datetime.downstairs_filter_snooze_until + datetime: "{{ (now() - timedelta(minutes=1)).strftime('%Y-%m-%d %H:%M:%S') }}" - service: utility_meter.reset target: entity_id: sensor.downstairs_ac_runtime_since_last_filter_change @@ -121,6 +134,10 @@ script: data: entity_id: input_datetime.upstairs_last_filter_change datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}" + - service: input_datetime.set_datetime + data: + entity_id: input_datetime.upstairs_filter_snooze_until + datetime: "{{ (now() - timedelta(minutes=1)).strftime('%Y-%m-%d %H:%M:%S') }}" - service: utility_meter.reset target: entity_id: sensor.upstairs_ac_runtime_since_last_filter_change @@ -264,19 +281,35 @@ automation: - platform: numeric_state entity_id: sensor.downstairs_ac_runtime_since_last_filter_change above: 800 # hours + - platform: time + at: "09:00:00" + condition: + - condition: numeric_state + entity_id: sensor.downstairs_ac_runtime_since_last_filter_change + above: 800 + - condition: template + value_template: >- + {% set snooze_until = as_timestamp(states('input_datetime.downstairs_filter_snooze_until'), 0) %} + {{ snooze_until <= as_timestamp(now()) }} action: - service: script.send_to_logbook data: topic: "MAINTENANCE" message: >- Downstairs AC filter due (runtime >800h). Last changed {{ ((now() - states.input_datetime.downstairs_last_filter_change.last_changed).total_seconds() / 86400) | round(0) }} days ago. - - service: script.notify_engine # <-- keep your existing notify helper + - service: script.notify_engine_two_button data: title: "Home Maintenance Reminder" value1: "It's time to change your Downstairs AC filter." 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. - who: "Carlo" + Runtime has exceeded 800h. Last changed {{ ((now() - states.input_datetime.downstairs_last_filter_change.last_changed).total_seconds() / 86400) | round(0) }} days ago. + title1: "Snooze 3d" + action1: "SNOOZE_DOWNSTAIRS_FILTER_3D" + icon1: "sfsymbols:clock" + title2: "Filter Changed" + action2: "RESET_DOWNSTAIRS_FILTER" + icon2: "sfsymbols:checkmark.circle" + who: "carlo" group: "maintenance" level: "active" @@ -286,21 +319,104 @@ automation: - platform: numeric_state entity_id: sensor.upstairs_ac_runtime_since_last_filter_change above: 450 # hours + - platform: time + at: "09:10:00" + condition: + - condition: numeric_state + entity_id: sensor.upstairs_ac_runtime_since_last_filter_change + above: 450 + - condition: template + value_template: >- + {% set snooze_until = as_timestamp(states('input_datetime.upstairs_filter_snooze_until'), 0) %} + {{ snooze_until <= as_timestamp(now()) }} action: - service: script.send_to_logbook data: topic: "MAINTENANCE" message: >- Upstairs AC filter due (runtime >450h). Last changed {{ ((now() - states.input_datetime.upstairs_last_filter_change.last_changed).total_seconds() / 86400) | round(0) }} days ago. - - service: script.notify_engine + - service: script.notify_engine_two_button data: title: "Home Maintenance Reminder" value1: "It's time to change your Upstairs AC filter." 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. - who: "Carlo" + Runtime has exceeded 450h. Last changed {{ ((now() - states.input_datetime.upstairs_last_filter_change.last_changed).total_seconds() / 86400) | round(0) }} days ago. + title1: "Snooze 3d" + action1: "SNOOZE_UPSTAIRS_FILTER_3D" + icon1: "sfsymbols:clock" + title2: "Filter Changed" + action2: "RESET_UPSTAIRS_FILTER" + icon2: "sfsymbols:checkmark.circle" + who: "carlo" group: "maintenance" + - alias: Climate Filter Reminder Actions + id: 6d7056d0-90ce-4c4f-b8b1-fd32a7e58311 + mode: queued + trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: SNOOZE_DOWNSTAIRS_FILTER_3D + id: downstairs_snooze + - platform: event + event_type: mobile_app_notification_action + event_data: + action: SNOOZE_UPSTAIRS_FILTER_3D + id: upstairs_snooze + - platform: event + event_type: mobile_app_notification_action + event_data: + action: RESET_DOWNSTAIRS_FILTER + id: downstairs_reset + - platform: event + event_type: mobile_app_notification_action + event_data: + action: RESET_UPSTAIRS_FILTER + id: upstairs_reset + action: + - choose: + - conditions: "{{ trigger.id == 'downstairs_snooze' }}" + sequence: + - variables: + snooze_until: "{{ (now() + timedelta(days=3)).strftime('%Y-%m-%d %H:%M:%S') }}" + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.downstairs_filter_snooze_until + data: + datetime: "{{ snooze_until }}" + - service: script.send_to_logbook + data: + topic: "MAINTENANCE" + message: "Downstairs AC filter reminder snoozed until {{ snooze_until }}." + - conditions: "{{ trigger.id == 'upstairs_snooze' }}" + sequence: + - variables: + snooze_until: "{{ (now() + timedelta(days=3)).strftime('%Y-%m-%d %H:%M:%S') }}" + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.upstairs_filter_snooze_until + data: + datetime: "{{ snooze_until }}" + - service: script.send_to_logbook + data: + topic: "MAINTENANCE" + message: "Upstairs AC filter reminder snoozed until {{ snooze_until }}." + - conditions: "{{ trigger.id == 'downstairs_reset' }}" + sequence: + - service: script.reset_downstairs_filter + - service: script.send_to_logbook + data: + topic: "MAINTENANCE" + message: "Downstairs AC filter reset from notification action." + - conditions: "{{ trigger.id == 'upstairs_reset' }}" + sequence: + - service: script.reset_upstairs_filter + - service: script.send_to_logbook + data: + topic: "MAINTENANCE" + message: "Upstairs AC filter reset from notification action." + - alias: 'AC Status Announcement' id: 7812fdaf-a3f8-498b-8f07-28e977e528fe trigger: diff --git a/config/packages/printer.yaml b/config/packages/printer.yaml index ea49561a..94ce9ad8 100755 --- a/config/packages/printer.yaml +++ b/config/packages/printer.yaml @@ -8,7 +8,14 @@ # ------------------------------------------------------------------- # Notes: Inspired by https://community.home-assistant.io/t/epson-wf-3540-ink-level-monitoring/21813 # Notes: Automations - Detect when things are not right. Like any Good Watchdog +# Notes: Ink alerts include 1-day and 1-week snooze actions. ###################################################################### +input_datetime: + printer_ink_snooze_until: + name: Printer Ink Snooze Until + has_date: true + has_time: true + automation: - alias: 'Printer Ink Alert' id: 6ef2a695-0b76-4eb5-b67c-2ff6f74f40b8 @@ -19,16 +26,75 @@ automation: - sensor.canon_ts300_series_black - sensor.canon_ts300_series_color below: 15 + - platform: time + at: "10:00:00" + variables: + low_cartridges: >- + {% set ns = namespace(items=[]) %} + {% for entity_id in ['sensor.canon_ts300_series_black', 'sensor.canon_ts300_series_color'] %} + {% set ink_level = states(entity_id) %} + {% set cartridge_name = state_attr(entity_id, 'friendly_name') | default(entity_id, true) %} + {% if ink_level not in ['unknown', 'unavailable', 'none', ''] and (ink_level | float(100)) < 15 %} + {% set ns.items = ns.items + [cartridge_name ~ ' is at ' ~ ink_level ~ '%'] %} + {% endif %} + {% endfor %} + {{ ns.items | join('; ') }} condition: - condition: time - weekday: - - wed + - condition: time + weekday: + - wed + - condition: template + value_template: "{{ low_cartridges | trim != '' }}" + - condition: template + value_template: >- + {% set snooze_until = as_timestamp(states('input_datetime.printer_ink_snooze_until'), 0) %} + {{ snooze_until <= as_timestamp(now()) }} action: - - service: script.notify_engine + - service: script.notify_engine_two_button data: - value1: "{{ trigger.to_state.attributes.friendly_name }} is at {{ trigger.to_state.state }} " + title: "Printer Ink Alert" + value1: "{{ low_cartridges }}" who: 'carlo' - apns_id: 'information' + group: 'Printer' + title1: "Snooze 1d" + action1: "SNOOZE_PRINTER_INK_1D" + icon1: "sfsymbols:clock" + title2: "Snooze 1w" + action2: "SNOOZE_PRINTER_INK_1W" + icon2: "sfsymbols:calendar" + + - alias: 'Printer Ink Snooze' + id: 77a5cb04-64e6-465e-a3d4-1f75882bbbd4 + mode: queued + trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: SNOOZE_PRINTER_INK_1D + id: one_day + - platform: event + event_type: mobile_app_notification_action + event_data: + action: SNOOZE_PRINTER_INK_1W + id: one_week + variables: + snooze_until: >- + {% if trigger.id == 'one_day' %} + {{ (now() + timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S') }} + {% else %} + {{ (now() + timedelta(days=7)).strftime('%Y-%m-%d %H:%M:%S') }} + {% endif %} + snooze_label: "{{ '1 day' if trigger.id == 'one_day' else '1 week' }}" + action: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.printer_ink_snooze_until + data: + datetime: "{{ snooze_until }}" + - service: script.send_to_logbook + data: + topic: "PRINTER" + message: "Printer ink alert snoozed for {{ snooze_label }} (until {{ snooze_until }})." - alias: 'Printer Status Notifications' id: 6ef2a695-0b76-4eb5-b67c-2ff6f74f40b9 diff --git a/config/packages/vacation_mode.yaml b/config/packages/vacation_mode.yaml index b9fdf2c8..d2916979 100644 --- a/config/packages/vacation_mode.yaml +++ b/config/packages/vacation_mode.yaml @@ -11,6 +11,7 @@ # Notes: General vacation speech uses Chromecast only; the garage Alexa welcome is the one local-device exception. # Notes: Visit analytics use recorder-backed visit counts plus arrival/departure helpers for accurate durations. # Notes: Dorm zones are reported as away locations, not Bear Stone home. +# Notes: Missed sitter alerts include 2-day and 3-day snooze actions that clear after a visit. # Video: https://youtu.be/15kRcFaVV2Y # Blog: https://www.vcloudinfo.com/2026/05/home-assistant-vacation-mode-house-sitter-automation.html ###################################################################### @@ -34,6 +35,10 @@ input_datetime: name: Vacation House Sitter Last Departure has_date: true has_time: true + vacation_house_sitter_missed_visit_snooze_until: + name: Vacation House Sitter Missed Visit Snooze Until + has_date: true + has_time: true input_number: vacation_house_sitter_last_visit_minutes: @@ -200,6 +205,27 @@ automation: Vacation Mode has been disabled and normal automations will continue. call_no_announcement: 1 + - alias: 'Vacation Mode Clear Missed Visit Snooze' + id: 88b7ce4b-b7f9-4770-8b1c-2c42b7a98e32 + mode: queued + + trigger: + - platform: state + entity_id: input_boolean.vacation_mode + to: + - 'on' + - 'off' + - platform: state + entity_id: input_boolean.house_sitter_present + to: 'on' + + action: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.vacation_house_sitter_missed_visit_snooze_until + data: + datetime: "{{ (now() - timedelta(minutes=1)).strftime('%Y-%m-%d %H:%M:%S') }}" + - alias: 'Vacation Mode Garage Welcome' id: 63ac9268-c895-4a1b-b0df-92b5bb8e9d01 mode: single @@ -645,6 +671,10 @@ automation: value_template: >- {% set last_alert = as_timestamp(state_attr('automation.vacation_mode_missed_visit_alert', 'last_triggered'), 0) %} {{ last_alert == 0 or (as_timestamp(now()) - last_alert) >= 86400 }} + - condition: template + value_template: >- + {% set snooze_until = as_timestamp(states('input_datetime.vacation_house_sitter_missed_visit_snooze_until'), 0) %} + {{ snooze_until <= as_timestamp(now()) }} action: - variables: @@ -664,13 +694,19 @@ automation: No sitter visit has been detected for {{ hours_since }} hours since {{ baseline_label }}. Visit count this vacation is {{ visit_count }}. - - service: script.notify_engine + - service: script.notify_engine_two_button data: title: Vacation missed visit alert value1: "{{ alert_message }}" who: carlo group: information level: active + title1: "Snooze 2d" + action1: "SNOOZE_SITTER_MISSED_VISIT_2D" + icon1: "sfsymbols:clock" + title2: "Snooze 3d" + action2: "SNOOZE_SITTER_MISSED_VISIT_3D" + icon2: "sfsymbols:calendar" - service: script.joanna_send_telegram data: @@ -681,6 +717,39 @@ automation: topic: VACATION MODE message: "{{ alert_message }}" + - alias: 'Vacation Mode Missed Visit Snooze' + id: b5a2e44a-1a42-4a2f-992c-18d8dd8d71d9 + mode: queued + trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: SNOOZE_SITTER_MISSED_VISIT_2D + id: two_days + - platform: event + event_type: mobile_app_notification_action + event_data: + action: SNOOZE_SITTER_MISSED_VISIT_3D + id: three_days + variables: + snooze_until: >- + {% if trigger.id == 'two_days' %} + {{ (now() + timedelta(days=2)).strftime('%Y-%m-%d %H:%M:%S') }} + {% else %} + {{ (now() + timedelta(days=3)).strftime('%Y-%m-%d %H:%M:%S') }} + {% endif %} + snooze_label: "{{ '2 days' if trigger.id == 'two_days' else '3 days' }}" + action: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.vacation_house_sitter_missed_visit_snooze_until + data: + datetime: "{{ snooze_until }}" + - service: script.send_to_logbook + data: + topic: VACATION MODE + message: "Vacation missed sitter visit alert snoozed for {{ snooze_label }} (until {{ snooze_until }})." + - alias: 'Vacation Mode Room Hints' id: e0d4e35c-2bf4-435d-adff-52d836812999 mode: single