fix: add platform to tesla_smart_charge binary sensor and move to templates directory
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user