Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tesla: in PV mode, charge always starts at 5A despite min current being set to 1A, causing start/stop oscillation #13007

Closed
FraBoCH opened this issue Mar 17, 2024 · 33 comments · Fixed by #13099
Labels
enhancement New feature or request

Comments

@FraBoCH
Copy link
Contributor

FraBoCH commented Mar 17, 2024

Describe the bug

I have a Tesla charging on a Tesla Wall Connector Gen 3 (twc3). I configured the min current on the loadpoint to 1A (~700w with 3 phases) to charge even with few excess power.
The problem is that in PV mode, the charge always starts at 5A, thus using more current than available and stopping, then starting again, and stopping, ....
In Min+PV mode, the 1A is properly sent to the vehicle and taken into account. So the charge starts at ~700w and then increase/decrease properly with the available solar power in excess.

Steps to reproduce

  1. Configure min current of loadpoint to 1amp:
  2. Wait for enough solar current being generated to start charging (400w with my config)
  3. Charging starts, but at 5amps => 3.6kw and not at 1amp (~700w):
    image
  4. As the used power is now higher than the threshold (1200w with my config), it immediately decides to stop charging
  5. During all the disable delay, no try is made to reduce the current, it remains at 5amp during the whole delay (10min with my config).
  6. I am able to force the current being reduced to the expected 700w value by: setting min current of loadpoint to 2amp, wait for the order to be sent to the tesla, then set it again to 1amp. Or by switching to min+pv.

Configuration details

chargers:
- type: template
  template: twc3 
  host: 192.168.1.16
  name: wallbox

loadpoints:
- title: Garage
  charger: wallbox
  mode: pv
  enable:
    threshold: -400
    delay: 1m
  disable:
    threshold: 1200
    delay: 10m
    
vehicles:
- type: template
  template: tesla
  accessToken: ****
  refreshToken: ****
  vin: ****
  control: true
  name: tesla

Log details

