From 61df803723ba4c1c3e0458494c8bbfa040bcfaf0 Mon Sep 17 00:00:00 2001 From: Carlo Costanzo Date: Wed, 14 Oct 2026 17:15:34 -0400 Subject: [PATCH] Add low-tire details to shared speech --- config/automation/Speech/README.md | 3 +- .../automation/Speech/garbage_day_garage.yaml | 35 ++++++++++++++++- config/custom_templates/tesla_tires.jinja | 39 +++++++++++++++++++ config/packages/tesla_model_y.yaml | 18 ++------- config/templates/speech/briefing.yaml | 5 +++ 5 files changed, 83 insertions(+), 17 deletions(-) create mode 100644 config/custom_templates/tesla_tires.jinja diff --git a/config/automation/Speech/README.md b/config/automation/Speech/README.md index 3084cde4..8f6a862a 100755 --- a/config/automation/Speech/README.md +++ b/config/automation/Speech/README.md @@ -28,7 +28,7 @@ Speech-first automations: contextual announcements, stats briefings, guest mode | --- | --- | | [![YAML source: announcements](https://img.shields.io/static/v1?label=YAML&message=announcements&color=lightgrey&logo=github&logoColor=181717)](announcements.yaml) | Family and tracked Life360 arrival greetings plus daily/occasional broadcast messages. | | [![YAML source: home_stats](https://img.shields.io/static/v1?label=YAML&message=home_stats&color=lightgrey&logo=github&logoColor=181717)](home_stats.yaml) | Voice summary of house status and interesting stats. | -| [![YAML source: garbage_day_garage](https://img.shields.io/static/v1?label=YAML&message=garbage_day_garage&color=lightgrey&logo=github&logoColor=181717)](garbage_day_garage.yaml) | Garage garbage-day speech plus a Carlo-only phone alert with 30-minute and 2-hour snooze actions. | +| [![YAML source: garbage_day_garage](https://img.shields.io/static/v1?label=YAML&message=garbage_day_garage&color=lightgrey&logo=github&logoColor=181717)](garbage_day_garage.yaml) | Garage garbage-day speech plus a Carlo-only phone alert with 30-minute and 2-hour snooze actions. Garage openings also announce low Tesla tire pressure on other days through the shared briefing. | | [![YAML source: guest_mode](https://img.shields.io/static/v1?label=YAML&message=guest_mode&color=lightgrey&logo=github&logoColor=181717)](guest_mode.yaml) | Adjust announcements and behaviors while guests are over. | | [![YAML source: High_Wind_Speed_Check](https://img.shields.io/static/v1?label=YAML&message=High_Wind_Speed_Check&color=lightgrey&logo=github&logoColor=181717)](High_Wind_Speed_Check.yaml) | Tier 30/40/60 mph alerts and include any open garage doors in one warning path. | @@ -37,6 +37,7 @@ Speech-first automations: contextual announcements, stats briefings, guest mode - Keep announcements natural and action-first; the LLM prompt should avoid previous-message repetition and include weather when requested, safety-relevant, or still useful before late-day context takes over. - Airly's nearest-monitor CAQI is the primary local reading and stays silent below medium (50); Pirate Weather US AQI is a safety backstop at 101 or higher. Normal readings are never added to speech. [![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-FF0000?logo=youtube&logoColor=white)](https://youtu.be/Gjk7z34Qe_4) [![vCloudInfo Blog Post](https://img.shields.io/static/v1?label=vCloudInfo&message=Blog%20Post&color=21759B&logo=wordpress&logoColor=white)](https://www.vcloudinfo.com/2026/07/home-assistant-air-quality-airly-pirate-weather.html) - Briefing context includes quiet-by-default Tesla, energy, water, comfort, and vacuum checks so routine announcements stay useful without repeating normal status. +- Tesla tire reminders name each current reading below 38.5 PSI and honor the existing 1-day/3-day tire-alert snooze. The shared [tire macros](../../custom_templates/tesla_tires.jinja) keep phone and speech details aligned. Garbage-only snoozes leave tire reminders available, and tire-only garage openings produce one shared announcement without extra phone alerts or staggered repeats. Inflate to the vehicle's door-label pressure; 38.5 PSI is the alert cutoff. **All of my configuration files are tested against the most stable version of home-assistant.** diff --git a/config/automation/Speech/garbage_day_garage.yaml b/config/automation/Speech/garbage_day_garage.yaml index 2369b4ec..bfb35962 100644 --- a/config/automation/Speech/garbage_day_garage.yaml +++ b/config/automation/Speech/garbage_day_garage.yaml @@ -14,12 +14,17 @@ # Notes: Debounced garage door open trigger to avoid restarts if the # garage door state flaps (noisy sensors/reflection). # Notes: A stable garbage_day_reminder tag replaces the previous phone reminder. +# Notes: A garage opening also runs the shared briefing when Tesla tires +# need air, even outside garbage days or during a garbage-only snooze. +# Tire speech uses the existing 1-day/3-day tire-alert snooze. ###################################################################### - alias: 'Garage Garbage Day Reminders' id: 3f97f3be-3d0a-4d2d-9100-5b9c0dbfd5c3 description: >- Remind Carlo to handle garbage day, with phone actions that silence - all related speech for 30 minutes or 2 hours. + all garbage speech for 30 minutes or 2 hours. Include low Tesla tire + pressure in the shared briefing and announce tire-only reminders + on other days when the garage opens. mode: restart trigger: @@ -67,6 +72,34 @@ - condition: trigger id: garage_open + # Garbage-day openings already run speech_engine below, which includes tires. + # On other openings, speak once only when an unsnoozed tire needs air. + - choose: + - conditions: + - condition: template + value_template: >- + {% from 'tesla_tires.jinja' import tire_reminder %} + {{ tire_reminder() | trim != '' }} + - condition: not + conditions: + - condition: and + conditions: + - condition: time + weekday: + - wed + - sun + - condition: state + entity_id: timer.garbage_reminder_snooze + state: 'idle' + sequence: + - service: script.speech_engine + data: + value1: >- + {% from 'tesla_tires.jinja' import tire_reminder %} + {{ tire_reminder() }} + call_garbage_day: 1 + - stop: "Shared garage tire reminder announced." + # Only run on garbage days (Wed/Sun) while the shared snooze is idle. - condition: time weekday: diff --git a/config/custom_templates/tesla_tires.jinja b/config/custom_templates/tesla_tires.jinja new file mode 100644 index 00000000..07e8395e --- /dev/null +++ b/config/custom_templates/tesla_tires.jinja @@ -0,0 +1,39 @@ +{# +###################################################################### +# @CCOSTAN - Follow Me on X +# For more info visit https://www.vcloudinfo.com/click-here +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# ------------------------------------------------------------------- +# Tesla Tires - Shared low-pressure detail and spoken reminder +# Uses current Tesla Fleet readings and the existing tire-alert snooze. +# ------------------------------------------------------------------- +# Notes: 38.5 PSI is the alert cutoff, not the tire inflation target. +# Notes: Unknown, unavailable, and nonnumeric readings stay silent. +###################################################################### +#} +{% macro 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) | float(none) -%} + {%- if pressure is not none and pressure < 38.5 -%} + {%- set ns.items = ns.items + [tire_name ~ ' ' ~ (pressure | round(1)) ~ ' PSI'] -%} + {%- endif -%} + {%- endfor -%} + {{- ns.items | join('; ') -}} +{%- endmacro %} + +{% macro tire_reminder() -%} + {%- set snooze_until = as_timestamp(states('input_datetime.tesla_tire_pressure_snooze_until'), 0) -%} + {%- if snooze_until <= as_timestamp(now()) -%} + {%- set tires = low_tires() | trim -%} + {%- if tires -%} + Tesla tires need air: {{ tires }}. Fill the low tires to the pressure on the driver's door label while you are in the garage. + {%- endif -%} + {%- endif -%} +{%- endmacro %} diff --git a/config/packages/tesla_model_y.yaml b/config/packages/tesla_model_y.yaml index 6b75aea2..16a193fb 100644 --- a/config/packages/tesla_model_y.yaml +++ b/config/packages/tesla_model_y.yaml @@ -72,7 +72,7 @@ command_line: input_boolean: tesla_high_charge_rate_alert_active: name: Tesla Home Charging Incident Active - icon: mdi:car-electric-alert + icon: mdi:car-electric-outline tesla_home_charge_restart_required: name: Tesla Home Charging Restart Review Required icon: mdi:car-electric-outline @@ -934,20 +934,8 @@ automation: {{ 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)) < 38.5 %} - {% set ns.items = ns.items + [tire_name ~ ' ' ~ (pressure | float(0) | round(1)) ~ ' PSI'] %} - {% endif %} - {% endfor %} - {{ ns.items | join('; ') }} + {% from 'tesla_tires.jinja' import low_tires %} + {{ low_tires() }} - service: script.notify_engine_two_button data: title: "Tesla Tire Pressure" diff --git a/config/templates/speech/briefing.yaml b/config/templates/speech/briefing.yaml index ec4ae4e9..6a3c2561 100755 --- a/config/templates/speech/briefing.yaml +++ b/config/templates/speech/briefing.yaml @@ -28,12 +28,15 @@ # Notes: Garbage-day speech honors timer.garbage_reminder_snooze so Carlo's # phone action suppresses the reminder across every speech entry point. # Notes: Garage-door speech honors the shared one-hour reminder snooze. +# Notes: Low Tesla tire pressure includes affected tires and current PSI, +# honoring the existing tire-alert snooze across shared briefings. # Notes: Humidity and NWS alerts use the current sensor IDs; missing alert # attributes are treated as an empty alert list. ###################################################################### >- + {%- from 'tesla_tires.jinja' import tire_reminder -%} {%- macro dark_outside() -%} [Because the sun has set, outside lights have been turned on] {%- endmacro -%} @@ -542,6 +545,8 @@ {{ tesla_charge_context() }} + {{ tire_reminder() }} + {{ energy_context() }} {{ water_context() }}