You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
4.6 KiB

######################################################################
# @CCOSTAN - Follow Me on X
# 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.
# -------------------------------------------------------------------
# Related Issue: 1279
# Notes: Expects Tesla Fleet UI entities `sensor.spaceship_battery_level`
# and `switch.spaceship_charge`.
# Notes: Uses `cover.large_garage_door` closing as the arrival proxy so
# Tesla location drift does not suppress reminders.
# Notes: The nightly parents reminder starts at 8 PM or after a post-8 PM
# garage close, then loops every 30 minutes via a custom event while the
# latest garage-arrival signal is recent and the car still is not charging.
# 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
######################################################################
input_datetime:
tesla_model_y_last_garage_close:
name: Tesla Model Y Last Garage Close
has_date: true
has_time: true
automation:
- alias: "Tesla Model Y - Plug In Reminder"
id: 6a873341-c823-4d5d-9d42-fc2df52b93db
mode: restart
trigger:
- platform: time
at: '20:00:00'
id: nightly
- platform: event
event_type: event_tesla_model_y_nightly_loop
id: loop
- platform: state
entity_id: cover.large_garage_door
from: 'open'
to: 'closed'
for: '00:03:20'
id: garage_closed
action:
- choose:
- conditions:
- condition: trigger
id: garage_closed
sequence:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tesla_model_y_last_garage_close
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- condition: or
conditions:
- condition: trigger
id: garage_closed
- condition: template
value_template: >-
{% set last_close_ts = as_timestamp(states('input_datetime.tesla_model_y_last_garage_close'), 0) %}
{{ last_close_ts > 0 and (as_timestamp(now()) - last_close_ts) < 43200 }}
- condition: numeric_state
entity_id: sensor.spaceship_battery_level
below: 50
- condition: state
entity_id: person.carlo
state: 'home'
- condition: state
entity_id: person.stacey
state: 'home'
- condition: state
entity_id: switch.spaceship_charge
state: 'off'
- choose:
- conditions:
- condition: trigger
id: garage_closed
sequence:
- service: notify.alexa_media_garage
data:
message: >-
Reminder: the Tesla battery is at
{{ states('sensor.spaceship_battery_level') | float(0) | round(0) }} percent.
Please plug in the Model Y.
data:
type: announce
- service: script.send_to_logbook
data:
topic: "TESLA"
message: >-
Garage reminder announced to plug in the Model Y at
{{ states('sensor.spaceship_battery_level') | float(0) | round(0) }} percent.
- condition: or
conditions:
- condition: not
conditions:
- condition: trigger
id: garage_closed
- condition: time
after: '20:00:00'
before: '05:00:00'
- service: script.notify_engine
data:
title: "Tesla Plug In Reminder"
value1: >-
The Model Y recently came in through the garage, is below 50 percent,
and is not plugged in.
Current battery:
{{ states('sensor.spaceship_battery_level') | float(0) | round(0) }} percent.
who: 'parents'
group: 'Tesla_Model_Y'
- service: script.send_to_logbook
data:
topic: "TESLA"
message: >-
Nightly plug-in reminder sent because the Model Y recently came in through the garage below 50 percent and is not charging.
- delay: '00:30:00'
- event: event_tesla_model_y_nightly_loop

Powered by TurnKey Linux.