Skip to content

Node-RED ​

The Kealink node sends readings from Node-RED with only the machine id and password. No topic, broker settings or payload format to set up.

Needs Node-RED 3 or later and Node.js 18 or later.

Install ​

From the editor ​

  1. Download node-red-contrib-kealink-0.2.2.tgz.
  2. In Node-RED, open the menu (☰), Manage palette, then the Install tab.
  3. Click the small upload icon to the right of the search box, choose the file, then Upload.

From the command line ​

Stop Node-RED, then in the Node-RED user directory (usually ~/.node-red, or %USERPROFILE%\.node-red on Windows):

sh
npm install https://app.kealink.co.nz/downloads/node-red-contrib-kealink-0.2.2.tgz

Start Node-RED again. Either way the kealink node appears under network, with an example flow under Import, Examples, node-red-contrib-kealink.

Set up ​

  1. Drop a kealink node into your flow.
  2. In Machine, add a Kealink machine: paste the Machine id and Password from Kealink.
  3. Leave Send over at MQTT with TLS unless outgoing port 50607 is blocked, then choose HTTPS. For HTTPS, Address is https://app.kealink.co.nz and nothing more.
  4. Wire your values in and deploy.

Feeding it values ​

Either several values in one message:

js
msg.payload = { spindle_temp: 41.2, running: true };
return msg;

or one tag per message, the way most PLC nodes send, with the tag name in msg.topic:

js
msg.topic = "Spindle Temp";
msg.payload = 41.2;
return msg;
  • Names become keys: Spindle Temp becomes spindle_temp.
  • true and false become 1 and 0.
  • Numbers written as text are sent as numbers. Other text, such as a program name, is sent as text for readings of kind Text.

Sending ​

SendWhat happens
the latest of each value, every few secondsThe default. Sends the latest value of each name every 30 seconds, or the number you set in Every.
every message as it arrivesSends each message straight away

If Kealink cannot be reached, the node holds readings with their times for up to 24 hours (at most 2,880 messages) and sends them, oldest first, when it is back.

Status ​

The status under the node shows connected, then sent N values at HH:MM after each send. It also says when it is holding readings, when the password was refused (issue a new one in Kealink), and when the HTTPS address is wrong.

The node's output carries what was sent and Kealink's reply. Put a debug node on it while setting up.

One connection per machine ​

Use one kealink node configuration per machine id. Two MQTT connections with the same machine id knock each other off.

Any Node-RED can also use its own mqtt out or http request node. See MQTT and HTTP.