onokje / node-red-contrib-tesla

Node red nodes to control Tesla vehicles and devices
MIT License
21 stars 11 forks source link

set charge power #22

Open Urs-Eppenberger opened 2 years ago

Urs-Eppenberger commented 2 years ago

I just upgraded my Tesla Model 3 with SW version 2021.36.5.5 The release note states, that there is now the possibility to configure the charging power via the Tesla App. I checked and this seems true. There is now a new configuration option in the iPhone Tesla App.

If the App can control charging power, then this might be possible via the API used by this node-red node too. Could you try to figure this out and update the implementation? setChargePower as a new option name?

Kind regards, Urs.

onokje commented 2 years ago

It would have to be implemented in the TeslaJs library first. But if they have it then yes, i can add it easily here as well.

TomNijsen commented 2 years ago

Someone did develop something => https://github.com/mseminatore/TeslaJS/issues/282

cramlr commented 2 years ago

it's been added to teslaJS, and it appears in the list of available commands in node-red, but I get this error:

"TypeError: tjs.setChargingAmpsAsync is not a function"

Urs-Eppenberger commented 2 years ago

I tested it today. It works with the most recent version of node-red-contrib-tesla. Here is the very minimalistic flow I did:

[{"id":"6d1577b73768837c","type":"inject","z":"4e139d26.c717a4","name":"Charge Amps","props":[{"p":"commandArgs.amt","v":"8","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":2220,"wires":[["5edb4b8f0e8f20e7"]]},{"id":"5edb4b8f0e8f20e7","type":"tesla-api","z":"4e139d26.c717a4","teslaConfig":"cca88314.8bcf68","command":"setChargingAmps","name":"","vehicleID":"xxxxxxxxxxxxxxx","autoWakeUp":true,"x":320,"y":2220,"wires":[["a6c93a1d65a24ee9"]]},{"id":"a6c93a1d65a24ee9","type":"debug","z":"4e139d26.c717a4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":490,"y":2220,"wires":[]},{"id":"cca88314.8bcf68","type":"tesla-config","email":"bla.bla@bla.bla"}]

Urs-Eppenberger commented 2 years ago

Since it works now, I close this issue. Many thanks and congratulation to the developer.

cramlr commented 2 years ago

I'm still getting the error even running the sample flow above

"TypeError: tjs.setChargingAmpsAsync is not a function"

I'm using node-red 2.1.4, node-red-contrib-tesla 2.0.0, and my Tesla is up to date.

Other Tesla commands work fine in my tests (I have not tested many of them though)

Any ideas on what could be amiss?

Urs-Eppenberger commented 2 years ago

I'm still running at node-red 2.1.3, with node-red-contrib-tesla 2.0.0 The system runs on a RaspberryPi with up-to-date SW.

The error message starts with tjs.... This looks like an abbreviation of Tesla Java Script, which is the underlying library used in this node.

If the author of the node does not react here, I suggest to take this over to the node-red forum. There are tons of javascript experts which might have an idea where to look. Their first answer might be, that you should take this up with the author of the node. I propose therefore, that you mention in your question to the expert pool there, that you already did that.

cramlr commented 2 years ago

thanks for the tip @Urs-Eppenberger - for some reason I had another version of teslaJS that was old and took precedence over the node-red version. All is good now

demod-au commented 2 years ago

All is good now

How did you fix it? I've still got the error "setChargingAmpsAsync is not a function". I've only ever installed node-red-contrib-tesla.

demod-au commented 2 years ago

so I got it working. teslajs will not magically update itself. maybe after a new install?

I did an "npm install teslajs" Then rebooted the docker container.