Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API deprecated, Tesla will end support per 1/2024. How to move on? #67

Open
Michael-K-at-GitHub opened this issue Oct 15, 2023 · 88 comments

Comments

@Michael-K-at-GitHub
Copy link

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?

@onokje
Copy link
Owner

onokje commented Oct 17, 2023

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.

@Michael-K-at-GitHub
Copy link
Author

Any update?

@andrasg
Copy link

andrasg commented Jan 19, 2024

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

@Michael-K-at-GitHub
Copy link
Author

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

@Lineflyer
Copy link

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?

@onokje
Copy link
Owner

onokje commented Jan 23, 2024

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.

@andrasg
Copy link

andrasg commented Jan 23, 2024

TeslaJS folks are aware too, looks like they need to figure out auth first.
mseminatore/TeslaJS#353

@fascenda
Copy link

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.

@Lineflyer
Copy link

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

@fascenda
Copy link

fascenda commented Jan 28, 2024

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.

@Lineflyer
Copy link

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.

@bkr1969
Copy link

bkr1969 commented Jan 30, 2024

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?

@fascenda
Copy link

fascenda commented Jan 30, 2024

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

@ASomerN
Copy link

ASomerN commented Jan 30, 2024

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.

@GaPhi
Copy link
Contributor

GaPhi commented Jan 30, 2024 via email

@Lineflyer
Copy link

@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?

@dnlschmdt
Copy link

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.

@GaPhi
Copy link
Contributor

GaPhi commented Jan 30, 2024

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

@bikeymouse
Copy link

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 ?

@bikeymouse
Copy link

bikeymouse commented Jan 30, 2024

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

@bkr1969
Copy link

bkr1969 commented Jan 30, 2024

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.

@RobReus
Copy link

RobReus commented Jan 30, 2024

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.

@bkr1969
Copy link

bkr1969 commented Jan 30, 2024

Thanks. I started digging while waiting and found it. Giving it a try. Do I need to restart Node Red first?

@RobReus
Copy link

RobReus commented Jan 30, 2024

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.

@bkr1969
Copy link

bkr1969 commented Jan 30, 2024

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
Copy link

bkr1969 commented Jan 30, 2024

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.

@bkr1969
Copy link

bkr1969 commented Jan 30, 2024

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.

@Lineflyer
Copy link

The bearerToken I defined is simply used as a header information for the HTTP call as written in the Teslemetry documentation.
I defined it as follows:
flow.set('bearerToken', "Bearer " + accessToken)

