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

Add Tesla using official vehicle command library #10802

Merged
merged 22 commits into from
Jan 24, 2024
Merged

Conversation

andig
Copy link
Member

@andig andig commented Nov 16, 2023

Fix #10460, refs #10789

How to get Tesla Integration working?

  1. generate a new pair of API tokens here https://tesla.evcc.io
  2. switch to the latest nightly build of evcc
  3. change your template from tesla to tesla-command.
vehicles:
 - name: mytesla
   type: template
-  template: tesla
+  template: tesla-command
   accessToken: [...] # generetad by tesla.evcc.io
   refreshToken:  [...] # generetad by tesla.evcc.io
   ...

⚠️ The template name tesla-command might change before the next stable release. But for now, this is the working version.

Using local builds is still possible, but now requires a Tesla Developer account. Use the TESLA_CLIENT_ID env.

Optional:

  • implement commands via API server

@andig andig added the enhancement New feature or request label Nov 16, 2023
@andig andig marked this pull request as draft November 16, 2023 14:09
@andig andig force-pushed the feature/tesla-new branch from 0f0ead2 to fb29c37 Compare December 7, 2023 06:55
@andig andig force-pushed the feature/tesla-new branch from fb29c37 to 9a2dbc7 Compare December 22, 2023 11:57
@github-actions github-actions bot added the stale Outdated and ready to close label Jan 12, 2024
@github-actions github-actions bot closed this Jan 18, 2024
@andig andig reopened this Jan 18, 2024
@github-actions github-actions bot removed the stale Outdated and ready to close label Jan 19, 2024
@MarcusWichelmann
Copy link

Very cool!

Is it still not an option to get the climate/preconditioning state with this new API because it has to be woken up each time which drains the battery?

@minestrone1994
Copy link

Does this already work? Tesla deactivated the old API as of last week for me, making EVCC unusable with a TWC3.

@andig
Copy link
Member Author

andig commented Jan 21, 2024

Yes, but not for twc3 for reasons explained in #10460 (comment)

@nicx
Copy link

nicx commented Jan 24, 2024

any idea when this is released? I cannot use my Tesla vehicle anymore because the old API is no more working.

@andig andig marked this pull request as ready for review January 24, 2024 09:46
@naltatis
Copy link
Member

When testing I get:

.Soc:     vehicle not available: cannot create vehicle 'template': invalid vehicle type: tesla-command

I don't understand why you're doing this:
https://github.com/evcc-io/evcc/pull/10802/files#diff-f3de7bfcd152edd6a1a65a3b65c58d9ee26c3ff5b32ee1c91af6e516854d7bbfR29

@andig andig merged commit fd33a0d into master Jan 24, 2024
6 checks passed
@andig andig deleted the feature/tesla-new branch January 24, 2024 11:09
@bicaluv
Copy link
Contributor

bicaluv commented Jan 24, 2024

When generating the new API token using https://tesla.evcc.io/, which check boxes do I have to tick? All or only the ones with wakeup and charging data?

@infinus
Copy link
Contributor

infinus commented Jan 24, 2024

I also get: "creating vehicle Infinus failed: cannot create vehicle type 'template': cannot create vehicle type 'tesla-command': cannot get vehicles: unexpected status: 421 (Misdirected Request)"

@andig
Copy link
Member Author

andig commented Jan 25, 2024

@infinus please open issue with trace log for Tesla. Which region are you located in? Sounds like teslamotors/vehicle-command#131.

@infinus
Copy link
Contributor

infinus commented Jan 25, 2024

@infinus please open issue with trace log for Tesla. Which region are you located in? Sounds like teslamotors/vehicle-command#131.

Yes exactly what I am thinking and what I referenced in my other post. I will open an issue.

@Sammy990

This comment was marked as off-topic.

@andig
Copy link
Member Author

andig commented Jan 27, 2024

Closing here since this has been implemented.

@evcc-io evcc-io locked as resolved and limited conversation to collaborators Jan 27, 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 this pull request may close these issues.

Tesla Integration via official vehicle-command library
8 participants