I’ve got this code shown below, it reads all inputs. The inputs feed a join node, which feed a function node with this code, which feed a call service node, which works if I inject a payload to it. A debug on the join node suggests they are all reporting. A debug on the function does not give any output.
var target;
var night_temp_target = msg.payload.room_1_night_temp_target;
var temperature_target = msg.payload.room_1_temperature_target;
var temperature_tolerance = msg.payload.room_1_temperature_tolerance;
var bh1750_room2 = msg.payload.bh1750_room2
var room_1_average_temp = msg.payload.room_1_average_temp
if (bh1750_room2 <= 10){
target = night_temp_target;
}else{
target = temperature_target;
}
if (room_1_average_temp < (target - {temperature_tolerance}))
{
return [msg, null];
}else{
return [null, msg];
}
Hello again ,
so the function node is doing what is expected as you return the whole message that comes in with: return msg; or return [msg, null];
Do the messages come out of the right output? So if the average temp is below the target - tolerance, it comes out of output 1 and if not output 2?
Small world. Keen to get this sorted as you can see!
I’m not sure, it doesn’t look like there is anything coming out of the function nodes. If I put a debug on the function it just repeats the data coming out of the join node, looking at other working flows, this seems to be normal.
This is what comes out of the function node debug. Seems to be taking the measurements fine.
There are debugs on the current states which usually report on or off in other working flows, but these don’t, does this suggest a fault at the function code?