Files
N22/include/automations/tesla_deadline.yaml
T
claus 18c6b5e4cb 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
2026-03-22 07:48:31 +01:00

36 lines
888 B
YAML

- 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