[site  ] DEBUG 2024/03/17 14:45:42 grid currents: [-1.68 -1.31 1.84]A
[site  ] DEBUG 2024/03/17 14:45:42 site power: -396W
[lp-1  ] DEBUG 2024/03/17 14:45:42 charge voltages: [0 1.7 0]V
[lp-1  ] DEBUG 2024/03/17 14:45:42 charge currents: [0 0.3 0.4]A
[lp-1  ] DEBUG 2024/03/17 14:45:42 charger status: B
[lp-1  ] DEBUG 2024/03/17 14:45:42 pv charge current: 0.574A = 0A + 0.574A (-396W @ 3p)
[site  ] DEBUG 2024/03/17 14:46:12 ----
[lp-1  ] DEBUG 2024/03/17 14:46:12 charge power: 0W
[site  ] DEBUG 2024/03/17 14:46:12 pv power: 1410W
[site  ] DEBUG 2024/03/17 14:46:12 grid meter: -462W
[site  ] DEBUG 2024/03/17 14:46:12 grid powers: [-400 -331 268]W
[site  ] DEBUG 2024/03/17 14:46:12 grid currents: [-1.72 -1.6 1.89]A
[site  ] DEBUG 2024/03/17 14:46:12 site power: -462W
[lp-1  ] DEBUG 2024/03/17 14:46:12 charge voltages: [0 1.7 0]V
[lp-1  ] DEBUG 2024/03/17 14:46:12 charge currents: [0 0.3 0.4]A
[lp-1  ] DEBUG 2024/03/17 14:46:12 charger status: B
[lp-1  ] DEBUG 2024/03/17 14:46:12 pv charge current: 0.67A = 0A + 0.67A (-462W @ 3p)
[lp-1  ] DEBUG 2024/03/17 14:46:12 site power -462W <= -400W enable threshold
[lp-1  ] DEBUG 2024/03/17 14:46:12 pv enable timer start: 1m0s
[lp-1  ] DEBUG 2024/03/17 14:46:12 pv enable in 1m0s
[site  ] DEBUG 2024/03/17 14:46:42 ----
[lp-1  ] DEBUG 2024/03/17 14:46:42 charge power: 0W
[site  ] DEBUG 2024/03/17 14:46:42 pv power: 1446W
[site  ] DEBUG 2024/03/17 14:46:42 grid meter: -428W
[site  ] DEBUG 2024/03/17 14:46:42 grid powers: [-411 -272 254]W
[site  ] DEBUG 2024/03/17 14:46:42 grid currents: [-1.78 -1.44 1.89]A
[site  ] DEBUG 2024/03/17 14:46:42 site power: -428W
[lp-1  ] DEBUG 2024/03/17 14:46:42 charge voltages: [0 1.7 0]V
[lp-1  ] DEBUG 2024/03/17 14:46:42 charge currents: [0 0.3 0.4]A
[lp-1  ] DEBUG 2024/03/17 14:46:42 charger status: B
[lp-1  ] DEBUG 2024/03/17 14:46:42 pv charge current: 0.621A = 0A + 0.621A (-428W @ 3p)
[lp-1  ] DEBUG 2024/03/17 14:46:42 site power -428W <= -400W enable threshold
[lp-1  ] DEBUG 2024/03/17 14:46:42 pv enable in 30s
[lp-1  ] DEBUG 2024/03/17 14:46:42 pv enable timer remaining: 30s
[site  ] DEBUG 2024/03/17 14:47:12 ----
[lp-1  ] DEBUG 2024/03/17 14:47:12 charge power: 0W
[site  ] DEBUG 2024/03/17 14:47:42 pv power: 1551W
[site  ] DEBUG 2024/03/17 14:47:42 grid meter: -563W
[site  ] DEBUG 2024/03/17 14:47:42 grid powers: [-445 -347 230]W
[site  ] DEBUG 2024/03/17 14:47:42 grid currents: [-1.91 -1.5 1.78]A
[site  ] DEBUG 2024/03/17 14:47:42 site power: -563W
[lp-1  ] DEBUG 2024/03/17 14:47:42 charge voltages: [0 1.7 0]V
[lp-1  ] DEBUG 2024/03/17 14:47:42 charge currents: [0 0.3 0.4]A
[lp-1  ] DEBUG 2024/03/17 14:47:42 charger status: B
[lp-1  ] DEBUG 2024/03/17 14:47:42 pv charge current: 0.816A = 0A + 0.816A (-563W @ 3p)
[lp-1  ] DEBUG 2024/03/17 14:47:42 site power -563W <= -400W enable threshold
[lp-1  ] DEBUG 2024/03/17 14:47:42 pv enable in 0s
[lp-1  ] DEBUG 2024/03/17 14:47:42 pv enable timer elapsed
[lp-1  ] DEBUG 2024/03/17 14:47:44 charger enable: waking up vehicle
[lp-1  ] ERROR 2024/03/17 14:47:45 charger enable: asleep
[site  ] DEBUG 2024/03/17 14:48:12 ----
[lp-1  ] DEBUG 2024/03/17 14:48:12 charge power: 0W
[site  ] DEBUG 2024/03/17 14:48:12 pv power: 1605W
[site  ] DEBUG 2024/03/17 14:48:12 grid meter: -539W
[site  ] DEBUG 2024/03/17 14:48:12 grid powers: [-464 -317 248]W
[site  ] DEBUG 2024/03/17 14:48:12 grid currents: [-1.99 -1.63 1.77]A
[site  ] DEBUG 2024/03/17 14:48:12 site power: -539W
[lp-1  ] DEBUG 2024/03/17 14:48:12 charge voltages: [0 1.7 0]V
[lp-1  ] DEBUG 2024/03/17 14:48:12 charge currents: [0 0.3 0.4]A
[lp-1  ] DEBUG 2024/03/17 14:48:12 charger status: B
[lp-1  ] DEBUG 2024/03/17 14:48:12 pv charge current: 0.782A = 0A + 0.782A (-539W @ 3p)
[lp-1  ] DEBUG 2024/03/17 14:48:12 site power -539W <= -400W enable threshold
[lp-1  ] DEBUG 2024/03/17 14:48:12 pv enable in 0s
[lp-1  ] DEBUG 2024/03/17 14:48:12 pv enable timer elapsed
[lp-1  ] DEBUG 2024/03/17 14:48:13 charger enable
[lp-1  ] DEBUG 2024/03/17 14:48:13 wake-up timer: start
[site  ] DEBUG 2024/03/17 14:48:42 ----
[lp-1  ] DEBUG 2024/03/17 14:48:42 charge power: 3638W
[site  ] DEBUG 2024/03/17 14:48:42 pv power: 1708W
[site  ] DEBUG 2024/03/17 14:48:42 grid meter: 2922W
[site  ] DEBUG 2024/03/17 14:48:42 grid powers: [718 787 1416]W
[site  ] DEBUG 2024/03/17 14:48:42 grid currents: [3.11 3.72 6.12]A
[site  ] DEBUG 2024/03/17 14:48:42 site power: 2922W
[lp-1  ] DEBUG 2024/03/17 14:48:42 charge voltages: [237 238 238]V
[lp-1  ] DEBUG 2024/03/17 14:48:42 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/17 14:48:42 charge currents: [5.1 5.1 5.1]A
[lp-1  ] DEBUG 2024/03/17 14:48:42 charger status: C
[lp-1  ] INFO 2024/03/17 14:48:42 start charging ->
[lp-1  ] DEBUG 2024/03/17 14:48:42 wake-up timer: stop
[lp-1  ] DEBUG 2024/03/17 14:48:43 vehicle soc: 60%
[lp-1  ] DEBUG 2024/03/17 14:48:43 vehicle soc limit: 80%
[lp-1  ] DEBUG 2024/03/17 14:48:43 vehicle range: 286km
[lp-1  ] DEBUG 2024/03/17 14:48:43 pv charge current: 0A = 1A + -4.23A (2922W @ 3p)
[lp-1  ] DEBUG 2024/03/17 14:48:43 projected site power 2922W >= 1200W disable threshold
[lp-1  ] DEBUG 2024/03/17 14:48:43 pv disable in 7m30s
[lp-1  ] DEBUG 2024/03/17 14:48:43 pv disable timer remaining: 7m30s

What type of operating system are you running?

HomeAssistant Add-on

Version

0.124.10

@StefanSchoof
Copy link
Contributor

Take a look at #12427

@FraBoCH
Copy link
Contributor Author

FraBoCH commented Mar 17, 2024

Hi. I checked #12427 which indeed look similar, but I think I'm in a slightly different situation here, as the issue I observe is cycle of start/stop of charge. I wouldn't mind if it was starting at 5A and reduce the current afterward, but this is not the case. Unless I manually change something, the charging is not working properly and I'm sure a solution to that could be found (even a workaround, like sending again the desired current until Tesla take it into account ;-))

@andig
Copy link
Member

andig commented Mar 17, 2024

@FraBoCH could you kindly set tesla: trace to see what's going on here?

@andig
Copy link
Member

andig commented Mar 17, 2024

In #12427 (comment) it seemed as if evcc sent the right command but is was ignored by the vehicle. Please provide log of MinPV (working) and PV (not working).

@andig andig added the question Rather clarification than issue label Mar 17, 2024
@FraBoCH

This comment was marked as resolved.

@FraBoCH
Copy link
Contributor Author

FraBoCH commented Mar 17, 2024

