[APP][PRO] Tesla - Zero emissions. Zero compromises

Hi, sorry for the late answer.

I checked the access token data and it should be valid for 8h.
But that’s only the access/Bearer token.

Any further request will automatically refresh the access token after a http 401 response using the stored refresh token.

I have no idea why in your case the refresh token is invalid.
It looks as if your refresh token (stored in car device data) is somehow cleared or gets invalid caused by other reasons. Normally this happens if you remove the Homey app from your Tesla account or if you change the passoword of your Tesla account. :man_shrugging:

Do you think it could be something to do with the fact we have 2 cars, and we are both owners on our own cars so when I connect I don’t have “owner” on the other car? I’m not sure that would be the reason because it seems to add fine, and the token kicks me off my own car as well. Neither of us remove the app or change the password

Very odd!

thanks

Very strange.

I have two cars with different owner. I added both with my account (1 owner, 1 driver).

Technically, every car has its own oAuth memory. This way you can add cars from diffrrent accounts. That’s why it should work - in theory :sweat_smile:

I will search and ask on Slack…

I think I found a possible reason. Perhaps the token refresh ist started twice for a device. Let me prepare a fix this evening…

Interesting! It’s strange few (if any) have the same issue… Thanks a lot for your efforts

New test version 4.1.4:

  • Minor changes for token renewal

@Peter85 FYI and test :crossed_fingers:
Perhaps you are starting flow actions parallel instead of sequential (for one car). That could cause parallel requests. The change should fix this - if that was the reason.

Brilliant thanks for this I’ll give it a try! We only usually execute for one car at a time, e.g. preheat, keep doors unlocked, open boot, turn house heating off etc.

I’ll let you know :+1:

Hi, just thought I’d touch base and say that error hasn’t happened since which is good, but I have had some odd random behaviour, such as having to run automations twice for it to work, and this morning I got MESSAGE_FAULT_ERROR_INVALID_SIGNATURE which I’ve never seen before, but I ran it again and it was successful :exploding_head:

Going to keep testing it over the next few days thanks for your help!

Invalid signature for commands is often caused by a long delay while sending the command - the signature has only some seconds lifetime.

If “auto wake up” is set for car device, a wake up command is sent first. The following can be processed then.

I can imagine that the car is not reachable in time (while Tesla server tries to send tje command to the car). I have seen such send issues if the car is at the end of Wifi range and is switching between Wifi and LTE.

Just wanted to circle back and say that it’s seems to have been resolved, thank you, much appreciated!

I did indeed have auto wake up on, and my flows sent manual wake commands. I’ve kept the flow wake up so I can see wake progress visually.

Hi Ronny, since a few days, the value for estimated battery range is zero. When checking the graphs, I see that the range was not updated for a few days before it was set to 0. The optimal battery range value is still updating though. Is this a known issue?

App v1.4.1

Model y software 2026.14.3

Are you using Telemetty or FleetAPI (polling)?

Edit: Just saw that my Teöemetty was also not updating. The online/offline state was, but not car data.

It seems, the car stops sending after a while (Telemetty subscription seems to have a timeout after several days). I have to check that.

As adhoc solution: deactivate Telemetry in debice settings, savd, activate again and it should be fixed.

Hi, I’m not using telemetry but the fleetapi. It is only this one value that is not updating. Other values do update: see screenshot: 10 hours versus 8 days

The API still lists est_battery_range as response field.

But I also don’t get it via polling :thinking:
Looks like a FW bug. Let’s wait for a new version if it’s fixed then.

And it seems, the telemetry data also doesn’t get updates for this field. The car seems not to send it at all.

Has anyone got past this problem yet please?

If I remembet right, the car is registered in a region (North America, Europe, CN). The user account must also be registered in this region.

Do you have a leased car or a car imported from another region?

We also had similar cases where the account was created in another region. But I don’t know if this still works. It’s a bit tinkering with browser console :face_with_peeking_eye:

yeah, I did some research on it before posting. I was wondering if anyone had a quick and easy way, or a script already knocked up that will register account in both regions.

To answer the question, mine is a leased Tesla through Octopus. I am UK based.

My account must be EU based, while the car is probably registered on a business account based in NA. (whoever Octopus use for their tesla management Id guess)

I will see if I can get some time to knock up a quick script to try and do this. Need to find the fleet API docs first I guess. Probably in the dev account ive just registered for

Thanks for taking the time to post :slight_smile:

There is no API to change account settings.

If the browser console way doesn’t work, it would be best to ask Tesla support directly if they can switch your account to NA.

No, I dont wish to change account settings

According to their own API that I found, you are able to ‘register’ your user account to both NA and EU regions

full API docs if anyone is interested:
Tesla Fleet API

Edit: I will try that region change method you posted above though, thank you