Handle Tesla Fleet Authentication Failures #486
BJReplay
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
|
This is a present thing for me. Thanks, BJ. This has been a thing in the past, IIRC. I love that integration, and grumble at it in transient moments like this; it is quiet as a mouse until it hollers and breaks shit. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Slightly OT: If you've got a Tesla Powerwall and are struggling with Fleet API authentication failures (there's a fix coded, but not yet available in Home Assistant), the automation below is a temporary workaround.
The underlying problem is that there is a timing issue with authentication caused by flaky responses from the Tesla servers that falls through as a failure, when it could be handled by the integration by using the refresh token.
Restarting Home Assistant or reloading the Tesla Fleet integration both force the integration to use the refresh token, and most of the time this fixes the authentication problem.
This automation automates the reload for you, so you won't even notice that it is required.
However, for you to set it up, you'll need to wait until you've seen the repair issue raised, so that you can look at the issue ID in developer tools as you'll need that to customise the automation.
You'll also need to select your Fleet Integration to finish the customisation.
Then, run the automation, and the repair should close.
Firstly, you almost certainly need Spook installed from HACS and the integration set up:
To find out if you do, go into Developer Tools States:
and search for the following entities
If you have them, you won't need spook, but if you don't, you will.
If you need spook, grab it:
It's possible that since I installed it, the sensors that it provides that this relies on have now been included in Home Assistant via Labs, but I believe that Spook is required.
Once you've got spook, or confirmed you've got the entities, you need to find your issue_id for the Tesla Fleet reauth repair.
Here's mine (partly redacted):
You'll need that issue_id to customise the automation.
You should be able to find it if it was the last repair - even if you've already run the repair.
Here's the automation in yaml:
And here's what it looks like:
You'll need to select your Tesla Fleet Integration from the drop down to complete the automation.
Once set up, when a repair is created or updated, if it is for the Tesla Fleet Reauth problem, this automation will automatically reload the Fleet API integration, which should cause the integration to use its refresh token to handle the reauth for you.
I set mine up yesterday, ran it manually when the repair was already there, and it fixed it, and it triggered automatically this morning, confirming that the trigger logic works.
Beta Was this translation helpful? Give feedback.
All reactions