I cannot test with pv mode now as there is no more sun. However, I've made some progress investigating this issue with the following steps:

  • solar -> now : charge starts at 8A (matching my setting)
  • now -> minPV: set_charging_amps 1 is sent to tesla, but power is reduced to 3580W (-> 5A) ! So here, the tesla ignored partially the request: it reduced the power, but not to 1A as requested
  • change min current in loadpoint popup to 2: set_charging_amps 2 is sent to tesla, and power is reduced accordingly (1483W)
  • change min current in loadpoint popup to 1: set_charging_amps 1 is sent to tesla, and power is reduced accordingly (779W)

So as I see it, tesla reduce the power but is somewhat "blocking" at 5A when going down, requiring an additional request to go further down in power. In other words, evcc cannot assume tesla executes properly the set_charging_amps and should resend the request until the actual charge power match the expectation.

Here is the corresponding log, with the tesla trace:

[lp-1  ] DEBUG 2024/03/17 20:05:26 set charge mode: now
[site  ] DEBUG 2024/03/17 20:05:26 ----
[lp-1  ] DEBUG 2024/03/17 20:05:26 charge power: 3576W
[site  ] DEBUG 2024/03/17 20:05:26 pv power: 0W
[site  ] DEBUG 2024/03/17 20:05:26 grid meter: 4045W
[site  ] DEBUG 2024/03/17 20:05:27 grid powers: [1334 1297 1415]W
[site  ] DEBUG 2024/03/17 20:05:27 grid currents: [5.7 5.6 6.16]A
[site  ] DEBUG 2024/03/17 20:05:27 site power: 4045W
[lp-1  ] DEBUG 2024/03/17 20:05:27 charge voltages: [233 234 234]V
[lp-1  ] DEBUG 2024/03/17 20:05:27 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:05:27 charge currents: [5.1 5.1 5.1]A
[lp-1  ] DEBUG 2024/03/17 20:05:27 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:05:27 charger status: C
[lp-1  ] DEBUG 2024/03/17 20:05:27 vehicle soc: 62%
[lp-1  ] DEBUG 2024/03/17 20:05:27 vehicle soc limit: 80%
[lp-1  ] DEBUG 2024/03/17 20:05:27 vehicle range: 294km
[tesla ] TRACE 2024/03/17 20:05:27 POST https://tesla.evcc.io/api/1/vehicles/********/command/set_charging_amps
[tesla ] TRACE 2024/03/17 20:05:27 {"charging_amps": 8}
--
{"response":{"result":true,"reason":""}}
[lp-1  ] DEBUG 2024/03/17 20:05:27 max charge current: 8A
[site  ] DEBUG 2024/03/17 20:05:53 ----
[lp-1  ] DEBUG 2024/03/17 20:05:53 charge power: 5664W
[site  ] DEBUG 2024/03/17 20:05:54 pv power: 0W
[site  ] DEBUG 2024/03/17 20:05:54 grid meter: 6244W
[site  ] DEBUG 2024/03/17 20:05:54 grid powers: [2059 2054 2131]W
[site  ] DEBUG 2024/03/17 20:05:54 grid currents: [8.75 8.81 9.18]A
[site  ] DEBUG 2024/03/17 20:05:54 site power: 6244W
[lp-1  ] DEBUG 2024/03/17 20:05:54 charge voltages: [232 233 234]V
[lp-1  ] DEBUG 2024/03/17 20:05:54 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:05:54 charge currents: [8.1 8.1 8.1]A
[lp-1  ] DEBUG 2024/03/17 20:05:54 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:05:54 charger status: C
[lp-1  ] DEBUG 2024/03/17 20:05:54 vehicle soc: 62%
[lp-1  ] DEBUG 2024/03/17 20:05:54 vehicle soc limit: 80%
[lp-1  ] DEBUG 2024/03/17 20:05:54 vehicle range: 294km

