Hello,
I am a newbie with node red and have a little problem.
I want to add two values in a function.
One value comes via the payload, the other is a flow variable.
I can display the values, but I can't calculate them.
Unfortunately, I can't do it.
Here is the code in the function node. I will leave the countless attempts in
var msgtemp = { payload: msg.payload };
var msghumi = { payload: msg.humidity };
var f_temp1 = flow.get('f_temp1');
var msgtemp1 = {payload: f_temp1};
var msgtemp2 = Math = Number({ payload: msg.payload }) + Number({ payload: f_temp1 });
//var msgtemp2 = Math = Number(msgtemp) + Number(msgtemp1);
var msgtemp3 = {payload: msgtemp2};
//msg.payload = Math = Number(msgtemp) + Number(msgtemp1);
//var msgtemp3 = {payload: msgtemp2};
return [msgtemp, msghumi, msgtemp2];
//return [msgtemp, msghumi, msgtemp1];
//return msg;