onokje / node-red-contrib-tesla

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

setChargeLimit help #11

Closed Neu-Bob closed 3 years ago

Neu-Bob commented 3 years ago

First off, this is awesome, thank you for making this available!!!

I am trying to pass in a variable for this function.. where should I be passing "80" for instance?

onokje commented 3 years ago

In the message you pass to the tesla api node, set the commandArgs property on the msg object, and set it to an object containing the arguments you need. In the case of SetChargeLimit, this argument is called amt. So: msg.commandArgs = {amt: 80}.

Easiest way to do this is to use a 'change' node and Set msg.commandArgs.amt to 80.

Neu-Bob commented 3 years ago

Perfect! Thank you! Attaching a screen shot of what I did exactly

Screen Shot 2021-02-17 at 4 23 28 PM