Skip to content

Repository files navigation

Nube-flows

Nube-iO Node-red Flows

HVAC Control Logic

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;

Arrow functions (Lambda) in nodejs


someValues = [1, 2, 3, 4];

someValues.forEach((element) => {
    node.warn(element);
});

node.warn(someValues.map(x => 8 * x));

Counter


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;

About

Nube-iO Node-red Flows

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors