Passing paramters into Binance node

Dear all,
I am using Binance node, binance-buy in particular. If i manually enter the parameters into the binance-buy-node it is working normally. But if I have to enter manually, there is no point.
I would like to automate entering the value into the parameters of node. My idea is to leave parameters blank and then fill it in either through input or through variable. Since I am new with node-red, I don't know how to achieve this, I was trying already to set the flow variable, but I am not sure, how to name the variable in order the node to accept it.
Please give me some guidelines. I don't need specifics od this node, but in general I am interested how to automate populating parameters of particular node.
I also pasted example of the node I would like to fill. I would like to automate populating the #Quantity and Price parameters.
Thank you very much in advance.

Have you looked in the built in help? It's often explained there.

Looking at the SRC...

Leave the 2 fields blank and pass them in msg.payload.quantity and msg.payload.price

See here: node-red-contrib-binance/binance.js at 4cb52ddc1b38190e48e36e9615d2b667bc3cb31f · SenseTecnic/node-red-contrib-binance · GitHub

Dear Steve,
Thank you for your very responsive answer. I just tried. For test I left only quantity empty. I setted msg.payload.quantity through function. I am still getting "Missing quantity". Maybe I did a mistake with setting msg.payload.quantity?


As you passed in a timestamp from the inject node, the payload is not an object so you cannot set a quantity property - You should get an error!

Try

msg.payload = { quantity: 0.00133 }

Steve,
Thank you, very much it is working! YOu're king!
If I am not mistaken, now the easiest way most probably is, that instead of actual values I call flow variables (one for quantity and another for price), that I set in another function. Right?

It depends. If the other function is always ran before this, then simply put the values in a property of the msg, build the payload using these props then call your node without ever touching context.

Context can cause timing issues in your flows of you are not careful to understand the order of events.

Steve,
Thank you very much for your help. It helped me and I achieved exactly what I wanted. Regards, Rok

1 Like

I have very similar question to my initial one. I am having Ewelink Temperature-Humidity node. Inside that node I have Field Device Id, that I would like to inject through function node. I can not find how to send it? Through msg.deviceId? I was trying to fins information in the api documentation but withouth sucess. Thank you in advance!.
Screenshot 2022-01-29 235054

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.