improve(automation): increase reliability of tesla charging control
- Change mode to restart to prevent skipped runs - Replace failsafe template trigger with time_pattern - Add plugged-in condition to avoid unnecessary switching - Add explicit deadline validation condition Result: - More reliable execution of charging logic - Prevents missed failsafe activation - Reduces unnecessary charger toggling
This commit is contained in:
@@ -1,12 +1,15 @@
|
|||||||
- alias: Tesla failsafe charge
|
- alias: Tesla failsafe charge
|
||||||
trigger:
|
trigger:
|
||||||
- platform: template
|
- platform: time_pattern
|
||||||
|
minutes: "/5"
|
||||||
|
|
||||||
|
condition:
|
||||||
|
- condition: template
|
||||||
value_template: >
|
value_template: >
|
||||||
{% set deadline_ts = as_timestamp(states('input_datetime.tesla_charge_deadline')) %}
|
{% set deadline_ts = as_timestamp(states('input_datetime.tesla_charge_deadline')) %}
|
||||||
{% set now_ts = as_timestamp(now()) %}
|
{% set now_ts = as_timestamp(now()) %}
|
||||||
{{ (deadline_ts - now_ts) <= 3600 }} # 1 time = 3600 sekunder
|
{{ (deadline_ts - now_ts) <= 3600 }}
|
||||||
|
|
||||||
condition:
|
|
||||||
- condition: numeric_state
|
- condition: numeric_state
|
||||||
entity_id: sensor.tesla_kwh_needed
|
entity_id: sensor.tesla_kwh_needed
|
||||||
above: 0
|
above: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user