fix: add platform to tesla_smart_charge binary sensor and move to templates directory

This commit is contained in:
2026-03-16 18:16:19 +01:00
parent 5d3a195ba3
commit 8fa4db9d89
5 changed files with 25 additions and 8 deletions
@@ -0,0 +1,17 @@
- alias: Tesla failsafe charge
trigger:
- platform: template
value_template: >
{% set deadline_ts = as_timestamp(states('input_datetime.tesla_charge_deadline')) %}
{% set now_ts = as_timestamp(now()) %}
{{ (deadline_ts - now_ts) <= 3600 }} # 1 time = 3600 sekunder
condition:
- condition: numeric_state
entity_id: sensor.tesla_kwh_needed
above: 0
action:
- service: switch.turn_on
target:
entity_id: switch.home_charging
@@ -8,5 +8,4 @@
action:
- service: switch.turn_off
target:
entity_id: switch.home_charging
entity_id: switch.home_charging