[lp-1  ] DEBUG 2024/03/17 20:07:25 set charge mode: minpv
[site  ] DEBUG 2024/03/17 20:07:25 ----
[lp-1  ] DEBUG 2024/03/17 20:07:25 charge power: 5667W
[site  ] DEBUG 2024/03/17 20:07:25 pv power: 0W
[site  ] DEBUG 2024/03/17 20:07:25 grid meter: 6232W
[site  ] DEBUG 2024/03/17 20:07:25 grid powers: [2050 2056 2132]W
[site  ] DEBUG 2024/03/17 20:07:25 grid currents: [8.73 8.75 9.16]A
[site  ] DEBUG 2024/03/17 20:07:25 site power: 6232W
[lp-1  ] DEBUG 2024/03/17 20:07:25 charge voltages: [233 233 234]V
[lp-1  ] DEBUG 2024/03/17 20:07:25 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:07:25 charge currents: [8.1 8.1 8.1]A
[lp-1  ] DEBUG 2024/03/17 20:07:25 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:07:25 charger status: C
[lp-1  ] DEBUG 2024/03/17 20:07:25 vehicle soc: 62%
[lp-1  ] DEBUG 2024/03/17 20:07:25 vehicle soc limit: 80%
[lp-1  ] DEBUG 2024/03/17 20:07:25 vehicle range: 294km
[lp-1  ] DEBUG 2024/03/17 20:07:25 pv charge current: 0A = 8A + -9.03A (6232W @ 3p)
[tesla ] TRACE 2024/03/17 20:07:25 POST https://tesla.evcc.io/api/1/vehicles/********/command/set_charging_amps
[tesla ] TRACE 2024/03/17 20:07:26 {"charging_amps": 1}
--
{"response":{"result":true,"reason":""}}
[lp-1  ] DEBUG 2024/03/17 20:07:26 max charge current: 1A
[site  ] DEBUG 2024/03/17 20:07:53 ----
[lp-1  ] DEBUG 2024/03/17 20:07:53 charge power: 3580W
[site  ] DEBUG 2024/03/17 20:07:54 pv power: 0W
[site  ] DEBUG 2024/03/17 20:07:54 grid meter: 4132W
[site  ] DEBUG 2024/03/17 20:07:54 grid powers: [1331 1393 1408]W
[site  ] DEBUG 2024/03/17 20:07:54 grid currents: [5.7 5.98 6.1]A
[site  ] DEBUG 2024/03/17 20:07:54 site power: 4132W
[lp-1  ] DEBUG 2024/03/17 20:07:54 charge voltages: [234 234 234]V
[lp-1  ] DEBUG 2024/03/17 20:07:54 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:07:54 charge currents: [5.1 5.1 5.1]A
[lp-1  ] DEBUG 2024/03/17 20:07:54 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:07:54 charger status: C
[lp-1  ] DEBUG 2024/03/17 20:07:54 vehicle soc: 62%
[lp-1  ] DEBUG 2024/03/17 20:07:54 vehicle soc limit: 80%
[lp-1  ] DEBUG 2024/03/17 20:07:54 vehicle range: 294km
[lp-1  ] DEBUG 2024/03/17 20:07:54 pv charge current: 0A = 1A + -5.99A (4132W @ 3p)
[lp-1  ] DEBUG 2024/03/17 20:08:10 set min current: 2
[site  ] DEBUG 2024/03/17 20:08:23 ----
[lp-1  ] DEBUG 2024/03/17 20:08:23 charge power: 3517W
[site  ] DEBUG 2024/03/17 20:08:24 pv power: 0W
[site  ] DEBUG 2024/03/17 20:08:24 grid meter: 4092W
[site  ] DEBUG 2024/03/17 20:08:24 grid powers: [1322 1368 1402]W
[site  ] DEBUG 2024/03/17 20:08:24 grid currents: [5.65 5.87 6.06]A
[site  ] DEBUG 2024/03/17 20:08:24 site power: 4092W
[lp-1  ] DEBUG 2024/03/17 20:08:24 charge voltages: [235 234 234]V
[lp-1  ] DEBUG 2024/03/17 20:08:24 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:08:24 charge currents: [5 5 5]A
[lp-1  ] DEBUG 2024/03/17 20:08:24 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:08:24 charger status: C
[lp-1  ] DEBUG 2024/03/17 20:08:24 vehicle soc: 62%
[lp-1  ] DEBUG 2024/03/17 20:08:24 vehicle soc limit: 80%
[lp-1  ] DEBUG 2024/03/17 20:08:24 vehicle range: 294km
[lp-1  ] DEBUG 2024/03/17 20:08:24 pv charge current: 0A = 1A + -5.93A (4092W @ 3p)
[tesla ] TRACE 2024/03/17 20:08:24 POST https://tesla.evcc.io/api/1/vehicles/********/command/set_charging_amps
[tesla ] TRACE 2024/03/17 20:08:24 {"charging_amps": 2}
--
{"response":{"result":true,"reason":""}}
[lp-1  ] DEBUG 2024/03/17 20:08:24 max charge current: 2A
[site  ] DEBUG 2024/03/17 20:08:53 ----
[lp-1  ] DEBUG 2024/03/17 20:08:53 charge power: 1483W
[site  ] DEBUG 2024/03/17 20:08:54 pv power: 0W
[site  ] DEBUG 2024/03/17 20:08:54 grid meter: 1968W
[site  ] DEBUG 2024/03/17 20:08:54 grid powers: [617 654 698]W
[site  ] DEBUG 2024/03/17 20:08:54 grid currents: [2.72 2.85 3.18]A
[site  ] DEBUG 2024/03/17 20:08:54 site power: 1968W
[lp-1  ] DEBUG 2024/03/17 20:08:54 charge voltages: [235 235 236]V
[lp-1  ] DEBUG 2024/03/17 20:08:54 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:08:54 charge currents: [2.1 2.1 2.1]A
[lp-1  ] DEBUG 2024/03/17 20:08:54 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:08:54 charger status: C
[lp-1  ] DEBUG 2024/03/17 20:08:54 vehicle soc: 62%
[lp-1  ] DEBUG 2024/03/17 20:08:54 vehicle soc limit: 80%
[lp-1  ] DEBUG 2024/03/17 20:08:54 vehicle range: 294km
[lp-1  ] DEBUG 2024/03/17 20:08:54 pv charge current: 0A = 2A + -2.85A (1968W @ 3p)
[lp-1  ] DEBUG 2024/03/17 20:08:59 set min current: 1
[site  ] DEBUG 2024/03/17 20:09:23 ----
[lp-1  ] DEBUG 2024/03/17 20:09:23 charge power: 1484W
[site  ] DEBUG 2024/03/17 20:09:24 pv power: 0W
[site  ] DEBUG 2024/03/17 20:09:24 grid meter: 1931W
[site  ] DEBUG 2024/03/17 20:09:24 grid powers: [609 632 691]W
[site  ] DEBUG 2024/03/17 20:09:24 grid currents: [2.68 2.81 3.15]A
[site  ] DEBUG 2024/03/17 20:09:24 site power: 1931W
[lp-1  ] DEBUG 2024/03/17 20:09:24 charge voltages: [236 235 236]V
[lp-1  ] DEBUG 2024/03/17 20:09:24 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:09:24 charge currents: [2.1 2.1 2.1]A
[lp-1  ] DEBUG 2024/03/17 20:09:24 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:09:24 charger status: C
[lp-1  ] DEBUG 2024/03/17 20:09:24 vehicle soc: 62%
[lp-1  ] DEBUG 2024/03/17 20:09:24 vehicle soc limit: 80%
[lp-1  ] DEBUG 2024/03/17 20:09:24 vehicle range: 294km
[lp-1  ] DEBUG 2024/03/17 20:09:24 pv charge current: 0A = 2A + -2.8A (1931W @ 3p)
[tesla ] TRACE 2024/03/17 20:09:24 POST https://tesla.evcc.io/api/1/vehicles/********/command/set_charging_amps
[tesla ] TRACE 2024/03/17 20:09:25 {"charging_amps": 1}
--
{"response":{"result":true,"reason":""}}
[lp-1  ] DEBUG 2024/03/17 20:09:25 max charge current: 1A
[site  ] DEBUG 2024/03/17 20:09:53 ----
[lp-1  ] DEBUG 2024/03/17 20:09:53 charge power: 778W
[site  ] DEBUG 2024/03/17 20:09:54 pv power: 0W
[site  ] DEBUG 2024/03/17 20:09:54 grid meter: 1218W
[site  ] DEBUG 2024/03/17 20:09:54 grid powers: [371 396 451]W
[site  ] DEBUG 2024/03/17 20:09:54 grid currents: [1.72 1.85 2.21]A
[site  ] DEBUG 2024/03/17 20:09:54 site power: 1218W
[lp-1  ] DEBUG 2024/03/17 20:09:54 charge voltages: [236 236 236]V
[lp-1  ] DEBUG 2024/03/17 20:09:54 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:09:54 charge currents: [1.1 1.1 1.1]A
[lp-1  ] DEBUG 2024/03/17 20:09:54 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:09:54 charger status: C
[lp-1  ] DEBUG 2024/03/17 20:09:54 vehicle soc: 62%
[lp-1  ] DEBUG 2024/03/17 20:09:54 vehicle soc limit: 80%
[lp-1  ] DEBUG 2024/03/17 20:09:54 vehicle range: 294km
[lp-1  ] DEBUG 2024/03/17 20:09:54 pv charge current: 0A = 1A + -1.77A (1218W @ 3p)
[site  ] DEBUG 2024/03/17 20:10:23 ----
[lp-1  ] DEBUG 2024/03/17 20:10:23 charge power: 779W
[site  ] DEBUG 2024/03/17 20:10:24 pv power: 0W
[site  ] DEBUG 2024/03/17 20:10:24 grid meter: 1225W
[site  ] DEBUG 2024/03/17 20:10:24 grid powers: [372 394 459]W
[site  ] DEBUG 2024/03/17 20:10:24 grid currents: [1.73 1.82 2.24]A
[site  ] DEBUG 2024/03/17 20:10:24 site power: 1225W
[lp-1  ] DEBUG 2024/03/17 20:10:24 charge voltages: [236 236 236]V
[lp-1  ] DEBUG 2024/03/17 20:10:24 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:10:24 charge currents: [1.1 1.1 1.1]A
[lp-1  ] DEBUG 2024/03/17 20:10:24 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/17 20:10:24 charger status: C
[lp-1  ] DEBUG 2024/03/17 20:10:24 vehicle soc: 62%
[lp-1  ] DEBUG 2024/03/17 20:10:24 vehicle soc limit: 80%
[lp-1  ] DEBUG 2024/03/17 20:10:24 vehicle range: 294km
[lp-1  ] DEBUG 2024/03/17 20:10:24 pv charge current: 0A = 1A + -1.78A (1225W @ 3p)

