[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.