From 18c6b5e4cbbcb2b4eade25fd814ee7d1dae99f5b Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Sun, 22 Mar 2026 07:48:31 +0100 Subject: [PATCH] feat(tesla): automate charge deadline to next morning - Add daily automation to set tesla_charge_deadline at 07:00 next day (13:05 trigger) - Add automation to update deadline when car is plugged in - Ensures smart charging always has valid future window - Eliminates manual deadline management --- include/automations/tesla_deadline.yaml | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 include/automations/tesla_deadline.yaml diff --git a/include/automations/tesla_deadline.yaml b/include/automations/tesla_deadline.yaml new file mode 100644 index 0000000..85df104 --- /dev/null +++ b/include/automations/tesla_deadline.yaml @@ -0,0 +1,35 @@ +- alias: Tesla set charge deadline at 13:00 + id: tesla_set_charge_deadline_daily + trigger: + - platform: time + at: "13:05:00" + + action: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.tesla_charge_deadline + data: + datetime: > + {{ (now() + timedelta(days=1)) + .replace(hour=7, minute=0, second=0, microsecond=0) }} + + mode: single + + +- alias: Tesla set charge deadline when plugged in + id: tesla_set_charge_deadline_on_plug + trigger: + - platform: state + entity_id: binary_sensor.snowywhite_charger + to: "on" + + action: + - service: input_datetime.set_datetime + target: + entity_id: input_datetime.tesla_charge_deadline + data: + datetime: > + {{ (now() + timedelta(days=1)) + .replace(hour=7, minute=0, second=0, microsecond=0) }} + + mode: single