node-red-contrib-tesla
node-red-contrib-tesla copied to clipboard
API deprecated, Tesla will end support per 1/2024. How to move on?
https://developer.tesla.com/docs/fleet-api#2023-10-09-rest-api-vehicle-commands-endpoint-deprecation-warning
Following the release of Tesla Vehicle Command SDK support for REST API vehicle command endpoints is now reaching end of life. Starting 2024 most vehicles will require sending commands via Tesla Vehicle Command SDK.
Are there plans to revise node-red-contrib-tesla? Or do we have to assume that node-red-contrib-tesla will stop working at the beginning of 2024?
Good question. I haven't given this library much attention lately, but I am not giving up on it either. I will do some reading and let you know.
Any update?
I am not able to use commands, they result in 403, probably because of the deprecation of REST API's. Any plans for supporting the Tesla vehicle commands protocol?
I am assuming not much you can do, as probably the underlying TeslaJS library would need to support it...?
I confirm that the old API has been turned off and this node no longer functions.
@onokje we need word from you, ether that you will look into this and find a solution, or that we have to move on to other solutions and abandon node-red-contrib-tesla
Starting today it seems Tesla changed/deactivated the "old" API.
It stopped working and the node reports "Precondition failed". Even worse my node-red instance crashes each time I try to open the configuration node to add/change the tokens.
Any plans to work on it, any help I can provide?
Hi all, I will definitely take a look, because I still use this myself :) Unfortunately I don't have a lot of time right now, so any help is appreciated.
TeslaJS folks are aware too, looks like they need to figure out auth first. https://github.com/mseminatore/TeslaJS/issues/353
Sorry to read this, I don't even have my Tesla yet, and new to Node Red. At least you confirm the Precondition Failed return came from Tesla so I must have some configuration correct. (What a horrible choice of words when Precondition already has meaning for Climate and Battery, couldn't they dream of a different word for the API?)
I know it has subscription cost, but maybe node-red-contrib-tesla could use the Tessie API and shift the burden to them when Tesla changes their side. I've looked at Tessie and they expose their own API.
@fascenda The "Precondition failed" is an node internal error as it cannot get a valid result authenticating to the API. Sadly this also leads to a crash of whole node-red due to a seemingly unforeseen condition.
There is IMHO no need to change to some paid third party API. There is still a Tesla API, but just the endpoint and syntax changed. There is now a fleet API endpoint for companies, and also some other possible entry ways.
Thanks @Lineflyer I did understand THAT use of Precondition was relating to the API, okay I see now it's HTTP response 412. Up until that I was getting a variety of other failures, so I call it a success that I got the error. (Along the way, I did have some crashing or hangups in the flow editor and had to restart node-red a few times.)
I agree relying on some subscription product would be best to avoid, as a long-retired software dev, I favor open source wherever I can find it. I just installed an OpenEVSE and also EmonCMS on a Raspberry PI for collecting data. That's where I will be collecting my Tesla data. As I said I don't even have the car yet just getting electric service upgraded and learning all this great software.
The API was really great. You have been able to get all relevant (and even unrelevant) information about the current state of your car. For example: You even got the currently played song title ;) I hope there will be a a way to get that back again...maybe its already possible right now, but I am not technically fit enough to implement a new API myself.
I don't understand how the integration still works (all I needed to do was get a new refresh token). I can't seem to reconfigure the config node with this token though. And, unfortunately, I cannot delete it completely because even though all the nodes are deleted, it still shows "in use." Is there a way to reconfigure or can someone help me delete?
@Lineflyer I read the Tesla "unofficial" API docs and I did see all the things you could do like see what's on the radio. I've been reading some of the updated docs, and again I don't have a Tesla (yet) so I'm only taking some of my past software experience and trying to learn/understand what I find in online documentation. It seems as if Tesla API will now only work with requests from known domains, so something like TeslaFi or Tessie (or many others) that have registered URL could gain access to it. That doesn't sound hopeful for our private servers running Node RED.
Which is what was on my mind when I said maybe going via Tessie is the solution, and I understand there is cost there. And I won't be surprised if Tesla starts charging for use of their API, which will potentially increase the cost of these middleware apps. Software has come a long way since I started my software career (40+ years ago). Subscription ($$$) is the way everything is going.
I've set up my system to move excess solar to the car automatically and that means having access to change amps, something I can't see how to do via tessie right now.
I have started this weekend a node-red mock-up that uses same messages content as this project do but using the new fleet API.
SInce now, it seems working, but there still have some work to achieve to package it for its distribution...
The job is not so huge to get it working, then something should come quite soon as a plug and play substitute of this node...
Just be a bit patient, as I never coded a new node type. Maybe someone could help a bit?
BTW, I have found some mistakes in teslamotors api documentation too, I still have to signal it to them to let them fix it.
After this fleet API working with nodered, the telemetry API would be next challenge... Or the fleet API for recent models (I have a 2019 model S) then I do not need it (yet).
Le mar. 30 janv. 2024 à 19:56, fascenda @.***> a écrit :
@Lineflyer https://github.com/Lineflyer I read the Tesla "unofficial" API docs and I did see all the things you could do like see what's on the radio. I've been reading some of the updated docs, and again I don't have a Tesla (yet) so I'm only taking some of my past software experience and trying to learn/understand what I find in online documentation. It seems as if Tesla API will now only work with requests from known domains, so something like TeslaFi or Tessie (or many others) that have registered URL could gain access to it. That doesn't sound good for our private servers running Node RED.
Which is what was on my mind when I said maybe going via Tessie is the solution, and I understand there is cost there. And I won't be surprised if Tesla starts charging for use of their API, which will potentially increase the cost of these middleware apps. Software has come a long way since I started my software career (40+ years ago). Subscription ($$$) is the way everything is going.
— Reply to this email directly, view it on GitHub https://github.com/onokje/node-red-contrib-tesla/issues/67#issuecomment-1917691759, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADUNWNJAPFM4MYWEFNYHSMTYRE65LAVCNFSM6AAAAAA6BGRZ7SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJXGY4TCNZVHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@GaPhi That sounds great. Pergaps you should put your work on a pull request for this repository so that @onokje can take care of the packaging into a new version of this node?
I have made a few attempts: After I changed the url from "vehicles" to "products" in line 662 in teslajs.js, the "vehicle or device" list worked again and node-red did not crash.
exports.vehicles = function vehicles(options, args, callback) {
exports.get(options, '/api/1/products', null, callback);
}
I used @GaPhi fork of this tesla implementation. After this it was possible to set charge amps and other commands. Getting vehicle data was not possible yet, but have just started.
Here is my mock-up flow, working with my own other flows... but probably not enough robust or well-packaged yet, and without any explanation about how to configure it... But if you are able to follow teslamotors partner registration process, you should be able to get it work too.
If some contributors are interested, we can set a little project up to progress faster. The idea is to create 2 nodes :
- tesla-api (compatibility with this github)
- tesla-fleet (more efficient/evolutive one) And configuration nodes for Client ID&Secrets/Regions/Domains&Callbacks.
Here is the file (copyright myself) flows.json
I've set up my system to move excess solar to the car automatically and that means having access to change amps, something I can't see how to do via tessie right now.
Have you looked at: https://developer.tessie.com/reference/set-charging-amps ?
... But if you are able to follow teslamotors partner registration process, you should be able to get it work too.
Isn’t that the main problem? Will Tesla really allow thousands of individual users register as “partner”? I think not.
I have made a few attempts: After I changed the url from "vehicles" to "products" in line 662 in teslajs.js, the "vehicle or device" list worked again and node-red did not crash.
exports.vehicles = function vehicles(options, args, callback) { exports.get(options, '/api/1/products', null, callback); }
I used @GaPhi fork of this tesla implementation. After this it was possible to set charge amps and other commands. Getting vehicle data was not possible yet, but have just started.
Where is this .js file located? (Using Home Assistant) I'd like to try that.
I have made a few attempts: After I changed the url from "vehicles" to "products" in line 662 in teslajs.js, the "vehicle or device" list worked again and node-red did not crash.
exports.vehicles = function vehicles(options, args, callback) { exports.get(options, '/api/1/products', null, callback); }
I used @GaPhi fork of this tesla implementation. After this it was possible to set charge amps and other commands. Getting vehicle data was not possible yet, but have just started.
Where is this .js file located? (Using Home Assistant) I'd like to try that.
I am running Node Red in a docker, and found the file at /data/node_modules/@gaphi/teslajs/teslajs.js
. Check where palettes are installed and you will find it. Otherwise, just do a find -name teslajs.js
in the root (/
) of the filesystem and find it that way.
I just did this change and it has worked for me as well.
Thanks. I started digging while waiting and found it. Giving it a try. Do I need to restart Node Red first?
Thanks. I started digging while waiting and found it. Giving it a try. Do I need to restart Node Red first?
Perhaps. After I did the edit, I tried it which crashed my Node Red again, effectively restarting it. After that, it worked for me.
Seems to have worked. I'm going to replace some spots in my flow and see how it does overall. Thanks for your help!
Now, can someone tell me how to vent the windows using this API? Unfortunately I deleted all my old nodes and now I keep getting "missing command param" when I try. The climate setting works just fine.
I've tested most of the other options and they seem to work . It almost seems like the specific command "windowControl" isn't working for some reason.
Seems to have worked. I'm going to replace some spots in my flow and see how it does overall. Thanks for your help!
@bkr1969
Does this mean, that this simple change made the whole node-red-contrib-tesla
work again for you?
Everything but the windows control (that I've tested so far).
Ok, are you refering only to commend sending, because I would be mostly interested in retrieving the vehicle status (such as battery_state, climate_state, etc.) rather than sending commands.