onokje / node-red-contrib-tesla

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

problems with openTrunk and setTemps #21

Open Langer75 opened 2 years ago

Langer75 commented 2 years ago

Hi, I am new with Tesla and I got nearly all function running with my Model 3. Two function will not work as expected:

openTrunk. it is stated that no commandArgs are necessary. How can I distingush between trunk and frunk? I read in the tesla.js github project that it was changed to "rear" and "front" But how can I pass these parameters to openTrunk. Currently it does not work at all.

With set Temp I have the effect that it does not matter whether I pass cammandArgs.driver or commandArgs.pass to setTemps. Both values are changed to the same value. Is this a bug or did I something wrong?

Thanks for your help

Langer

Langer75 commented 2 years ago

Ok, I solved the openTrunk problem. But the setTemps problem I can not figure out the problem. Does anybody has the same problem?

onokje commented 2 years ago

I will look into it.

TomNijsen commented 2 years ago

How did you solve the openTrunk problem? What exact syntax for the commandArgs did you use?

andijegg commented 2 years ago

I have also the Problem with the open Trunk and Frunk command. Debug give back "invalid_value" what is the right value.

1 or true didn't work

Langer75 commented 2 years ago

Hi folks

in tesla.js the line around 90 (openTrunk) has to be adapted. I deleted the line and added the following: case 'openFrunk': return tjs.openTrunkAsync({authToken, vehicleID}, "front"); case 'openTrunk': return tjs.openTrunkAsync({authToken, vehicleID}, "rear"); After this it should work. No parameters, just use the command "openTrunk" or "openFrunk"

andijegg commented 2 years ago

Thanks, I'll try this.

ianwitherow commented 2 years ago

@Langer75 Thanks, this worked for me!

@onokje - Would you like a pull request for this (the Frunk and Trunk issue)?

Langer75 commented 2 years ago

A last question on the setTemp driver and passanger issue (see first comment): It seems, that it does not work for a Model3. Can anybody confirm that. For wich model does it work?

ianwitherow commented 2 years ago

@Langer75 I got the different temperatures working for my 2021 Y. The key is that you need to un-sync the temperatures in the car first ("Split" button). I haven't seen an API call to do this, but I may have just missed it.

andijegg commented 2 years ago

in tesla.js the line around 90 (openTrunk) has to be adapted. I deleted the line and added the following: case 'openFrunk': return tjs.openTrunkAsync({authToken, vehicleID}, "front"); case 'openTrunk': return tjs.openTrunkAsync({authToken, vehicleID}, "rear"); After this it should work. No parameters, just use the command "openTrunk" or "openFrunk"

Hi, I tried it, but for me it didn't worked... Any Ideas

Langer75 commented 2 years ago

In the current Version openTrunk and openFrunc lines are already there. But the parameters have to be adapted (front and rear)

andijegg commented 2 years ago

I've adapted the parameters to "front" and "rear", but it does not work at al

Bildschirmfoto 2021-12-30 um 17 37 51
ianwitherow commented 2 years ago

@andijegg Can you try calling openTrunkAsync from the TeslaJS library directly (outside of node-red)? Make sure to use "front" and "rear" there too despite the documentation. Or try both variations!

Just curious if your issue is with the TeslaJS library instead of this one.

andijegg commented 2 years ago

Can you try calling openTrunkAsync from the TeslaJS library directly (outside of node-red)?

I don't know how to do this... sry

ianwitherow commented 2 years ago

@andijegg Gotcha, well just out of curiosity - do other calls from node-red work? Can you open the charge port for instance? Also, did you restart your node-red instance after updating the tesla.js file?

andijegg commented 2 years ago

Yes other work. Open/Close Car Open Charge Port etc.

And yes I've restarted the node-red instance after updating the tesla.js file.

ianwitherow commented 2 years ago

@andijegg Anything appear in a debug message payload from the openFrunk node?

Example: image

andijegg commented 2 years ago

Yes the same as in the Picture above.

„false“ and „invalide_value“

ianwitherow commented 2 years ago

It must not be picking up the change you made. What's the file path of your tesla.js that you edited?

andijegg commented 2 years ago

/home/pi/node_modules/node-red-contrib-tesla/tesla.js

ianwitherow commented 2 years ago

Kind of a long shot here, but from your home directory, what do you see when you run:

find . -name 'tesla.js'

Just that one file? Or does it find another? If you look in the file, does it still have your changes ("front" and "rear")? Or did it revert?

andijegg commented 2 years ago

It finds two...

./.node-red/node_modules/node-red-contrib-tesla/src/tesla.js ./node_modules/node-red-contrib-tesla/tesla.js ./node_modules/node-red-contrib-tesla/src/tesla.js

ianwitherow commented 2 years ago

Ah, alright - the one you want is that first one: ./.node-red/node_modules/node-red-contrib-tesla/src/tesla.js Make the edits there, restart node-red, and it should work.

andijegg commented 2 years ago

both files have the "front" "rear" edit, I've just checked it...

ianwitherow commented 2 years ago

Hm, must be symlinked. Can you reboot the whole machine just to make sure the instance is being restarted? Everything looks fine, not sure what else to suggest here.

andijegg commented 2 years ago

I‘ll try a restart and report the result

andijegg commented 2 years ago

There was 3 files... my fault, in the third file, were still the old paterns. I changed it an now it works fine... Thank you for the help!

ianwitherow commented 2 years ago

Hah, I almost asked about that one too.. Glad to hear it's working!