Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Home Assistant Integration(s)

This site may earn commission on affiliate links.
I'll try turning the wifi off on the router so the car is not connected to any access point at all and see if anything changes.
I don't think wifi can wake up the car once it goes to sleep. It may keep it awake, but as your car is actually sleeping sometimes it seems unlikely this will be the cause. You may want to think about changing the password on your Tesla account to force all connected apps to log out. You'll need to regenerate tokens for the apps you want to use, but at least you'll be certain nothing else is communicating with the car that you may have forgotten was connected.

I don't know what the status of generating API tokens is at the moment though. There have been posts from some with issues, not sure if they were one-offs or a general API issue. Worth reading back in some of the threads if you intend to go that route I guess.
 
I don't think wifi can wake up the car once it goes to sleep. It may keep it awake, but as your car is actually sleeping sometimes it seems unlikely this will be the cause. You may want to think about changing the password on your Tesla account to force all connected apps to log out. You'll need to regenerate tokens for the apps you want to use, but at least you'll be certain nothing else is communicating with the car that you may have forgotten was connected.

I don't know what the status of generating API tokens is at the moment though. There have been posts from some with issues, not sure if they were one-offs or a general API issue. Worth reading back in some of the threads if you intend to go that route I guess.
I know 100% that the cause of this non-sleeping is Home Assistant. As soon as I disable the integration the car sleeps perfectly fine.
 
hmm..I use the Tesla Custom Integration via hACS. but what I notice, thre is massive delay for data polling. For example, polling is set to 660 (so 11 minutes). but even I unplug charger - 12 minutes later dashboard shows that car is plugged in...

I wonder if anyone uses any automation based on Tesla custom integration to automate charger off if for example IO dispatch is off?

Idea is how to check ca polling and other things once I arrive home, plug in my dumb charger? any ideas?
 
Idea is how to check ca polling and other things once I arrive home, plug in my dumb charger? any ideas?
There's a force_data_update button entity you can use to pull the latest info from the API. It does wake the car though, so best to only use it if you need to.

I don't have IO, but wouldn't you stop the charge based on when the dispatch is off with the Octopus integration rather than checking anything from the car side?

Edit: Or do you mean stop immediately after plugging in if IO dispatch if off? If so the automation would likely be something like - If car is at home & status changes to charger connected, check IO status, if dispatch off stop charging.
 
There's a force_data_update button entity you can use to pull the latest info from the API. It does wake the car though, so best to only use it if you need to.

I don't have IO, but wouldn't you stop the charge based on when the dispatch is off with the Octopus integration rather than checking anything from the car side?

Edit: Or do you mean stop immediately after plugging in if IO dispatch if off? If so the automation would likely be something like - If car is at home & status changes to charger connected, check IO status, if dispatch off stop charging.
Yes, idea is to stop charging as soon as it is connected at home and dispatch is off

Thing is that "car at home" and "charger connected" could be visible to HA after 10-15 minutes since it is connected and already charging, depending on polling (I presume).. hence issue

For now of course, scheduled charging can be the solution...
 
Yes, idea is to stop charging as soon as it is connected at home and dispatch is off

Thing is that "car at home" and "charger connected" could be visible to HA after 10-15 minutes since it is connected and already charging, depending on polling (I presume).. hence issue

For now of course, scheduled charging can be the solution...
When I was using the Tesla IO integration, I used an automation to stop charging when plugging in if there wasn’t an active dispatch period. This was before I started using MQTT via Teslamate and I found it updated pretty quickly. The poll time was the default 660s.
 
FYI for anyone using the HACS Tesla Integration, version 3.20 will require the generation of a new authentication token:

I just updated to the latest version, however it didn’t ask for a token. Seems to be working, though…

Edit: spoke too soon! A few minutes after restarting, even though it was able to update the status initially it then prompted me to re-authenticate using a refresh token.
 
Last edited:
  • Like
Reactions: Medved_77
In one of the open issues on the github page it linked to this python script that can be used on a desktop to generate a token. I haven't tried it. Someone reported that it worked for them.

source: [Docs] Update Tesla Refresh Token Generator list · Issue #879 · alandtse/tesla

This integration is great. I've been using it to disable overheat protection when the car is at home in our garage and re-enable it when not at home. Also to get a notification of ETA when the car is heading home while I'm home but someone else is driving it. And lastly, when the battery is below a certain SoC and the car is at home and not plugged in I have it remind me via notification to plug it in. That last one is now redundant since Tesla implemented something similar in their app.
 
I just updated to the latest version, however it didn’t ask for a token. Seems to be working, though…

Edit: spoke too soon! A few minutes after restarting, even though it was able to update the status initially it then prompted me to re-authenticate using a refresh token.
Have you got it working yet?

When I first set up the integration I used the iPhone app Auth for Tesla to generate tokens. This now has a Fleet API section that requires logging in to your Tesla account and then generates tokens. Any ideas if that will work with latest HA integration?
 
Last edited:
Have you got it working yet?

When I first set up the integration I used the iPhone app Auth for Tesla to generate tokens. This now has a Fleet API section that requires logging in to your Tesla account and then generates tokens. Any ideas if that will work with latest HA integration?
I used the Auth for Tesla app, but gave it the Owners API token. Worked straight away.
 
  • Like
Reactions: notmeguv
I think I messed it up! I ticked the box for Fleet API before I posted here earlier and now it’s asking for extra fields as below. I can’t find a way to get back to the first screen to uncheck the Fleet API box.

IMG_0858.jpeg
 
I think I messed it up! I ticked the box for Fleet API before I posted here earlier and now it’s asking for extra fields as below. I can’t find a way to get back to the first screen to uncheck the Fleet API box.

View attachment 1030699
I used this site to generate an API key for the owners API:

If you car is on the Fleet API, there's instructions here for setting up the Fleet API Proxy:
 
I used this site to generate an API key for the owners API:

If you car is on the Fleet API, there's instructions here for setting up the Fleet API Proxy:
I can generate an owners API token ok. The problem I have is that I checked the ‘Fleet API’ box in the HA configuration to see what was needed and now I’m stuck in the screen that needs the additional Fleet API details.

My car might not even be on Fleet API but I can’t get back to the first screen to uncheck the Fleet API box. So at the moment I can’t try the owners API token.