So its simply your access token prepended by the string `Bearer ".

Within the http request node you have to add two headers as you may see in the screenshot:
image

I created a sample flow for you to import:

[
    {
        "id": "aa8dfd02dba5b031",
        "type": "function",
        "z": "d15d33a4fa9a8ad9",
        "name": "Build example call",
        "func": "// Call: https://api.teslemetry.com/api/1/vehicles/{vin}?token={token}\n\nlet base_url = \"https://api.teslemetry.com/api/1/vehicles/\"\nlet token = \"insert-your-access-token-here\"\nlet vin = \"insert-your-VIN-here\"\n\n// GET /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/vehicle_data\"\nlet query = \"?endpoints=charge_state%3Bclimate_state%3Bclosures_state%3Bdrive_state%3Bgui_settings%3Blocation_data%3Bvehicle_config%3Bvehicle_state\"\n\nlet url = base_url + vin + scope + query\n\nmsg.url = url\nmsg.bearerToken = \"Bearer \" + token\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 330,
        "y": 2800,
        "wires": [
            [
                "a53074dc554aa469"
            ]
        ]
    },
    {
        "id": "a53074dc554aa469",
        "type": "http request",
        "z": "d15d33a4fa9a8ad9",
        "name": "Teslemetry GET",
        "method": "GET",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "",
        "tls": "91a33722c228e6f1",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [
            {
                "keyType": "other",
                "keyValue": "authorization",
                "valueType": "msg",
                "valueValue": "bearerToken"
            },
            {
                "keyType": "other",
                "keyValue": "accept",
                "valueType": "other",
                "valueValue": " application/json"
            }
        ],
        "x": 540,
        "y": 2800,
        "wires": [
            [
                "e3633a059c5103aa"
            ]
        ]
    },
    {
        "id": "e3633a059c5103aa",
        "type": "change",
        "z": "d15d33a4fa9a8ad9",
        "name": "Remove response level from object to make it look like Node-Red-contrib-tesla",
        "rules": [
            {
                "t": "move",
                "p": "payload.response",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 940,
        "y": 2800,
        "wires": [
            []
        ]
    },
    {
        "id": "91a33722c228e6f1",
        "type": "tls-config",
        "name": "",
        "cert": "",
        "key": "",
        "ca": "",
        "certname": "",
        "keyname": "",
        "caname": "",
        "servername": "",
        "verifyservercert": true,
        "alpnprotocol": ""
    }
]

@Underground56
Copy link

Oh man, thank you sooo much!!! It's working :) And even better, I have an example now to understand whats happening and hopefully learn the rest by myself.

I would very much like to show my appreciation...

@Lineflyer
Copy link

Great to hear, have fun.
I am not so 100% happy, that I now have to use paid services to access my Tesla. IMHO not a good choice by Tesla to no longer allow indiviudals free access....the car was expensive enough...

@Underground56
Copy link

Yeah, that’s right. I was also quite wondering and annoyed that Tesla changed this service. However, other brands don’t even offer anything like that. Even things like changing charging current in the vehicle is by far not standard. So for me it is worth it…

@ChutneyMary
Copy link

Likewise, I really appreciate the sample flow from @Lineflyer. Working well now.

What's not so clear to me is how to send commands. The three commands I used previously were Start Charge, Stop Charge, and Set Charging Amps.

Any suggestions?

@ChutneyMary
Copy link

ChutneyMary commented Jun 9, 2024

Answering my own question... Here's a sample flow for Start Charge, Stop Charge and Set Charging Amps to 5 -

[ { "id": "ea0ef801d947afae", "type": "function", "z": "f18596704a26bc97", "name": "Charge Stop", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/charge_stop\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 410, "y": 500, "wires": [ [ "e00e92c60aa1e6b6" ] ] }, { "id": "84e52d1abe17ad5a", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 500, "wires": [ [ "ea0ef801d947afae" ] ] }, { "id": "e00e92c60aa1e6b6", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 500, "wires": [ [ "322dce8059e166de" ] ] }, { "id": "322dce8059e166de", "type": "debug", "z": "f18596704a26bc97", "name": "debug 20", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 500, "wires": [] }, { "id": "b8738ea936a56634", "type": "function", "z": "f18596704a26bc97", "name": "Charge Start", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/charge_start\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 410, "y": 440, "wires": [ [ "febbe529f8d92091" ] ] }, { "id": "0b31a6e235d16557", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 440, "wires": [ [ "b8738ea936a56634" ] ] }, { "id": "febbe529f8d92091", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 440, "wires": [ [ "7bd53abd0b45ca30" ] ] }, { "id": "7bd53abd0b45ca30", "type": "debug", "z": "f18596704a26bc97", "name": "debug 21", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 440, "wires": [] }, { "id": "bdcd206cecb33a1e", "type": "function", "z": "f18596704a26bc97", "name": "Set Charging Amps 5", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/set_charging_amps\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nmsg.payload = {\"charging_amps\": \"5\"}; \n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 440, "y": 560, "wires": [ [ "9c11f1d5c1c00143" ] ] }, { "id": "55f10e8fd2475f49", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 560, "wires": [ [ "bdcd206cecb33a1e" ] ] }, { "id": "9c11f1d5c1c00143", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 560, "wires": [ [ "d101e512cbe59c5a" ] ] }, { "id": "d101e512cbe59c5a", "type": "debug", "z": "f18596704a26bc97", "name": "debug 22", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 560, "wires": [] }, { "id": "91a33722c228e6f1", "type": "tls-config", "name": "", "cert": "", "key": "", "ca": "", "certname": "", "keyname": "", "caname": "", "servername": "", "verifyservercert": true, "alpnprotocol": "" } ]

@Underground56
Copy link

Great, many thanks ! The only thing for me that’s missing is how to wake up the car when sleeping. Any hint on this ?

@ChutneyMary
Copy link

ChutneyMary commented Jun 9, 2024

Try the following flow. The "if (msg.payload == 1)" in the Function node is to prevent the Wake Up being triggered on a redeploy of flows.

[
    {
        "id": "26d458d88ccdaba8",
        "type": "inject",
        "z": "e7594237b03366b2",
        "name": "On only",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1",
        "payloadType": "num",
        "x": 330,
        "y": 240,
        "wires": [
            [
                "7b307d3e82031041"
            ]
        ]
    },
    {
        "id": "7b307d3e82031041",
        "type": "function",
        "z": "e7594237b03366b2",
        "name": "Wake Up",
        "func": "if (msg.payload == 1) {\n    let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\n    let token = \"Your_Teslemetry_token_here\";\n    let vin = \"Your_VIN_here\";\n\n    // POST /api/1/vehicles/{vehicle_tag}/wake_up\n    let query = \"/wake_up\";\n\n    let url = base_url + vin + query;\n\n    // Configure the msg object for the HTTP request\n    msg.method = \"POST\";\n    msg.url = url;\n    msg.headers = {\n        'Authorization': \"Bearer \" + token,\n        'Content-Type': 'application/json'\n    };\n\n    return msg;\n} else {\n    return null;\n}",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 520,
        "y": 240,
        "wires": [
            [
                "454d77bb2ab5f4db"
            ]
        ]
    },
    {
        "id": "454d77bb2ab5f4db",
        "type": "http request",
        "z": "e7594237b03366b2",
        "name": "HTTP Request",
        "method": "use",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "",
        "tls": "91a33722c228e6f1",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 740,
        "y": 240,
        "wires": [
            [
                "66d8774d0bb5a579"
            ]
        ]
    },
    {
        "id": "66d8774d0bb5a579",
        "type": "debug",
        "z": "e7594237b03366b2",
        "name": "debug 20",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 960,
        "y": 240,
        "wires": []
    },
    {
        "id": "91a33722c228e6f1",
        "type": "tls-config",
        "name": "",
        "cert": "",
        "key": "",
        "ca": "",
        "certname": "",
        "keyname": "",
        "caname": "",
        "servername": "",
        "verifyservercert": true,
        "alpnprotocol": ""
    }
]

@Lineflyer
Copy link

Great, many thanks ! The only thing for me that’s missing is how to wake up the car when sleeping. Any hint on this ?

Its in the API documentation.
You need to do a HTTP POST with following content (in the syntax of my flows):

// Call: POST /api/1/vehicles/{vehicle_tag}/wake_up

let base_url = "https://api.teslemetry.com/api/1/vehicles/"
let token = flow.get ('accessToken')
let vin = flow.get ('VIN')

let scope = "/wake_up"
let query = ""

let url = base_url + vin + scope + query

msg.url = url
msg.bearerToken = flow.get('bearerToken')
return msg;

@Underground56
Copy link

Answering my own question... Here's a sample flow for Start Charge, Stop Charge and Set Charging Amps to 5 -

[ { "id": "ea0ef801d947afae", "type": "function", "z": "f18596704a26bc97", "name": "Charge Stop", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/charge_stop\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 410, "y": 500, "wires": [ [ "e00e92c60aa1e6b6" ] ] }, { "id": "84e52d1abe17ad5a", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 500, "wires": [ [ "ea0ef801d947afae" ] ] }, { "id": "e00e92c60aa1e6b6", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 500, "wires": [ [ "322dce8059e166de" ] ] }, { "id": "322dce8059e166de", "type": "debug", "z": "f18596704a26bc97", "name": "debug 20", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 500, "wires": [] }, { "id": "b8738ea936a56634", "type": "function", "z": "f18596704a26bc97", "name": "Charge Start", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/charge_start\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 410, "y": 440, "wires": [ [ "febbe529f8d92091" ] ] }, { "id": "0b31a6e235d16557", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 440, "wires": [ [ "b8738ea936a56634" ] ] }, { "id": "febbe529f8d92091", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 440, "wires": [ [ "7bd53abd0b45ca30" ] ] }, { "id": "7bd53abd0b45ca30", "type": "debug", "z": "f18596704a26bc97", "name": "debug 21", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 440, "wires": [] }, { "id": "bdcd206cecb33a1e", "type": "function", "z": "f18596704a26bc97", "name": "Set Charging Amps 5", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/set_charging_amps\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nmsg.payload = {\"charging_amps\": \"5\"}; \n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 440, "y": 560, "wires": [ [ "9c11f1d5c1c00143" ] ] }, { "id": "55f10e8fd2475f49", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 560, "wires": [ [ "bdcd206cecb33a1e" ] ] }, { "id": "9c11f1d5c1c00143", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 560, "wires": [ [ "d101e512cbe59c5a" ] ] }, { "id": "d101e512cbe59c5a", "type": "debug", "z": "f18596704a26bc97", "name": "debug 22", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 560, "wires": [] }, { "id": "91a33722c228e6f1", "type": "tls-config", "name": "", "cert": "", "key": "", "ca": "", "certname": "", "keyname": "", "caname": "", "servername": "", "verifyservercert": true, "alpnprotocol": "" } ]

Sorry, but this seems not to work for me. I get following error:
"..."
9.6.2024, 22:52:35node: debug 21
msg.payload : Object
object
response: null
error: "invalid_response"
error_description: "Command proxy response not json"
"..."

Any hint?

@Jeoffreybauvin
Copy link

If someone is interested, I developed a tiny HTTP API to make BLE request to my Tesla :

https://github.com/Jeoffreybauvin/tesla-http-api-over-ble

Basically, you'll need a bluetooth dongle, and your Tesla in range. I did it last night, so, it's pretty fresh :D.

@Underground56
Copy link

Answering my own question... Here's a sample flow for Start Charge, Stop Charge and Set Charging Amps to 5 -

[ { "id": "ea0ef801d947afae", "type": "function", "z": "f18596704a26bc97", "name": "Charge Stop", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/charge_stop\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 410, "y": 500, "wires": [ [ "e00e92c60aa1e6b6" ] ] }, { "id": "84e52d1abe17ad5a", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 500, "wires": [ [ "ea0ef801d947afae" ] ] }, { "id": "e00e92c60aa1e6b6", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 500, "wires": [ [ "322dce8059e166de" ] ] }, { "id": "322dce8059e166de", "type": "debug", "z": "f18596704a26bc97", "name": "debug 20", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 500, "wires": [] }, { "id": "b8738ea936a56634", "type": "function", "z": "f18596704a26bc97", "name": "Charge Start", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/charge_start\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 410, "y": 440, "wires": [ [ "febbe529f8d92091" ] ] }, { "id": "0b31a6e235d16557", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 440, "wires": [ [ "b8738ea936a56634" ] ] }, { "id": "febbe529f8d92091", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 440, "wires": [ [ "7bd53abd0b45ca30" ] ] }, { "id": "7bd53abd0b45ca30", "type": "debug", "z": "f18596704a26bc97", "name": "debug 21", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 440, "wires": [] }, { "id": "bdcd206cecb33a1e", "type": "function", "z": "f18596704a26bc97", "name": "Set Charging Amps 5", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/set_charging_amps\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nmsg.payload = {\"charging_amps\": \"5\"}; \n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 440, "y": 560, "wires": [ [ "9c11f1d5c1c00143" ] ] }, { "id": "55f10e8fd2475f49", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 560, "wires": [ [ "bdcd206cecb33a1e" ] ] }, { "id": "9c11f1d5c1c00143", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 560, "wires": [ [ "d101e512cbe59c5a" ] ] }, { "id": "d101e512cbe59c5a", "type": "debug", "z": "f18596704a26bc97", "name": "debug 22", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 560, "wires": [] }, { "id": "91a33722c228e6f1", "type": "tls-config", "name": "", "cert": "", "key": "", "ca": "", "certname": "", "keyname": "", "caname": "", "servername": "", "verifyservercert": true, "alpnprotocol": "" } ]

Sorry, but this seems not to work for me. I get following error: "..." 9.6.2024, 22:52:35node: debug 21 msg.payload : Object object response: null error: "invalid_response" error_description: "Command proxy response not json" "..."

Any hint?

Can no one help on this issue? Reading the car data does work, but sending a command always results in the error above. Since the car is a leased company car my Access rights are "Driver, not "Owner". Maybe that makes a difference?

@ChutneyMary
Copy link

ChutneyMary commented Jun 12, 2024

The short answer is, I don't know. Some things to check -

Have you linked the Virtual Key as pictured?

Car

Your suspicion sounds correct though. Here's an excerpt out of the Teslemetry documentation under Topics / Access Type -

When a vehicle is shared by the OWNER to another account, you get DRIVER access. This is also common when the vehicle has been leased in European countries and the leasing company has retained OWNER permissions.
Unfortunately with the DRIVER permission you are unable to install the virtual key or configure Fleet Telemetry. Most of the Fleet API will still work except for commands, which depends on your vehicles Command Signing requirement. To fix this you will need to ask the owner to add the Virtual Key.

@Underground56
Copy link

Underground56 commented Jun 12, 2024

The short answer is, I don't know. Some things to check -

Have you linked the Virtual Key as pictured?

Car

Your suspicion sounds correct though. Here's an excerpt out of the Teslemetry documentation under Topics / Access Type -

When a vehicle is shared by the OWNER to another account, you get DRIVER access. This is also common when the vehicle has been leased in European countries and the leasing company has retained OWNER permissions. Unfortunately with the DRIVER permission you are unable to install the virtual key or configure Fleet Telemetry. Most of the Fleet API will still work except for commands, which depends on your vehicles Command Signing requirement. To fix this you will need to ask the owner to add the Virtual Key.

Thank you ChutneyMary! I'm not able to setup a virtual key and I'm pretty sure also the leasing company won't do it for me. If it's true that even such "simple" commands like start charging are not supported without a virtual key, I'm in big trouble :( Since "Command Sign:REQUIRED" is displayed in the teslemetry console, I assume that's true :(

Does someone know which commands need a signing ? A list would be very helpful.

"..."
Unfortunately with the DRIVER permission you are unable to install the virtual key or configure Fleet Telemetry. Most of the Fleet API will still work except for commands, which depends on your vehicles Command Signing requirement. To fix this you will need to ask the owner to add the Virtual Key.
"..."

@ChutneyMary
Copy link

ChutneyMary commented Jun 12, 2024

Read the Teslemetry documentation -
https://teslemetry.com/docs/topics/commandsigning

While this lists all the commands that do not support signing, I can only assume all the rest do require it.

I suggest you investigate the post a few lines above by @Jeoffreybauvin. The Tesla Bluetooth Low Energy API appears to support an off-line method of interacting with the vehicle. I haven't experimented with it yet, but perhaps @Jeoffreybauvin could clarify whether there's any cloud-based authentication occuring?

@Jeoffreybauvin
Copy link

Indeed @ChutneyMary , no internet access is needed to interact with the vehicle over BLE. The new key paired with the vehicle is seen as a "new car key" for controlling the vehicle.

@Underground56
Copy link

I'm a bit smarter now: In the past it was necessary to be the owner of the car to be able to setup a virtual key. Since this is no good solution for all leased cars, Tesla changed it and it is now possible to setup a virtual key a Driver. You need to have the key card and you have to be in the car to do so. See also here:

teslamotors/vehicle-command#45

In car main menu->locks teslemetry is now displayed as Fleet Key, which seems to be fine. However, on Teslemetry console still Access Type:DRIVER Command Sign:REQUIRED is displayed and the Node Red flow is still not working. Maybe Teslemetry did not fully implement the latest changes? Could be true since their documentation does also not mention them...

Hopefully I will find the last parts of this puzzle ;)

@tomashonajzer
Copy link

Hi, I have copied

Answering my own question... Here's a sample flow for Start Charge, Stop Charge and Set Charging Amps to 5 -

[ { "id": "ea0ef801d947afae", "type": "function", "z": "f18596704a26bc97", "name": "Charge Stop", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/charge_stop\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 410, "y": 500, "wires": [ [ "e00e92c60aa1e6b6" ] ] }, { "id": "84e52d1abe17ad5a", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 500, "wires": [ [ "ea0ef801d947afae" ] ] }, { "id": "e00e92c60aa1e6b6", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 500, "wires": [ [ "322dce8059e166de" ] ] }, { "id": "322dce8059e166de", "type": "debug", "z": "f18596704a26bc97", "name": "debug 20", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 500, "wires": [] }, { "id": "b8738ea936a56634", "type": "function", "z": "f18596704a26bc97", "name": "Charge Start", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/charge_start\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 410, "y": 440, "wires": [ [ "febbe529f8d92091" ] ] }, { "id": "0b31a6e235d16557", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 440, "wires": [ [ "b8738ea936a56634" ] ] }, { "id": "febbe529f8d92091", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 440, "wires": [ [ "7bd53abd0b45ca30" ] ] }, { "id": "7bd53abd0b45ca30", "type": "debug", "z": "f18596704a26bc97", "name": "debug 21", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 440, "wires": [] }, { "id": "bdcd206cecb33a1e", "type": "function", "z": "f18596704a26bc97", "name": "Set Charging Amps 5", "func": "let base_url = \"https://api.teslemetry.com/api/1/vehicles/\";\nlet token = \"Your_Teslemetry_Token_here\";\nlet vin = \"Your_VIN_here\";\n\n// POST /api/1/vehicles/{vehicle_tag}/vehicle_data\nlet scope = \"/command\";\nlet query = \"/set_charging_amps\";\n\nlet url = base_url + vin + scope + query;\n\n// Configure the msg object for the HTTP request\nmsg.method = \"POST\";\nmsg.url = url;\nmsg.headers = {\n    'Authorization': \"Bearer \" + token,\n    'Content-Type': 'application/json'\n};\n\nmsg.payload = {\"charging_amps\": \"5\"}; \n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 440, "y": 560, "wires": [ [ "9c11f1d5c1c00143" ] ] }, { "id": "55f10e8fd2475f49", "type": "inject", "z": "f18596704a26bc97", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 560, "wires": [ [ "bdcd206cecb33a1e" ] ] }, { "id": "9c11f1d5c1c00143", "type": "http request", "z": "f18596704a26bc97", "name": "Teslemetry POST", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "91a33722c228e6f1", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 670, "y": 560, "wires": [ [ "d101e512cbe59c5a" ] ] }, { "id": "d101e512cbe59c5a", "type": "debug", "z": "f18596704a26bc97", "name": "debug 22", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 860, "y": 560, "wires": [] }, { "id": "91a33722c228e6f1", "type": "tls-config", "name": "", "cert": "", "key": "", "ca": "", "certname": "", "keyname": "", "caname": "", "servername": "", "verifyservercert": true, "alpnprotocol": "" } ]

hi, this is exactly what I was looking to do... unfortunately any attempt to make an API call ends with a message "invalid token" as shown below. I got the token from iOS app "Auth for Tesla" - tried Both listed on the app, no joy :-(((

{"status":401,"response":null,"error":"invalid_token","service":"auth"}

my flows are identical, imported from yours except for I have the token and vin in flow variables.

any idea what am I doing wrong? any advice much appreciated!

@ChutneyMary
Copy link

I got the token from iOS app "Auth for Tesla"

It won't work with the iOS app "Auth for Tesla".
I think you've missed a major component required in the flow. Read a bit further back in the thread for more info. The Token comes from a new service provided by a website called Teslemetry -

https://teslemetry.com/

@tomashonajzer
Copy link

I got the token from iOS app "Auth for Tesla"

It won't work with the iOS app "Auth for Tesla". I think you've missed a major component required in the flow. Read a bit further back in the thread for more info. The Token comes from a new service provided by a website called Teslemetry -

https://teslemetry.com/

thanks! :-) still need to figure out why I get "invalid_respose" while trying to set the charging amps but I at least manage to get some info from my Tesla having the account setup correctly.

@Underground56
Copy link

I got the token from iOS app "Auth for Tesla"

It won't work with the iOS app "Auth for Tesla". I think you've missed a major component required in the flow. Read a bit further back in the thread for more info. The Token comes from a new service provided by a website called Teslemetry -
https://teslemetry.com/

thanks! :-) still need to figure out why I get "invalid_respose" while trying to set the charging amps but I at least manage to get some info from my Tesla having the account setup correctly.

Is your car a leased one? If yes and your Access Type ist "just" Driver and not owner, you have the same poblem as I have. See some post before...

@tomashonajzer
Copy link

I got the token from iOS app "Auth for Tesla"

It won't work with the iOS app "Auth for Tesla". I think you've missed a major component required in the flow. Read a bit further back in the thread for more info. The Token comes from a new service provided by a website called Teslemetry -
https://teslemetry.com/

thanks! :-) still need to figure out why I get "invalid_respose" while trying to set the charging amps but I at least manage to get some info from my Tesla having the account setup correctly.

Is your car a leased one? If yes and your Access Type ist "just" Driver and not owner, you have the same poblem as I have. See some post before...

I am the owner so it won't be the case; I believe it has something to do with the proxy setting -- no understanding here but it feels like it has something to do with the following.

https://developer.tesla.com/docs/fleet-api#charge_start

Newest vehicles require Tesla Vehicle Command protocol (see details).

I do not undestand what's involved but my Model 3 is 2023 version

@Underground56
Copy link

Interesting! Since I also get the "invalid response" error, maybe it's not because of the Access Type.

Are you able to read the status of the car (see flow from Lineflyer above)? I can read the status, but not send commands

@tomashonajzer
Copy link

tomashonajzer commented Jun 17, 2024 via email

@ChutneyMary
Copy link

Hello @Jeoffreybauvin. I've dropped a question over in your github repository in the issues section. Can you please clarify the device and/or build environment you're running the Tesla BLE interface on? I'm not having much success on a Raspberry Pi Zero W (and first time user with Docker).

@Underground56
Copy link

Same thing here. Its the SDK solvee by usimg a proxy. I am trying HA now it may work

On Mon 17. 6. 2024 at 8:08, Underground56 @.> wrote: Interesting! Since I also get the "invalid response" error, maybe it's not because of the Access Type. Are you able to read the status of the car (see flow from Lineflyer above)? I can read the status, but not send commands — Reply to this email directly, view it on GitHub <#67 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A44RIBHL4DMXP3QJ2UTN4ZDZHZ4O7AVCNFSM6AAAAAA6BGRZ7SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZSGM3DENZVG4 . You are receiving this because you commented.Message ID: @.>

Were you able to solve this problem? I'm still hanging on this :( Teslemetry console also still tells me
Access Type: DRIVER
Command Sign: REQUIRED

However, in the car the virtual key seems to be installed correctly:
teslemetry

Very much appreciate every help...

@tomashonajzer
Copy link

tomashonajzer commented Jun 26, 2024 via email

@Underground56
Copy link

Underground56 commented Jun 29, 2024

Same here: I got everything running (reading and writing values) with Home Assistent and Teslemetry now, so the problem I had has to do with the Node Red Integration. To be honest, I don't want to rebuild my complete logic in HA since I'm used to Node Red and thing the capabilities are much better.

Does anyone know if/when this problem can be fixed in Node Red? Also, I'm wondering why some guys are doing ok in Node red and some don't with the same Code?

@tomashonajzer
Copy link

tomashonajzer commented Jun 30, 2024 via email

@svwhisper
Copy link

If someone is interested, I developed a tiny HTTP API to make BLE request to my Tesla :

https://github.com/Jeoffreybauvin/tesla-http-api-over-ble

Basically, you'll need a bluetooth dongle, and your Tesla in range. I did it last night, so, it's pretty fresh :D.

There's also this repo for a BLE Proxy: https://github.com/wimaha/TeslaBleHttpProxy

I've been using it for a week now, having migrated off first Telsa API to Tessie (paid service, though) and now off Tessie to local, no cloud involved. I've found I also need to use the Tesla wall connector API, but between that and the BLE proxy (and Node Red, of course), everything works as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests