I am also using HA in docker and using nginx proxy manager as a reverse proxy in its own container. I tried to use the tesa-http-proxy-docker but the description ist just to difficult for me. Did you install another nginx to serve the certs? Maybe you still got your config files and can share? Thanks in advance!
I posted my setup detail in an issue on the github page for tesla-http-proxy-docker, here is the direct link to my post.
Take a look there, and read through the other comments as well. If you still have questions you can post them here.
Thank you very much. I will look into it!
This isnât a step-by-step guide. Itâs mostly for myself to fill in the confusion I had when doing this so in the future if I had to help a friend or do it myself, again, I would save a lot of time.
This requires a few things
- A web server using HTTPS and a valid certificate to serve up a public key file. The path to the file is not configurable under the FQDN. Teslaâs cloud at AWS (in my case it was us-west-2) will need to access this file. From my understanding it has to be always online, not just for initial authentication. An example URL : https://tesla.mydom.com/.well-known/appspecific/com.tesla.3p.public-key.pem . As a side note, this could probably be blog.mydom.com as long as the file/path is correct.
- A Phone with the Tesla App to assist when running through the auth process
- HASS Tesla custom integration installed and unconfigured.
- Tesla HTTP Proxy software - I used the addon but a lot of the information here applies to the docker version
- You probably also have to be the primary account for the car on tesla.com. I didnât test on a secondary account.
How the communication works? (I believe this is correct)
- After the public key is hosted, you can setup your developer account at https://developer.tesla.com/. Tesla will access your hosted key during the account setup.
- Then using Tesla HTTP Proxy, it will setup an auth flow and reach out to Teslaâs cloud.
- Finally, the Tesla custom integration talks to the proxy, and the proxy talks to the AWS servers.
Process I Followed (well, not actually. This is what I would do if I ever did this again)
- Install Tesla HTTP Proxy using the HASS addon.
- This generates a public/private key under /share/tesla. You now have a key for Tesla cloud to consume.
- Install/Configure the âApache2 Minimalâ addon to serve up the public key under the required path: /.well-known/appspecific/com.tesla.3p.public-key.pem
- Configure HAproxy on my edge to forward tesla.mydom.com to Apache2 Minimal.
- Using the HASS app on my phone, goto Tesla HTTP Proxy and open the link âOpen Web UIâ
- Run through the auth flow. Save the refresh token in your clipboard. This flow should also create a key in the Tesla app on your phone.
- In HASS, Open âDevices & servicesâ, select add integration. Everything was filled in here for me already because I used the addon except for the refresh token which you paste in. (you saved it in a previous step)
- Done.
Issues I had and solutions:
- I read docs, github issues, etc. I didnât have a good high level understanding of how this was supposed to work. Hopefully the introduction covers this.
- Running through the auth flow and on the phone app you get âunable to share vehicleâ. I fixed this by going into Tesla HTTP Proxy configuration and enabling âRegenerate Tesla authenticationâ.
- The HASS app on my phone got locked into the Tesla HTTP Proxy Addon auth-flow screen and I couldnât exit even if I killed the app. To get the app working again, I stopped the addon from my desktop computer and then restarted the app.
Hello im using nginx proxy manager my self a create a subdomain on cloudflare of may domains tesla.mydoamain.com and used tesla-http-proxy-docker pointed the nginx proxy manager to my local ip 192.168.1.5 port 4430 (tesla-http-proxy-docker port) still not able to make it work im getting 502 on tesla-http-proxy-docker logs any idea?
Why use Apache2 Minimal and not nginx reverse proxy ?
HA 2024.08 has a new Tesla Fleet integration.
Might be easier to setup: Tesla Fleet - Home Assistant
Iâve just set it up - it was trivial. Itâs only limitation is that it can only poll 200 times/day. And for the moment it doesnât support commands to the car yet:
It works for me only to point where I need link with callback. When Iâm trying to generate token it says invalid code no matter what I paste there. Any suggestions?
I have public key on my website in folder as per spec and it works. Itâs just callback link Iâm having issue with. Any suggestions?
Thanks for your hard work. It would be perfect if it was possible to control the charging amps and the limit charge percentage. I used to use that on automations to keep the flow of electricity balanced with family usage with tesla custom integration. I am already following your integration in hopes that this is implemented there and that I can fully migrate from tesla custom integration to yours. Is there any way this can come to your integration?
Here are the steps I used to set up my HA with Fleet API using DuckDNS, Nginx Proxy and Tesla HTTP Proxy. It took a few days of tinkering to figure it out so I figured it might be worth sharing my steps. I also included a diagram of all of the things that have to be set up, to hopefully make the system easier to understand.
I wrote up the steps on Google Docs for easier editing & commenting: Setting up home assistant with tesla - Google Docs