@Adminius
Copy link
Contributor

a while ago, "under 5A" worked only if the set_charging_amps was sended twice (this was only requierd for values 1-4A)

@andig
Copy link
Member

andig commented Mar 19, 2024

Good input, thank you. I was already wondering what made the difference. Sounds like a bug in the Tesla Fleet api that should be fixed?

@Adminius
Copy link
Contributor

That was with the old unofficial API.
I'm using now EVCC with TeslaLogger with FleetAPI via MQTT with 2A-16A setting and I mean it works with 2A without problem...
But never really looked if there any problems or not. I have to check next days, but car battery is full now

@andig
Copy link
Member

andig commented Mar 19, 2024

So as I see it, tesla reduce the power but is somewhat "blocking" at 5A when going down, requiring an additional request to go further down in power. In other words, evcc cannot assume tesla executes properly the set_charging_amps and should resend the request until the actual charge power match the expectation.

We could try doing something like "send command twice if power <5A and last value >=5A".

@FraBoCH
Copy link
Contributor Author

FraBoCH commented Mar 19, 2024

So as I see it, tesla reduce the power but is somewhat "blocking" at 5A when going down, requiring an additional request to go further down in power. In other words, evcc cannot assume tesla executes properly the set_charging_amps and should resend the request until the actual charge power match the expectation.

We could try doing something like "send command twice if power <5A and last value >=5A".

This looks like a possible workaround.
I also thought about:

  1. resending the set_target_amp before starting the charge, so in case of "start/stop" cycles it may eventually work
  2. adding a control loop to read back the current amp st on the vehicle and send command again a few times if that's not matching the expected value

I would be happy to beta-test a fix.

@mucki12
Copy link
Contributor

mucki12 commented Mar 19, 2024

Würde das als damaliger Ersteller von #12427 natürlich auch gerne testen.

@Raudi1
Copy link

Raudi1 commented Mar 21, 2024

Vielleicht hängt das auch damit zusammen, dass man in der Tesla App den Strom nur auf minimal 5A stellen kann. Ich hoffe, dass die Möglichkeit per API da drunter zu gehen nicht nur ein Bug ist, den Tesla irgendwann schließt...

@premultiply
Copy link
Member

premultiply commented Mar 21, 2024

