Having this code :
function checkIsNotOverHeating(context, surchauffe, offset, topic, node){
let msg = null;
let overheating;
overheating = false;
if(checkTemperatureWithOffset(context.get("temperatureInt"), offset, surchauffe, "-") === 1){
// Overheating
overheating = true;
msg = createMessageOverheat(topic);
}
node.error(overheating)
if(context.get("overheating") !== overheating) context.set("overheating", overheating);
return msg;
}
Every node.error will output in Node the value in parameter. I'm not able to understand why, but it will accept the boolean true, and not the false, as you can see in this picture :
I'm using NodeRED, and as you can see, the code is simple. My function is triggered everytime.
EDIT : Don't take care of the -1, it will just shown me the variation of 2 value
This looks like a bug in the node.error()
code as a work around try this:
node.error(' ' + overheating);
EDIT:
Fix for this has been submitted: