Appearance
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
- Download node-red-contrib-kealink-0.2.2.tgz.
- In Node-RED, open the menu (☰), Manage palette, then the Install tab.
- 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.tgzStart Node-RED again. Either way the kealink node appears under network, with an example flow under Import, Examples, node-red-contrib-kealink.
Set up
- Drop a kealink node into your flow.
- In Machine, add a Kealink machine: paste the Machine id and Password from Kealink.
- Leave Send over at MQTT with TLS unless outgoing port 50607 is blocked, then choose HTTPS. For HTTPS, Address is
https://app.kealink.co.nzand nothing more. - 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 Tempbecomesspindle_temp. trueandfalsebecome 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
| Send | What happens |
|---|---|
| the latest of each value, every few seconds | The default. Sends the latest value of each name every 30 seconds, or the number you set in Every. |
| every message as it arrives | Sends 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.
Without the Kealink node
Any Node-RED can also use its own mqtt out or http request node. See MQTT and HTTP.