Naja, wirklich Sinn macht das ohnehin nicht, denn auch Tesla kann nicht zaubern.
Der Wirkungsgrad bei niedrigen Leistungen ist in der Regel schon schlecht, irgendwann kommt sogar die Schwelle dass das Fahrzeug mehr durch seine laufenden Systeme verbraucht als das Ladesystem abzüglich seines an diesem Arbeitspunkt miserablen Wirkungsgrad überhaupt ins Bordnetz einspeist.
Daher ist im IEC-Standard aus gutem Grund 6A als Mindestleistungsvorgabe gewählt.

Das hier ist daher wenn dann nur nach dem Motto: "Weil es geht".

@Adminius
Copy link
Contributor

alte Teslas ziehen bis zu 300W beim "rumstehen", neuen um die 150W.
D.h. sogar bei 1A 230V und 1ph bei neuen ist man noch im "plus".
Ich habe aber beobachtet, dass 1A nie erreicht wird:
1A gesetzt 2A wird gezogen
2A gesetzt 3A wird gezogen
3A gesetzt 3 oder 4 werden gezogen
...

So oder so, mit "Ab 1A" muss man nicht mit Phasenumschaltung spielen. Einziger Nachteil bleibt nur noch ca. 700W Schritte (bei 3ph)

@Raudi1
Copy link

Raudi1 commented Mar 21, 2024

Ich habe leider nur eine 1,75kWp PV. Da bin ich auf die niedrige Stromstärke angewiesen. Und es funktioniert auch besser als erwartet. Die Effizienz ist so bei 75% Minimum laut Teslamate. Normalerweise ist sie sogar eher bei mindestens 80-90%. Hat zumindest selbst an eher durchwachsenen Tagen wie den letzten 2 dafür gereicht 10% in die Batterie zu bekommen. Wenn das Wetter konstant sonnig ist, kann ich so wahrscheinlich teilweise komplett nur mit PV laden, da ich regulär nicht viel Auto fahre, besonders bei gutem Wetter. Und ich kann mir einen Heimspeicher sparen.

edit: Habe gerade mal mit Scan my Tesla nachgesehen und mein 2023 Model 3 hat im aufgeweckten Zustand einen Verbrauch von 110-140W. Das deckt sich dann mit den Werten von Teslamate und es macht definitiv Sinn auch unter 6A zu laden, wenn man wie ich nur eine kleine PV hat und ansonsten den Überschuss verschenkt.

@andig
Copy link
Member

andig commented Mar 22, 2024

Könnte jemand #13099 testen wenn ich das in einem Docker Build zur Verfügung stelle?

@FraBoCH
Copy link
Contributor Author

FraBoCH commented Mar 22, 2024

Könnte jemand #13099 testen wenn ich das in einem Docker Build zur Verfügung stelle?

Thanks a lot @andig for working on a fix !
I would test it with pleasure, even if I need to figure out how to run that ;-).
Is there a way to provide a "beta version" that can be installed in home assistant ?

@mucki12
Copy link
Contributor

mucki12 commented Mar 22, 2024

@andig
Kann ich auf jeden Fall testen, aber leider erst in einer Woche. Würde sich das mit dem testing Docker für das Batterieladen beißen? Wenn nicht wäre das natürlich mein Traum ;)

@Raudi1
Copy link

Raudi1 commented Mar 22, 2024

Könnte jemand #13099 testen wenn ich das in einem Docker Build zur Verfügung stelle?

Sollte machbar sein. Es muss aber natürlich auch das Wetter mitspielen.

@andig
Copy link
Member

andig commented Mar 23, 2024

Build läuft, Tag :tesla. Wenns nicht tut bitte tesla: trace log.

@andig andig added enhancement New feature or request and removed question Rather clarification than issue labels Mar 23, 2024
@FraBoCH
Copy link
Contributor Author

FraBoCH commented Mar 23, 2024

It's the first time I'm running evcc docker image so I may be doing something wrong.
I launched using: docker run -d --name evcc -v .\evcc.yaml:/etc/evcc.yaml -v /.evcc:/root/.evcc -p 7070:7070 evcc/evcc:tesla

But the vehicle fails at creation:
[main ] INFO 2024/03/23 12:23:58 evcc 0.124.10 (cfb35a455)
[main ] INFO 2024/03/23 12:23:58 using config file: /etc/evcc.yaml
[main ] INFO 2024/03/23 12:23:58 starting ui and api at :7070
[db ] INFO 2024/03/23 12:24:00 using sqlite database: /root/.evcc/evcc.db
[main ] ERROR 2024/03/23 12:24:00 creating vehicle tesla failed: cannot create vehicle type 'template': invalid vehicle type: tesla

So then, quite logically, I get a "vehicle not capable of current control" whenever trying to change something.

@andig
Copy link
Member

andig commented Mar 23, 2024

Ups- scheint mein local build wäre nicht erfolgreich gewesen. Probiers bitte nochmal.

@FraBoCH

This comment was marked as resolved.

@FraBoCH
Copy link
Contributor Author

FraBoCH commented Mar 23, 2024

Same result with :testing image. The logs are quite similar to what happens when I try to build & run locally without a proper TESLA_CLIENT_ID, maybe this is what's missing in your build ?

@andig
Copy link
Member

andig commented Mar 23, 2024

Sorry for the confusion. :tesla should be fixed now.

@FraBoCH

This comment was marked as resolved.

@andig
Copy link
Member

andig commented Mar 24, 2024

Thanks. Added the function but never called ;). New :tesla image online. Change will force evcc to re-send the current adjustment if it notices a difference.

@FraBoCH
Copy link
Contributor Author

FraBoCH commented Mar 24, 2024

We are almost there !
The behavior is now correct (charging amp go down correctly without stopping at 5A), but there are constant "charger logic error: current mismatch", even when the current is actually correct.
By reading more closely the trace, I found out that you are not reading the correct property. You should use "charge_amps" and not "charge_rate". There is also a "charger_actual_current" property which could be interesting, but I observe that it shows different values than "charge_amps" during the transition between amps.

