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

TWC/Tesla: use charger api.PhaseCurrents over vehicle api.CurrentGetter #14659

Merged
merged 4 commits into from
Jul 3, 2024

Conversation

andig
Copy link
Member

@andig andig commented Jul 1, 2024

In case of TWC/Tesla, we're expiring the rate limit due to #14226 when charging below 6A since Tesla needs validation if limit really is applied on vehicle (most likely, that's a vehicle bug). For this purpose, api.CurrentGetter has been added on Tesla and is relayed by TWC to the vehicle if connected.

With #14622, instead of using charger's api.CurrentGetter (which relays to vehicle's api.CurrentGetter in case of TWC) we can resort to charger's api.PhaseCurrents to determine charging above limit as fallback. This PR ensures that the fallback is used by removing the Tesla's api.CurrentGetter and ensuring that charger's api.PhaseCurrents is invoked on api.ErrNotAvailable returned by TWC.

Supports #14616

@andig andig added the enhancement New feature or request label Jul 1, 2024
@andig andig requested a review from GrimmiMeloni July 1, 2024 20:32
@andig
Copy link
Member Author

andig commented Jul 2, 2024

Published Docker tesla.

Copy link
Sponsor Collaborator

@GrimmiMeloni GrimmiMeloni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the comment nitpick, this looks good to me.

core/loadpoint.go Outdated Show resolved Hide resolved
@andig
Copy link
Member Author

andig commented Jul 3, 2024

@FraBoCH hattest Du eine Chance, das auszuprobieren?

@FraBoCH
Copy link
Contributor

FraBoCH commented Jul 3, 2024

Just tested the :tesla docker image. It works as expected with the following typical scenario:

  • switch to mode now: start charging at 16A
  • switch to min+ev: send charging amps to 1A but Tesla only going to 5A. Then evcc detected the issue. I got the warning Garage: charger logic error: current mismatch (got 5.1A measured, expected 1A)
  • Evcc send once again charging amps to 1A and then Tesla complies
  • Charging continue at 1A as expected.
    Looking forward to have it in production with the next release 👍🏻

core/loadpoint.go Outdated Show resolved Hide resolved
@andig andig merged commit d5aabc2 into master Jul 3, 2024
6 checks passed
@andig andig deleted the feat/fallback branch July 3, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants