Open Atze85 opened 1 year ago
Hallo Atze85,
poste doch bitte mal deinen Code vom "Autocharge-optimal" Sensor. Ansonsten besteht die Möglichkeit unter den Entwicklerwerkezeugen --> Template den Code live zu testen.
Viele Grüße Vatte
Hatte es damals hinbekommen, aber gar nicht mehr an mein Posting gedacht. Sonst hätte ich schon längst geschlossen.
Leider funktioniert die Automation nicht mehr, bedingt durch die neue API von Tesla. Und eine andere Möglichkeit habe ich bisher noch nicht gefunden.
Can anyone help me with this please ? tried adding 'Autocharge-optimal' sensor but always getting an error 'Entity Autocharge-optimal is neither a valid entity ID nor a valid UUID'. I have a huawei inverter and battery, with Tesla
This is my sensor code.
sensor:
name: 'Autocharge-optimal' unit_of_measurement: "A" state: > {# calculate the optimal charge current based on several parameters: #} {# PV yield, house battery SOC, vehicle battery SOC, Grid consumption #} {% set PV = states('sensor.filtered_inverter_power')|float -500 %} {% set Battery = states('sensor.battery_state_of_capacity')|float (0) %} {% set Grid = states('sensor.power_meter_active_power') |float (0) %} {% set Charge = states('sensor.tesla_charger_power')|float %} {% set Throttle = states('input_number.tesla_charge_break') |float %} {% set Endoffastcharge = states('input_number.num_battery_min_home') |float %} {% set Teslabattery = states('sensor.tesla_battery') |float (0) %} {% set BatteryMaxDischarge = 4500 %}
{# if Grid>0 %} {% set Grid = 0 %} {% endif #} {# PV/230 is the current in a one phase system. For three-phase charging divide by 3! #} {% set PVAMP = (PV/230/3) %} {% if Battery>97 %} {% set PVAMP = PVAMP+1 %} {% endif %} {# While the house battery is below 90% ist, use only 70% of the output so the house battery will charge, too #} {% if Battery<90 %} {% set PVAMP = (PVAMP0.7) %} {% endif %} {% if (Teslabattery>90) and (Battery<80) %} {% set PVAMP = PVAMP 0.5 %} {% endif %} {# When the house battery is above "Endoffastcharge", use at least 6A. When starting, use +5 for hysteresis #} {% if (PVAMP<6) and (Battery>Endoffastcharge+5 ) %} {% set PVAMP = 6 %} {% endif %} {% if (PVAMP<6) and (Battery>Endoffastcharge) and (Charge>0) %} {% set PVAMP = 5 %} {% endif %} {# Under 40%, charge only the house battery, not the car. 3% hysteresis: Don't turn on until we reach 43%. #} {# Exception: When the PV output is really high, allow charging so we don't feed to the grid early #} {% if (Battery<43) and (Charge==0) and (PVAMP<6) %} {% set PVAMP = 0 %} {% endif %} {% if (Battery<40) and (Charge>0) and (PVAMP<6) %} {% set PVAMP = 0 %} {% endif %} {% if (PVAMP>6) and (Battery<40) %} {% set PVAMP = 3 %} {% endif %} {# Don't start charging under 3A because it's not efficient. #} {% if (PVAMP<3) and (Charge==0) %} {% set PVAMP = 0 %} {% endif %} {# Under very high load, like cooking at noon, use throttle. Throttle is controlled by an automation #} {% set PVAMP = PVAMP - Throttle %} {% if Grid < -300 %} {% set PVAMP = PVAMP + (Grid/230/3) %} {% endif %} {% if is_state('input_boolean.tesla_express', 'on') and (Battery>20) %} {% set PVAMP = ((PV + BatteryMaxDischarge + Grid)/230/3) |int %} {% endif %} {% if PVAMP>14 %} {% set PVAMP = 14%} {% endif %} {# avoid negative numbers. They are technically irrelevant, but irritating #} {% if PVAMP<0 %} {% set PVAMP = 0%} {% endif %} {{ PVAMP|int }}
sensor:
sensor:
Betreibt jemand die Automation ohne einen Speicher und könnte mir eventuell etwas Hilfestellung geben?
Ich habe soweit alles eingerichtet, nur bezieht sich die Automation natürlich noch auf einen Speicher, der bei mir nicht vorhanden ist und somit findet keine Überschussladung statt. Ich muss bestimmt nur ein paar Zeilen löschen oder überarbeiten und an diesem Punkt komme ich nicht weiter.