top-gun / Tesla-PV-charging

This documents my solution to charge my Tesla with PV excess. I own a Tesla Model 3, a Huawei PV system with 8.5kW peak and 10kWh battery. The Tesla is plugged into a "dumb" wallbox that can charge with 11kW (3-phase). All charge control is done via the car API, the wallbox is dumb and does just safety stuff.
GNU General Public License v3.0
14 stars 2 forks source link

missing 'template' in Autocharge-optimal definition #3

Open lepricon opened 2 months ago

lepricon commented 2 months ago

The definition on autocharge-optimal is not proper yaml, since is starting from the - sign. Probably 'template' keyword is missing. Which "include" statement you have above the pasted content?

silencer2008 commented 1 month ago

@lepricon did you manage to solve this ? having the same issue of entity not defined.

lepricon commented 1 month ago

Yep, divided it into two files: template.yaml and sensor.yaml and thus it concatenates correctly

silencer2008 commented 1 month ago

would you be able to share it please ? still having issues

top-gun commented 1 month ago

The definition on autocharge-optimal is not proper yaml, since is starting from the - sign. Probably 'template' keyword is missing. Which "include" statement you have above the pasted content?

There is no need to seperate this into several files.

I assumed that you already have template sensors, and this is one goes to the bottom of the list. If this is your only one, it needs to be preceded by "template:" like this:

template:
  - 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 #}
...