Tesla integration and API session key generation

Can somebody confirm if the Tesla integration into Home Assistant is working 100%. I’m referring to the authentication issues and in particular to the session keys which are only valid for 8 hours. Is there a solution within Home Assistant to regenerate the session keys continuously?

I use the tesla integration to monitor my powerwall. It works fine and I only had to generate a key once - that was a few months ago.

Can’t remember all the details but used the ‘Auth for Tesla’ iphone app to get the key.

Bit more…

There are two Tesla integrations - I’m using this one Tesla Powerwall - Home Assistant which doesn’t need the key - it only monitors the powerwall - can’t control it.

I previously used this one GitHub - alandtse/tesla: Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login. which did require the key but have since deleted it (as I don’t need its control features)

Hope that is more clear

Thanks for the feedback. I forgot to mention in my original question that I want to monitor and control my Tesla car, not the powerwall. Maybe there is a difference in API. What I understood is that indeed you generate a session key with some 3rd party application, but due to changes within Tesla, the key is only valid for 8 hours. In other words, the session key generation needs to be automated somehow. And I was wondering if this is integrated/supported within Home Assistant?

I use the Tesla Integration and it has been working continuously, and properly reports status. I never need to restart the Integration, other than when there are updates.
One thing I like is that when there is a Tesla car firmware update I can initiate that update from HA.

1 Like

Just installed the Tesla custom integration into HA (after installing/enabling HACS) and configured the tesla car with the refresh token. When I had generated the tokens there is a statement it is valid for 8 hours. I will see tomorrow (after 8 hours) if the connection with the car is still there :slight_smile: I will let you know the outcome.

The next morning, more than 8 hours later, Home Assistant is still able to communicate with the Tesla car without generating a new API / Session key. Also restarted HA and no changes. So this seems to be working stable. Nice. Next step is charging the car based on unused energy from the solar panals :slight_smile:

1 Like