Here is the corresponding logs extract:

[tesla ] TRACE 2024/03/24 10:45:08 GET https://fleet-api.prd.eu.vn.cloud.tesla.com/api/1/vehicles/***/vehicle_data
[tesla ] TRACE 2024/03/24 10:45:09 {"response":{"id":***,"user_id":***,"vehicle_id":***,"vin":"***","color":null,"access_type":"OWNER","granular_access":{"hide_private":false,"training_wheels":false},"tokens":[***],"state":"online","in_service":false,"id_s":"***","calendar_enabled":true,"api_version":73,"backseat_token":null,"backseat_token_updated_at":null,"ble_autopair_enrolled":false,"charge_state":{"battery_heater_on":false,"battery_level":78,"battery_range":229.28,"charge_amps":3,"charge_current_request":3,"charge_current_request_max":16,"charge_enable_request":true,"charge_energy_added":1.97,"charge_limit_soc":90,"charge_limit_soc_max":100,"charge_limit_soc_min":50,"charge_limit_soc_std":80,"charge_miles_added_ideal":8.0,"charge_miles_added_rated":8.0,"charge_port_cold_weather_mode":false,"charge_port_color":"\u003cinvalid\u003e","charge_port_door_open":true,"charge_port_latch":"Engaged","charge_rate":7.6,"charger_actual_current":4,"charger_phases":2,"charger_pilot_current":16,"charger_power":2,"charger_voltage":237,"charging_state":"Charging","conn_charge_cable":"IEC","est_battery_range":261.08,"fast_charger_brand":"","fast_charger_present":false,"fast_charger_type":"ACSingleWireCAN","ideal_battery_range":229.28,"max_range_charge_counter":0,"minutes_to_full_charge":490,"not_enough_power_to_heat":null,"off_peak_charging_enabled":false," ......}}}
[lp-1  ] WARN 2024/03/24 10:45:09 charger logic error: current mismatch (got 7.6A, expected 3A)
[lp-1  ] DEBUG 2024/03/24 10:45:09 pv charge current: 3.42A = 5.1A + -1.68A (1162W @ 3p)
[tesla ] TRACE 2024/03/24 10:45:09 POST https://tesla.evcc.io/api/1/vehicles/***/command/set_charging_amps
[tesla ] TRACE 2024/03/24 10:45:09 {"charging_amps": 3}
--
{"response":{"result":true,"reason":""}}
[lp-1  ] DEBUG 2024/03/24 10:45:09 max charge current: 3A

@FraBoCH
Copy link
Contributor Author

FraBoCH commented Mar 24, 2024

Test is successful with latest :tesla image. Thanks a lot @andig !
Here is the log proving that the current mismatch logic is correctly detecting and fixing the tesla bug when going down from "now" to "pv" mode with a min current set at 1A.

Looking forward to see this fix in the next release

[lp-1  ] DEBUG 2024/03/24 12:37:59 set charge mode: now
[site  ] DEBUG 2024/03/24 12:37:59 ----
[lp-1  ] DEBUG 2024/03/24 12:37:59 charge power: 790W
[site  ] DEBUG 2024/03/24 12:37:59 pv power: 1673W
[site  ] DEBUG 2024/03/24 12:37:59 grid meter: -264W
[site  ] DEBUG 2024/03/24 12:37:59 grid powers: [190 -320 -134]W
[site  ] DEBUG 2024/03/24 12:37:59 grid currents: [1.43 -1.48 -1.17]A
[site  ] DEBUG 2024/03/24 12:38:00 site power: -264W
[lp-1  ] DEBUG 2024/03/24 12:38:00 charge voltages: [239 239 240]V
[lp-1  ] DEBUG 2024/03/24 12:38:00 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/24 12:38:00 charge currents: [1.1 1.1 1.1]A
[lp-1  ] DEBUG 2024/03/24 12:38:00 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/24 12:38:00 charger status: C
[lp-1  ] DEBUG 2024/03/24 12:38:00 vehicle soc: 81%
[lp-1  ] DEBUG 2024/03/24 12:38:00 vehicle soc limit: 90%
[lp-1  ] DEBUG 2024/03/24 12:38:00 vehicle range: 383km
[tesla ] TRACE 2024/03/24 12:38:00 POST https://tesla.evcc.io/api/1/vehicles/******/command/set_charging_amps
[tesla ] TRACE 2024/03/24 12:38:00 {"charging_amps": 8}
--
{"response":{"result":true,"reason":""}}
[lp-1  ] DEBUG 2024/03/24 12:38:00 max charge current: 8A
[site  ] DEBUG 2024/03/24 12:38:18 ----
[lp-1  ] DEBUG 2024/03/24 12:38:18 charge power: 5768W
[site  ] DEBUG 2024/03/24 12:38:18 pv power: 1719W
[site  ] DEBUG 2024/03/24 12:38:18 grid meter: 4387W
[site  ] DEBUG 2024/03/24 12:38:18 grid powers: [1441 1389 1558]W
[site  ] DEBUG 2024/03/24 12:38:18 grid currents: [6.66 5.83 6.59]A
[site  ] DEBUG 2024/03/24 12:38:18 site power: 4387W
[lp-1  ] DEBUG 2024/03/24 12:38:18 charge voltages: [237 238 237]V
[lp-1  ] DEBUG 2024/03/24 12:38:18 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/24 12:38:18 charge currents: [8.1 8.1 8.1]A
[lp-1  ] DEBUG 2024/03/24 12:38:18 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/24 12:38:18 charger status: C
[lp-1  ] DEBUG 2024/03/24 12:38:18 vehicle soc: 81%
[lp-1  ] DEBUG 2024/03/24 12:38:18 vehicle soc limit: 90%
[lp-1  ] DEBUG 2024/03/24 12:38:18 vehicle range: 383km
[site  ] DEBUG 2024/03/24 12:38:48 ----
[lp-1  ] DEBUG 2024/03/24 12:38:48 charge power: 5790W
[site  ] DEBUG 2024/03/24 12:38:48 pv power: 1867W
[site  ] DEBUG 2024/03/24 12:38:48 grid meter: 4690W
[site  ] DEBUG 2024/03/24 12:38:48 grid powers: [1847 1340 1503]W
[site  ] DEBUG 2024/03/24 12:38:48 grid currents: [7.77 5.61 6.37]A
[site  ] DEBUG 2024/03/24 12:38:48 site power: 4690W
[lp-1  ] DEBUG 2024/03/24 12:38:48 charge voltages: [238 238 238]V
[lp-1  ] DEBUG 2024/03/24 12:38:48 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/24 12:38:48 charge currents: [8.1 8.1 8.1]A
[lp-1  ] DEBUG 2024/03/24 12:38:48 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/24 12:38:48 charger status: C
[lp-1  ] DEBUG 2024/03/24 12:38:48 vehicle soc: 81%
[lp-1  ] DEBUG 2024/03/24 12:38:48 vehicle soc limit: 90%
[lp-1  ] DEBUG 2024/03/24 12:38:48 vehicle range: 383km
[lp-1  ] DEBUG 2024/03/24 12:38:58 set charge mode: pv
[site  ] DEBUG 2024/03/24 12:38:58 ----
[lp-1  ] DEBUG 2024/03/24 12:38:58 charge power: 5809W
[site  ] DEBUG 2024/03/24 12:38:58 pv power: 2014W
[site  ] DEBUG 2024/03/24 12:38:58 grid meter: 4578W
[site  ] DEBUG 2024/03/24 12:38:58 grid powers: [1805 1296 1476]W
[site  ] DEBUG 2024/03/24 12:38:58 grid currents: [7.54 5.43 6.21]A
[site  ] DEBUG 2024/03/24 12:38:58 site power: 4578W
[lp-1  ] DEBUG 2024/03/24 12:38:58 charge voltages: [239 238 239]V
[lp-1  ] DEBUG 2024/03/24 12:38:58 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/24 12:38:58 charge currents: [8.1 8.1 8.1]A
[lp-1  ] DEBUG 2024/03/24 12:38:58 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/24 12:38:58 charger status: C
[lp-1  ] DEBUG 2024/03/24 12:38:58 vehicle soc: 81%
[lp-1  ] DEBUG 2024/03/24 12:38:58 vehicle soc limit: 90%
[lp-1  ] DEBUG 2024/03/24 12:38:58 vehicle range: 383km
[lp-1  ] DEBUG 2024/03/24 12:38:58 pv charge current: 1.37A = 8A + -6.63A (4578W @ 3p)
[tesla ] TRACE 2024/03/24 12:38:58 POST https://tesla.evcc.io/api/1/vehicles/******/command/set_charging_amps
[tesla ] TRACE 2024/03/24 12:38:59 {"charging_amps": 1}
--
{"response":{"result":true,"reason":""}}
[lp-1  ] DEBUG 2024/03/24 12:38:59 max charge current: 1A
[site  ] DEBUG 2024/03/24 12:39:18 ----
[lp-1  ] DEBUG 2024/03/24 12:39:18 charge power: 3683W
[site  ] DEBUG 2024/03/24 12:39:18 pv power: 3521W
[site  ] DEBUG 2024/03/24 12:39:18 grid meter: 324W
[site  ] DEBUG 2024/03/24 12:39:18 grid powers: [52 48 223]W
[site  ] DEBUG 2024/03/24 12:39:18 grid currents: [0.89 0.73 1.49]A
[site  ] DEBUG 2024/03/24 12:39:18 site power: 324W
[lp-1  ] DEBUG 2024/03/24 12:39:18 charge voltages: [241 241 240]V
[lp-1  ] DEBUG 2024/03/24 12:39:18 detected connected phases: 3p
[lp-1  ] DEBUG 2024/03/24 12:39:18 charge currents: [5.1 5.1 5.1]A
[lp-1  ] DEBUG 2024/03/24 12:39:18 detected active phases: 3p
[lp-1  ] DEBUG 2024/03/24 12:39:18 charger status: C
[lp-1  ] DEBUG 2024/03/24 12:39:18 vehicle soc: 81%
[lp-1  ] DEBUG 2024/03/24 12:39:18 vehicle soc limit: 90%
[lp-1  ] DEBUG 2024/03/24 12:39:18 vehicle range: 383km
[tesla ] TRACE 2024/03/24 12:39:18 GET https://fleet-api.prd.eu.vn.cloud.tesla.com/api/1/vehicles/******/vehicle_data
[tesla ] TRACE 2024/03/24 12:39:19 {"response":....
[lp-1  ] WARN 2024/03/24 12:39:19 charger logic error: current mismatch (got 5A, expected 1A)
[lp-1  ] DEBUG 2024/03/24 12:39:19 pv charge current: 4.53A = 5A + -0.469A (324W @ 3p)
[tesla ] TRACE 2024/03/24 12:39:19 POST https://tesla.evcc.io/api/1/vehicles/******/command/set_charging_amps
[tesla ] TRACE 2024/03/24 12:39:19 {"charging_amps": 4}
--
{"response":{"result":true,"reason":""}}

@Neffe1337

This comment was marked as off-topic.

@Neffe1337

This comment was marked as off-topic.

@andig
Copy link
Member

andig commented Aug 3, 2024

@Neffe1337 mach bitte ein neues Thema. Dieses hier ist gelöst.

@evcc-io evcc-io locked as resolved and limited conversation to collaborators Aug 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants