Tesla API for own vehicle?

Hi, people :slight_smile:

What is the current status of accessing the Tesla API from Node-Red, without going through Tessie, Teslemetry, or similar? In my case just for a single private vehicle.

I signed up at the Tesla developer portal, but I can't get the authentication, access token, refresh token, etc. to work. And the current Tesla node (contrib) seems to crash Node-Red every time it can't get an access token.

I've tried researching this. But I can't really find any current information. And node-red-contrib-tesla as well as TeslaJS look like they are rather old, and from before the new Tesla API.

Do anybody have this working? Suggestions? Hints?

1 Like

I had it working about two years ago, with the newer authentication, but later disabled the whole flow part. I guess I was just lucky considering my know-how.

My first line of investigation would start here: tesla contrib nodes: GitHub page
Check the list of issues. Open a new issue with as much helpful information as you can provide.
Sometimes there are others than the author who can help.

Another line of investigation is here: TeslaJS Github Page

Kind regards,

Urs.

BTW: I started that project, because I wanted to optimise the usage of my self generated solar power. The Tesla internal processor needs a huge amount of power while active, more than my entire household during night-time. Therefore I stopped the whole thing, although it was an interesting experience.

Thanks. That seems to be the one with the oldest activity, but it does have the issues page enabled, which is not the case for the newer fork, it seems. I will try that node as well, and perhaps create issues. But I feel it is not so correct to create an issue just asking "what is the current status - does it work?" :slight_smile:

BTW: My intentions are along the same lines, plus I wanted to see if I could unlock the charge port efficiently through the API. I am using enode now, but wanted to see if the direct approach is better. It seems to me (without confirming for sure) that my car is, at least partially, awake when charging. I think it says asleep in the app, but I still get charge level updated through enode.

1 Like

I checked my old flow and extracted the most simple case with inject -> Tesla API -> debug
I used the iOS Tesla Auth App to create a token and entered it at the account settings of the node, close, deploy.
According to the docs this should give me a populated dropdown list with a single entry, the VIN of my Tesla. But the list is empty, and whenever I click on it, node-red crashes.
When I click on the inject node I get the error message 'Precondition failed', which I somewhat understand since I did not select a VIN number, see above.

In the end, I'm stuck at the same place as you, except that here is the end of the road for me as far as my understanding goes.

The crashing of node-red is certainly worth raising an issue at the GitHub page of that node.

Urs.

I was able to move one small step ahead:

  • the drop down list is now populated with the entry of my tesla
  • node-red does not crash anymore when I click on that list
    I still get the 'Precondition failed' error message.

I read through parts of that issue.
Somewhere in Jan 30 there is a hint about changing some URL in the code of teslajs.js.
I searched for the library on my raspberry and changed 'vehicles' to 'products' in four places. After a node-red restart (which it does automatically after it crashes) I reached the next phase as described above.
Now other duties call and I have to leave it at this.

1 Like

Thanks a lot! Looks like there is, at a minimum, some work to do :slight_smile: