From 55378dc28f6d6e0d2ee36d499a10a43db6b98983 Mon Sep 17 00:00:00 2001 From: Carlo Costanzo Date: Tue, 8 Sep 2026 17:10:40 -0400 Subject: [PATCH] Improve Tesla and vacation reminders --- config/automation/driveway_parked_car.yaml | 4 +- .../overview/partials/camera_sections.yaml | 135 +++++++++++----- config/packages/infrastructure.yaml | 4 +- config/packages/maintenance_log.yaml | 2 +- config/packages/tesla_model_y.yaml | 152 +++++++++++++++++- config/packages/vacation_mode.yaml | 95 ++++++++++- 6 files changed, 338 insertions(+), 54 deletions(-) diff --git a/config/automation/driveway_parked_car.yaml b/config/automation/driveway_parked_car.yaml index f0c2ad66..0d89f73f 100644 --- a/config/automation/driveway_parked_car.yaml +++ b/config/automation/driveway_parked_car.yaml @@ -9,7 +9,9 @@ # Blog: https://www.vcloudinfo.com/2026/09/home-assistant-frigate-driveway-car-alert.html # ------------------------------------------------------------------- # Notes: Frigate's driveway-zone applies a 30-second loitering time before -# this occupancy sensor turns on. +# this occupancy sensor turns on. Configure the driveway camera's review +# alerts and detections with required_zones: [driveway-zone] so street +# traffic does not create camera-wide review items. ###################################################################### - alias: 'Driveway Parked Car Alert' diff --git a/config/dashboards/overview/partials/camera_sections.yaml b/config/dashboards/overview/partials/camera_sections.yaml index 885c65a6..98318e58 100644 --- a/config/dashboards/overview/partials/camera_sections.yaml +++ b/config/dashboards/overview/partials/camera_sections.yaml @@ -7,6 +7,8 @@ # Standardized access ribbon followed by live exterior cameras. # ------------------------------------------------------------------- # Notes: Entry controls reuse the same shared template as the Home ribbon. +# Notes: Desktop keeps three upper cameras and four second-row cameras beside the doorbell. +# Notes: A full-width responsive grid prevents section wrapping; narrow screens use two columns. ###################################################################### - type: grid @@ -62,48 +64,97 @@ ok_states: - locked +# Picture-glance supplies camera previews and tap-to-open video; button-card cannot. - type: grid + column_span: 4 cards: - - type: picture-glance - camera_image: camera.frontdoorbell - camera_view: auto - entities: [] + - type: custom:layout-card grid_options: - columns: 12 - rows: 7 - - type: picture-glance - camera_image: camera.poolcam - camera_view: auto - entities: [] -- type: grid - column_span: 3 - cards: - - type: picture-glance - camera_image: camera.garagecam - camera_view: auto - entities: [] - - type: picture-glance - camera_image: camera.frontlawn - camera_view: auto - entities: [] - - type: picture-glance - camera_image: camera.driveway - camera_view: auto - entities: [] - - type: picture-glance - camera_image: camera.kidsgate - camera_view: auto - entities: [] - - type: picture-glance - camera_image: camera.bedroomgate - camera_view: auto - entities: [] - - type: picture-glance - camera_image: camera.filtergate - camera_view: auto - entities: [] - - type: custom:frigate-events-card - frigate_client_id: frigate - event_count: 3 - video: true - video_on_hover: true + columns: full + layout_type: custom:grid-layout + layout: + grid-template-columns: repeat(16, minmax(0, 1fr)) + grid-template-areas: | + "door door door door garage garage garage garage lawn lawn lawn lawn drive drive drive drive" + "door door door door kids kids kids bedroom bedroom bedroom filter filter filter conico conico conico" + "pool pool pool pool events events events events events events events events events events events events" + grid-template-rows: min-content min-content min-content + align-items: start + grid-gap: 8px + margin: 0 + mediaquery: + "(max-width: 900px)": + grid-template-columns: repeat(2, minmax(0, 1fr)) + grid-template-areas: | + "door garage" + "pool lawn" + "drive kids" + "bedroom filter" + "conico conico" + "events events" + cards: + - type: picture-glance + camera_image: camera.frontdoorbell + camera_view: auto + aspect_ratio: '4:5' + entities: [] + view_layout: + grid-area: door + - type: picture-glance + camera_image: camera.poolcam + camera_view: auto + aspect_ratio: '16:9' + entities: [] + view_layout: + grid-area: pool + place-self: start stretch + - type: picture-glance + camera_image: camera.garagecam + camera_view: auto + entities: [] + view_layout: + grid-area: garage + - type: picture-glance + camera_image: camera.frontlawn + camera_view: auto + entities: [] + view_layout: + grid-area: lawn + - type: picture-glance + camera_image: camera.driveway + camera_view: auto + entities: [] + view_layout: + grid-area: drive + - type: picture-glance + camera_image: camera.kidsgate + camera_view: auto + entities: [] + view_layout: + grid-area: kids + - type: picture-glance + camera_image: camera.bedroomgate + camera_view: auto + entities: [] + view_layout: + grid-area: bedroom + - type: picture-glance + camera_image: camera.filtergate + camera_view: auto + entities: [] + view_layout: + grid-area: filter + - type: picture-glance + camera_image: camera.conico_wireless + camera_view: auto + entities: [] + view_layout: + grid-area: conico + # Preserve the existing Frigate event previews below the camera rows. + - type: custom:frigate-events-card + frigate_client_id: frigate + event_count: 3 + video: true + video_on_hover: true + view_layout: + grid-area: events diff --git a/config/packages/infrastructure.yaml b/config/packages/infrastructure.yaml index 77a9b40f..ebcb1258 100644 --- a/config/packages/infrastructure.yaml +++ b/config/packages/infrastructure.yaml @@ -1118,7 +1118,7 @@ automation: trigger_source: "{{ trigger.id if trigger is defined and trigger.id is defined else 'manual' }}" verifier_reason: "{{ 'ha_failure_followup' if trigger_source == 'recovery_poll' else 'ha_nightly' }}" trigger_context: "HA automation infra_backup_nightly_verification (Infrastructure - Backup Nightly Verification)" - duplicati_state: "{{ states('switch.duplicati_container') }}" + duplicati_state: "{{ states('switch.duplicati_container_2') }}" - action: rest_command.bearclaw_duplicati_verify data: reason: "{{ verifier_reason }}" @@ -1211,7 +1211,7 @@ automation: source: "home_assistant_automation.infra_backup_nightly_verification" summary: "Nightly Duplicati backup verification failed" entity_ids: - - "switch.duplicati_container" + - "switch.duplicati_container_2" diagnostics: >- scheduled_time=08:00:00, duplicati_container={{ duplicati_state }}, diff --git a/config/packages/maintenance_log.yaml b/config/packages/maintenance_log.yaml index f148962e..03971c59 100644 --- a/config/packages/maintenance_log.yaml +++ b/config/packages/maintenance_log.yaml @@ -157,7 +157,7 @@ automation: trigger: - platform: tag - tag_id: 21d5898a49e64903911f1dbaac931cb4 + tag_id: d7d89d9a-5351-44fc-a26c-011f197e9433 action: - event: maintenance_log diff --git a/config/packages/tesla_model_y.yaml b/config/packages/tesla_model_y.yaml index 7c863e97..d9da22ab 100644 --- a/config/packages/tesla_model_y.yaml +++ b/config/packages/tesla_model_y.yaml @@ -3,8 +3,8 @@ # For more info visit https://www.vcloudinfo.com/click-here # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig # ------------------------------------------------------------------- -# Tesla Model Y - Arrival and nightly plug-in reminders -# Garage speech + parents push reminders when the Tesla comes home low. +# Tesla Model Y - Plug-in and tire-pressure reminders +# Garage plug-in prompts plus actionable low-tire alerts and briefings. # ------------------------------------------------------------------- # Related Issue: 1279 # Notes: Expects Tesla Fleet UI entities `sensor.spaceship_battery_level` @@ -17,8 +17,11 @@ # Notes: Parents push reminders include a 24-hour snooze action. # Notes: Plug-in reminders only fire when both `person.carlo` and # `person.stacey` are home. -# Video: https://youtu.be/wFO0H5zgnzk -# Companion post: https://www.vcloudinfo.com/2026/05/home-assistant-garage-automations-arrival-alerts-tesla.html +# Notes: Tire alerts use the four Tesla Fleet PSI sensors, trigger below +# 40 PSI, and share a 1-day/3-day snooze with Joanna's morning briefing. +# Tire-pressure video: https://youtu.be/hDNyZfTfTtE +# Related garage video: https://youtu.be/wFO0H5zgnzk +# Related garage post: https://www.vcloudinfo.com/2026/05/home-assistant-garage-automations-arrival-alerts-tesla.html ###################################################################### input_datetime: @@ -30,6 +33,10 @@ input_datetime: name: Tesla Model Y Plug In Snooze Until has_date: true has_time: true + tesla_tire_pressure_snooze_until: + name: Tesla Tire Pressure Snooze Until + has_date: true + has_time: true automation: - alias: "Tesla Model Y - Plug In Reminder" @@ -155,3 +162,140 @@ automation: data: topic: "TESLA" message: "Tesla plug-in reminders snoozed for 24 hours (until {{ snooze_until }})." + + - alias: "Tesla Model Y - Low Tire Pressure Alert" + id: 99e546aa-a6c0-4154-9c30-f901f81d1b40 + mode: restart + trigger: + - platform: numeric_state + entity_id: + - sensor.tire_pressure_front_left + - sensor.tire_pressure_front_right + - sensor.tire_pressure_rear_left + - sensor.tire_pressure_rear_right + below: 40 + id: pressure_low + - platform: time + at: input_datetime.tesla_tire_pressure_snooze_until + id: snooze_expired + action: + - delay: '00:00:10' + - condition: or + conditions: + - condition: numeric_state + entity_id: sensor.tire_pressure_front_left + below: 40 + - condition: numeric_state + entity_id: sensor.tire_pressure_front_right + below: 40 + - condition: numeric_state + entity_id: sensor.tire_pressure_rear_left + below: 40 + - condition: numeric_state + entity_id: sensor.tire_pressure_rear_right + below: 40 + - condition: template + value_template: >- + {% set snooze_until = as_timestamp(states('input_datetime.tesla_tire_pressure_snooze_until'), 0) %} + {{ snooze_until <= as_timestamp(now()) }} + - variables: + low_tires: >- + {% set tire_names = { + 'sensor.tire_pressure_front_left': 'front left', + 'sensor.tire_pressure_front_right': 'front right', + 'sensor.tire_pressure_rear_left': 'rear left', + 'sensor.tire_pressure_rear_right': 'rear right' + } %} + {% set ns = namespace(items=[]) %} + {% for entity_id, tire_name in tire_names.items() %} + {% set pressure = states(entity_id) %} + {% if has_value(entity_id) and (pressure | float(100)) < 40 %} + {% set ns.items = ns.items + [tire_name ~ ' ' ~ (pressure | float(0) | round(1)) ~ ' PSI'] %} + {% endif %} + {% endfor %} + {{ ns.items | join('; ') }} + - service: script.notify_engine_two_button + data: + title: "Tesla Tire Pressure" + value1: >- + {{ low_tires }}. Fill any Tesla tire below 40 PSI. + who: 'parents' + group: 'Tesla_Tire_Pressure' + title1: "Snooze 1d" + action1: "SNOOZE_TESLA_TIRE_PRESSURE_1D" + icon1: "sfsymbols:clock" + title2: "Snooze 3d" + action2: "SNOOZE_TESLA_TIRE_PRESSURE_3D" + icon2: "sfsymbols:calendar" + - service: script.send_to_logbook + data: + topic: "TESLA" + message: "Low tire pressure alert sent: {{ low_tires }}." + + - alias: "Tesla Model Y - Tire Pressure Snooze" + id: 59da708d-be6f-422a-9478-090cb5087524 + mode: queued + trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: SNOOZE_TESLA_TIRE_PRESSURE_1D + id: one_day + - platform: event + event_type: mobile_app_notification_action + event_data: + action: SNOOZE_TESLA_TIRE_PRESSURE_3D + id: three_days + variables: + snooze_days: "{{ 1 if trigger.id == 'one_day' else 3 }}" + snooze_until: "{{ (now() + timedelta(days=snooze_days | int)).strftime('%Y-%m-%d %H:%M:%S') }}" + snooze_label: "{{ '1 day' if trigger.id == 'one_day' else '3 days' }}" + action: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.tesla_tire_pressure_snooze_until + data: + datetime: "{{ snooze_until }}" + - service: script.send_to_logbook + data: + topic: "TESLA" + message: "Tesla tire pressure alert snoozed for {{ snooze_label }} (until {{ snooze_until }})." + + - alias: "Tesla Model Y - Clear Tire Pressure Snooze" + id: 5c4c6362-0123-4360-ade1-beae49241165 + mode: single + trigger: + - platform: numeric_state + entity_id: + - sensor.tire_pressure_front_left + - sensor.tire_pressure_front_right + - sensor.tire_pressure_rear_left + - sensor.tire_pressure_rear_right + above: 39.999 + condition: + - condition: numeric_state + entity_id: sensor.tire_pressure_front_left + above: 39.999 + - condition: numeric_state + entity_id: sensor.tire_pressure_front_right + above: 39.999 + - condition: numeric_state + entity_id: sensor.tire_pressure_rear_left + above: 39.999 + - condition: numeric_state + entity_id: sensor.tire_pressure_rear_right + above: 39.999 + - condition: template + value_template: >- + {% set snooze_until = as_timestamp(states('input_datetime.tesla_tire_pressure_snooze_until'), 0) %} + {{ snooze_until > as_timestamp(now()) }} + action: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.tesla_tire_pressure_snooze_until + data: + datetime: "2000-01-01 00:00:00" + - service: script.send_to_logbook + data: + topic: "TESLA" + message: "Tesla tire pressure returned to 40 PSI or higher; the tire alert snooze was cleared." diff --git a/config/packages/vacation_mode.yaml b/config/packages/vacation_mode.yaml index f67e84da..5bc14e3e 100644 --- a/config/packages/vacation_mode.yaml +++ b/config/packages/vacation_mode.yaml @@ -10,6 +10,7 @@ # Related Issue: 1791 # Related Issue: 1792 # Notes: Vacation mode auto-enables from an active Tesla road trip while the family is away, or after the existing 24-hour absence/bed-inactivity checks. +# Notes: Family-away and bed-unused timestamps restore across Home Assistant restarts so long absences are not reset by a restart or brief unavailable state. # Notes: Vacation mode restores its prior state after Home Assistant restarts; a 5-minute reconciliation also clears a restored mode when the family is already home. # 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. @@ -34,6 +35,14 @@ input_boolean: initial: off input_datetime: + vacation_family_away_since: + name: Vacation Family Away Since + has_date: true + has_time: true + vacation_bed_unused_since: + name: Vacation Bed Unused Since + has_date: true + has_time: true vacation_house_sitter_last_arrival: name: Vacation House Sitter Last Arrival has_date: true @@ -387,6 +396,80 @@ template: {% endif %} automation: + - alias: 'Vacation Mode Track Absence Evidence' + id: e0c7bc2c-57b4-4e91-8caf-1f666979037b + mode: queued + + trigger: + - platform: state + entity_id: group.family + from: 'home' + to: 'not_home' + id: family_transition + - platform: state + entity_id: group.family + from: 'not_home' + to: 'home' + id: family_transition + - platform: state + entity_id: group.bed + from: 'on' + to: 'off' + id: bed_transition + - platform: state + entity_id: group.bed + from: 'off' + to: 'on' + id: bed_transition + - platform: homeassistant + event: start + id: initialize + + action: + - choose: + - conditions: + - condition: trigger + id: family_transition + sequence: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.vacation_family_away_since + data: + timestamp: "{{ now().timestamp() }}" + - conditions: + - condition: trigger + id: bed_transition + sequence: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.vacation_bed_unused_since + data: + timestamp: "{{ now().timestamp() }}" + - conditions: + - condition: trigger + id: initialize + sequence: + - if: + - condition: template + value_template: >- + {{ as_timestamp(states('input_datetime.vacation_family_away_since'), 0) <= 0 }} + then: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.vacation_family_away_since + data: + timestamp: "{{ now().timestamp() }}" + - if: + - condition: template + value_template: >- + {{ as_timestamp(states('input_datetime.vacation_bed_unused_since'), 0) <= 0 }} + then: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.vacation_bed_unused_since + data: + timestamp: "{{ now().timestamp() }}" + - alias: 'Vacation Mode Enable' id: 163f4434-2a2f-4528-a53c-8fc6e1fd8e14 mode: single @@ -415,8 +498,10 @@ automation: - condition: template value_template: >- {% set family_away = is_state('group.family', 'not_home') %} - {% set family_away_seconds = as_timestamp(now()) - as_timestamp(states.group.family.last_changed, 0) %} - {% set bed_unused_seconds = as_timestamp(now()) - as_timestamp(states.group.bed.last_changed, 0) %} + {% set family_away_since = as_timestamp(states('input_datetime.vacation_family_away_since'), 0) %} + {% set bed_unused_since = as_timestamp(states('input_datetime.vacation_bed_unused_since'), 0) %} + {% set family_away_seconds = as_timestamp(now()) - family_away_since if family_away_since > 0 else 0 %} + {% set bed_unused_seconds = as_timestamp(now()) - bed_unused_since if bed_unused_since > 0 else 0 %} {% set road_trip_signal = trigger.id | default('', true) == 'tesla_road_trip' %} {{ (family_away and road_trip_signal) or (family_away and family_away_seconds >= 86400) @@ -425,8 +510,10 @@ automation: action: - variables: vacation_reason: >- - {% set family_away_seconds = as_timestamp(now()) - as_timestamp(states.group.family.last_changed, 0) %} - {% set bed_unused_seconds = as_timestamp(now()) - as_timestamp(states.group.bed.last_changed, 0) %} + {% set family_away_since = as_timestamp(states('input_datetime.vacation_family_away_since'), 0) %} + {% set bed_unused_since = as_timestamp(states('input_datetime.vacation_bed_unused_since'), 0) %} + {% set family_away_seconds = as_timestamp(now()) - family_away_since if family_away_since > 0 else 0 %} + {% set bed_unused_seconds = as_timestamp(now()) - bed_unused_since if bed_unused_since > 0 else 0 %} {% if trigger.id | default('', true) == 'tesla_road_trip' %} Active Tesla road trip while the family remained away {% elif is_state('group.bed', 'off') and bed_unused_seconds >= 86400 and family_away_seconds < 86400 %}