onokje / node-red-contrib-tesla

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

How can i set the charge Limit? (beginner question) #34

Open nickeeey opened 2 years ago

nickeeey commented 2 years ago

Hi, i got simple tasks working with boolean (0/1) but how can i do a setchargelimit or sth else. Which Value do the Api need? Can someone post any example? for example i want to set charge limit to 16A when i press button x that is my solution: (see photo), but how do i define it right? image

onokje commented 2 years ago

The set chargelimit option is not for setting the max. charging amps. The setCharging limit is to set a maximum state of charge for the battery in %. So if you set it to 80, the car will charge to 80%. There is another function to set the maximum charging amps, (called setChargingAmps) but currently that function is not working.

Urs-Eppenberger commented 2 years ago

In the mean time setting maximum charging amps works. You need the most recent version of node-red-contrib-tesla and you need a way to configure the new authentication method with the refresh token. Once you have done this, the following flow works for me:

[{"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":"780291468967186","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":"urs.eppenberger@maremonti.ch"}]

marcospg75 commented 2 years ago

In the mean time setting maximum charging amps works. You need the most recent version of node-red-contrib-tesla and you need a way to configure the new authentication method with the refresh token. Once you have done this, the following flow works for me:

[{"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":"780291468967186","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":"urs.eppenberger@maremonti.ch"}]

I notice that if I change the Amps, for example to 8A (or 5A or 12A), the firts time, my Model 3 sets the charging from 16A to 5A, and the second time I send the command, sets the charging to 0A!!! :(

Someone has the same issue??

demod-au commented 2 years ago

commandArgs.amt is incorrect, and/or has changed recently. use commandArgs.amps.

I had the same problem, working perfectly now.

frownbreaker commented 2 years ago

I get a 404 for trying to set the charge amps. Other functions working fine. That's using the commandArgs.amps=10

donnib commented 2 years ago

@marcospg75 i have something simmilar and it drives me nuts, i start with max charging in app then i set the charging amps to 2A and i can see in the app it changes to 5A then i run again and set it to 2A and it's set correct, why i don't know