Nube-iO Node-red Flows
This is a flow for controlling compressor staging
This is a flow for controlling compressor staging
You need to install moment.js and enable in the settings.js file
var nDate = new Date().toLocaleString('en-UK', {
timeZone: 'Australia/Sydney'
});
timeAu = (nDate);
node.status({fill:"blue",shape:"dot",text:"Message recieved: @" +" "+ timeAu});
return msg;
const event = new Date();
const options = {
year: 'numeric',
day: 'numeric',
month: 'long',
weekday: 'short',
hour: 'numeric',
minute: 'numeric',
timeZoneName: 'short',
timeZone: 'Australia/Sydney',
};
msg.payload = (event.toLocaleString('en-AU', options));
return msg;
someValues = [1, 2, 3, 4];
someValues.forEach((element) => {
node.warn(element);
});
node.warn(someValues.map(x => 8 * x));
if (context.hasOwnProperty("counter"))
context.counter += 1;
else
context.counter = 0;
context.flow.counter = context.counter + 1;
msg.payload = "local counter = " + parseInt(context.counter, 10);
node.status({fill:"green",shape:"dot",text:msg.payload});
return msg;