Hi
I have a flow, part of my heating system - and in there is a function which has worked for maybe years... called process-heat - it has never failed - this afternoon I upgraded from v2.1.3 to v2.2. Node Red and received an error message - a number...... of undefined...
This is the code in the function. Thankfully I'd cloned the RPi before upgrading to v2.2. so I've gone back to v2.1.3 and there are no errors showing.
var timing=global.get("timing");
var now = new Date();
msg.payload=timing[(now.getDay()*24)+now.getHours()];
msg.away=timing[169];
msg.temperature=flow.get("incomingTemperature");
msg.humidity=flow.get("incomingHumidity");
msg.set=msg.payload;
if (flow.get("manualTimer")) flow.set("manualTimer",flow.get("manualTimer")-1);
else flow.set("manual",0);
msg.desired=msg.set;
flow.set("setTemperature",msg.desired);
msg.desired+=flow.get("manual");
// fixed local away to global away on jan 17 2020
if (global.get("away")) msg.desired=global.get("timing")[169];
if (msg.desired>msg.temperature) { msg.relay=1; } else { msg.relay=0; }
msg.payload=flow.get("incomingTemperature");
node.status({fill:"blue",shape:"dot",text:"Set point " + msg.desired + "c - Actual " + msg.temperature +"c"});
msg.topic="processHeat";
if (msg.temperature<msg.desired) msg.colour="#ff5555";
node.send([msg,null]);
msg.payload=msg.relay;
node.send([null,msg]);
Regards
Pete