-
-
Notifications
You must be signed in to change notification settings - Fork 555
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 Wall charger (TWC3) support via vehicle-command API for Tesla vehicles #11846
Comments
It will be good if this is implemented to control charging, as the charging is then controlled directly on the vehicle itself. That means any charger (including mobile chargers) can work with a Tesla vehicle, very much like Charge HQ. |
Couple of things:
|
Hi @andig if you need someone to test, you are welcome to get in touch. I have two evcc instances available, each with a TWC3 and a Tesla. |
Problem is that in order to send vehicle commands, one must have the private key corresponding to the public key installed on the vehicle. That private key is a SECRET. One way of not distributing the secret might be running a vehicle command proxy (see https://github.com/teslamotors/vehicle-command/tree/main/cmd/tesla-http-proxy). Not sure if thats doable- needs more investigation:
...which would bring us to client certificates. |
This sounds promising, the app would run the proxy or is it something EVCC needs to host? |
@infinus yes I plan to, I'm away for a few days and for some reason it seems I can't ssh into home 😔 |
Sounds great, can't wait to test it :) |
@andig May I suggest a creation of Template based on Tessie API? https://developer.tessie.com/docs/about Thanks! ;) |
Tessie has private servers and can host the client secret which is needed and should not be shared. EVCC is open sourced and usually run at home so they have can’t protect those like Tessie can. They are looking at setting up a proxy but that it a work in progress. It is much easier for projects like Tessie, teslafi, or Optiwatt to introduce these changes than open source projects like EVCC or Teslamate. It’s trying to find a delicate balance between ease of use, privacy, and security. |
This proxy seems promising! |
Feel free to open a PR for Tessi integration. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@haroldboom this Issue is about TWC. Please don't cross-post. Tesla integration is confirmed working. Feel free to share login information with info@evcc.io for further diagnosis. |
@manuelmrmorgado re Tessi that would mean that the old Tesla integration would continue to work 1:1 by swapping the URL. That's an interesting idea. |
...which is why this issue exists. |
This comment was marked as resolved.
This comment was marked as resolved.
No and that‘s why we have this issue open. It is not about login errors! |
Hi @andig is the proxy in the nightly or still in draft stage? |
See PR- it is nowhere yet. |
Don't know if it helps, but here they are also looking at a solution with a proxy: |
Small thing. It would be good if tesla.evcc.io had an english translation. I missed the TWC step the first time. Working 100%. You @andig sir are a true gentleman! 🧐 |
I did not need to revoke existing. Did you continue below and add the virtual key using the QR to add it in the Tesla app? |
No i missed that last step as I cannot read German :) I updated the above comment. |
I had to have my browser translate the page to English so I could read that part. |
Is anyone else getting server errors from the proxy? |
I am not seeing that or any other errors. |
Hmm something has gone wrong. It was working for a short while, now: |
It appears the car went to sleep and with the proxy it doesn't wake. I restarted the EVCC service and got the following
|
Yes, if I wake the car via the moble app then the charging control starts working properly again with no intervention on EVCC from me. So we have a minor wake the vehicle issue :)
|
Hi all, I also have the same issue, EVCC cant wake the vehicle to charge. If I wake manually with the app it will start. Also getting the |
No errors for me so far, but I will test this. As soon as I run out of sunlight today, I will set my car to higher than the current SOC. I'll leave it alone until tomorrow and see if it wakes up to charge when there is enough solar. I generally get enough sun by 10AM (PST). |
I just let the car go to sleep and switched EVCC to fast or minpv and that forces the error for me |
I can also confirm that vehicle control works after installing the virtual key. Thanks for the great work! |
Yes I can replicate the same too. |
OK I can replicate it as well. That is not something I will do normally so I am going to continue my planned test, but I expect I will see that same error. |
I think the vehicle is also going to sleep while charging and EVCC cant change the current, see below Feb 16 04:05:07 testrig evcc[630]: [lp-1 ] ERROR 2024/02/16 04:05:07 max charge current 27A: Post "https://tesla.evcc.io/api/1/vehicles/LRWYHCFS3NC428511/command/set_charging_amps": net/http: request canceled (Client.Timeout exceeded while awaiting headers) When I opened the app and woke the car up the errors stopped |
I am apparently also on the new API because it stopped working recently and I have been following this issue. I have now done everything exactly according to the instructions but my vehicle is only specified as a guest vehicle. Can anyone help me? |
Did you install the nightly build, setup the car again with the new template and new tokens? |
I have done the following: Could it be because I only did a normal update to 124.2 and the unstable nightly is not integrated? |
Of course - as always with new implementations |
The changes are only in the nightly for now. You have to switch the release channel to get the new integration. |
I assumed, since it is already on the homepage, that it works without nightly. I'll be patient until it's official. Thank you |
Its not working properly anyway (vehicle wakeup). |
Sorry - but I also have a stupid question: |
@andig Great, after the change everything works perfectly. The virtual key is created via the evcc page and you can add it in the Tesla app. The control via evcc also works so far :) Many thanks for your work! |
Until your car goes to sleep ;) |
@yipikaye please open new issue with trace log. I guess api responses are different than before and hence we may not be detecting this. Handling on evcc side hasn't changed afaia. |
New issue here: #12294 |
Yes, as expected, I did see the error when I had enough excess solar to start charging. After waking the car up with app, charging started. |
Is your feature request related to a problem? Please describe.
The introduction of the Tesla vehicle-command SDK has changed the APIs for Tesla vehicle management. The TWC3 charger cannot be controled via EVCC and must be managed via changing the charging parameters on the Tesla vehicle via the SDK. The new SDK requires additional Public/Private key pairs and authority from the user for EVCC to manage the vehicle.
Describe the solution you'd like
The new vehicle-command SDK is only implemented in a read-only implementation. Read-write is needed to re-indroduce the EVCC functionallity that existed with the old API. The API gateway is now region specific so additional checks are needed to use the correct gateway: You can query the users region and appropriate fleet-api URL so you should be able to dynamically assign it
https://developer.tesla.com/docs/fleet-api?shell#region
Describe alternatives you've considered
Other projects are also tackeling this same challenge. To date there are implementations by;
Additional context
Thank you
The text was updated successfully, but these errors were encountered: