diff --git a/dashboards/views/09_tesla.yaml b/dashboards/views/09_tesla.yaml index 63af162..dd8b3b0 100644 --- a/dashboards/views/09_tesla.yaml +++ b/dashboards/views/09_tesla.yaml @@ -48,23 +48,21 @@ cards: icon: mdi:flash-circle tap_action: action: call-service - service: switch.turn_on - service_data: - entity_id: switch.home_charging + service: script.tesla_force_start_charging - type: button name: Stop opladning icon: mdi:flash-off tap_action: action: call-service - service: switch.turn_off - service_data: - entity_id: switch.home_charging + service: script.tesla_force_stop_charging # 🕒 Opladningsplan - type: entities title: Opladningsplan entities: + - entity: input_boolean.tesla_manual_override + name: Manuel override - entity: binary_sensor.tesla_charge_now name: Skal lade nu - entity: sensor.tesla_charge_plan diff --git a/include/automations/tesla_smart_charging.yaml b/include/automations/tesla_smart_charging.yaml index 751e6d5..9ccc7e8 100644 --- a/include/automations/tesla_smart_charging.yaml +++ b/include/automations/tesla_smart_charging.yaml @@ -10,6 +10,10 @@ minutes: "0" condition: + - condition: state + entity_id: input_boolean.tesla_manual_override + state: "off" + - condition: template value_template: > {% set deadline = states('input_datetime.tesla_charge_deadline') %} @@ -65,3 +69,14 @@ - service: switch.turn_off target: entity_id: switch.home_charging + +- alias: "Tesla - nulstil manuel override ved frakobling" + id: tesla_reset_manual_override + trigger: + - platform: state + entity_id: binary_sensor.snowywhite_charger + to: "off" + action: + - service: input_boolean.turn_off + target: + entity_id: input_boolean.tesla_manual_override diff --git a/include/automations/tesla_stop_when_full.yaml b/include/automations/tesla_stop_when_full.yaml index 8e0bea5..a14196b 100644 --- a/include/automations/tesla_stop_when_full.yaml +++ b/include/automations/tesla_stop_when_full.yaml @@ -6,6 +6,9 @@ {{ (states('sensor.snowywhite_battery')|float(0)) >= (states('number.snowywhite_charge_limit')|float(100)) }} action: + - service: input_boolean.turn_off + target: + entity_id: input_boolean.tesla_manual_override - service: switch.turn_off target: entity_id: switch.home_charging diff --git a/include/input/boolean/tesla.yaml b/include/input/boolean/tesla.yaml new file mode 100644 index 0000000..6ec0087 --- /dev/null +++ b/include/input/boolean/tesla.yaml @@ -0,0 +1,3 @@ +tesla_manual_override: + name: Tesla manuel opladning + icon: mdi:car-electric diff --git a/include/scripts/tesla_charging.yaml b/include/scripts/tesla_charging.yaml new file mode 100644 index 0000000..32e7462 --- /dev/null +++ b/include/scripts/tesla_charging.yaml @@ -0,0 +1,23 @@ +tesla_force_start_charging: + alias: "Tesla - start opladning nu" + description: "Starter opladning med det samme og deaktiverer smart charging planlægning" + icon: mdi:flash-circle + sequence: + - service: input_boolean.turn_on + target: + entity_id: input_boolean.tesla_manual_override + - service: switch.turn_on + target: + entity_id: switch.home_charging + +tesla_force_stop_charging: + alias: "Tesla - stop opladning nu" + description: "Stopper opladning med det samme og deaktiverer smart charging planlægning" + icon: mdi:flash-off + sequence: + - service: input_boolean.turn_on + target: + entity_id: input_boolean.tesla_manual_override + - service: switch.turn_off + target: + entity_id: switch.home_charging