feat: implement Tesla smart charging v3 for Zaptec
- Beregner manglende kWh baseret på SOC og charge limit - Finder de billigste 15-min elspot-timer før deadline - Starter/stopper opladning via switch.home_charging - Tilføjer failsafe 1 time før deadline - Håndterer connected_finished session reset automatisk - Stopper opladning når charge limit er nået - Fuld modulopdeling: input_datetime, templates, binary_sensors, automations
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
- alias: Tesla smart charging v3
|
||||
mode: single
|
||||
|
||||
trigger:
|
||||
- platform: time_pattern
|
||||
minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: time
|
||||
before: input_datetime.tesla_charge_deadline
|
||||
|
||||
action:
|
||||
- choose:
|
||||
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.tesla_charge_now
|
||||
state: "on"
|
||||
|
||||
sequence:
|
||||
# Reset hvis session står i connected_finished
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ states('sensor.home_charger_mode') == 'connected_finished' }}"
|
||||
sequence:
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.home_charging
|
||||
- delay: "00:00:05"
|
||||
|
||||
- service: switch.turn_on
|
||||
target:
|
||||
entity_id: switch.home_charging
|
||||
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.tesla_charge_now
|
||||
state: "off"
|
||||
|
||||
sequence:
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.home_charging
|
||||
@@ -0,0 +1,12 @@
|
||||
- alias: Tesla stop when charged
|
||||
trigger:
|
||||
- platform: template
|
||||
value_template: >
|
||||
{{ states('sensor.snowywhite_battery')|float >=
|
||||
states('number.snowywhite_charge_limit')|float }}
|
||||
|
||||
action:
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.home_charging
|
||||
|
||||
Reference in New Issue
Block a user