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
This commit is contained in:
@@ -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
|
||||||
Reference in New Issue
Block a user