fix: add platform to tesla_smart_charge binary sensor and move to templates directory
This commit is contained in:
@@ -77,12 +77,6 @@ python_script:
|
|||||||
frontend:
|
frontend:
|
||||||
themes: !include_dir_merge_named include/themes/
|
themes: !include_dir_merge_named include/themes/
|
||||||
|
|
||||||
logger:
|
|
||||||
default: warning
|
|
||||||
logs:
|
|
||||||
custom_components.affalddk: debug
|
|
||||||
pyaffalddk: debug
|
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
# Integrations
|
# Integrations
|
||||||
##################################################
|
##################################################
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -9,4 +9,3 @@
|
|||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.home_charging
|
entity_id: switch.home_charging
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
tesla_charge_deadline:
|
||||||
|
name: Tesla charge deadline
|
||||||
|
has_date: true
|
||||||
|
has_time: true
|
||||||
|
|
||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
platform: template
|
||||||
|
sensors:
|
||||||
- name: tesla_charge_now
|
- name: tesla_charge_now
|
||||||
state: >
|
state: >
|
||||||
{% set deadline = states('input_datetime.tesla_charge_deadline') %}
|
{% set deadline = states('input_datetime.tesla_charge_deadline') %}
|
||||||
Reference in New Issue
Block a user