node-red-contrib-3dm-space 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,8 @@
7
7
  server: { value: "", type: "3dm-cloud-config", required: true }
8
8
  },
9
9
  inputs: 1,
10
- outputs: 1,
10
+ outputs: 2,
11
+ outputLabels: ["telemetry result", "cloud online"],
11
12
  icon: "font-awesome/fa-cloud-upload",
12
13
  label: function () {
13
14
  return this.name || "3DM telemetry out";
@@ -36,6 +37,8 @@
36
37
  <p>Sends telemetry to 3DM.space SCADA Cloud.</p>
37
38
 
38
39
  <p>Input must be a JSON object.</p>
40
+ <p>Output 1: the existing telemetry result message.</p>
41
+ <p>Output 2: connection status with <code>msg.topic = "3dm.connection"</code> and a boolean <code>msg.payload</code>: <code>true</code> for online, <code>false</code> for offline. Emitted once after deployment and on each connection state change, without requiring telemetry input. A missing login configuration reports false.</p>
39
42
 
40
43
  <p>Example:</p>
41
44
 
package/3dm-cloud-out.js CHANGED
@@ -87,6 +87,32 @@ module.exports = function (RED) {
87
87
  node.name = config.name;
88
88
  node.server = RED.nodes.getNode(config.server);
89
89
 
90
+ var lastConnectionState;
91
+ var connectionOutputClosed = false;
92
+
93
+ function sendConnectionState(connected) {
94
+ connected = Boolean(connected);
95
+ if (connectionOutputClosed || connected === lastConnectionState) {
96
+ return;
97
+ }
98
+ lastConnectionState = connected;
99
+ node.send([null, { topic: "3dm.connection", payload: connected }]);
100
+ }
101
+
102
+ // Defer the initial message until Node-RED has connected the flow wires.
103
+ var connectionStartupTimer = setTimeout(function () {
104
+ connectionStartupTimer = null;
105
+ sendConnectionState(node.server && node.server.connected);
106
+ }, 0);
107
+
108
+ node.on("close", function () {
109
+ connectionOutputClosed = true;
110
+ if (connectionStartupTimer) {
111
+ clearTimeout(connectionStartupTimer);
112
+ connectionStartupTimer = null;
113
+ }
114
+ });
115
+
90
116
  var queueFile = path.join(
91
117
  QUEUE_DIR,
92
118
  QUEUE_FILE_PREFIX + "-" + node.id + ".sqlite"
@@ -296,7 +322,7 @@ module.exports = function (RED) {
296
322
  } else {
297
323
  msg.payload = roundPayload(msg.payload);
298
324
  }
299
- send(msg);
325
+ send([msg, null]);
300
326
 
301
327
  if (done) {
302
328
  done();
@@ -605,6 +631,7 @@ module.exports = function (RED) {
605
631
  }
606
632
 
607
633
  var stateHandler = function (connected) {
634
+ sendConnectionState(connected);
608
635
  if (connected) {
609
636
  updateStatus("connected");
610
637
  maybeStartBackhaul();
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.3.0 — 2026-10-18
4
+
5
+ - Add a second 3DM Out output for boolean cloud connection status: true online, false offline, on deployment and state changes.
6
+ - Preserve existing telemetry results on output 1, queue behavior, rate limiting, and five-decimal payload precision.
7
+ - Replace GPL declarations with Smithtek proprietary licence terms and include LICENSE in the release.
8
+ - Preserve all 2.2.1 documentation and assets; extend the npm file list to include all Markdown documents.
9
+
10
+
3
11
  ## 2.2.1 — 2026-10-01
4
12
 
5
13
  - Round numeric output payload values to a maximum of five decimal places, including nested objects and arrays.
package/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ Smithtek Proprietary Software Licence
2
+
3
+ Copyright (c) 2026 Smithtek. All rights reserved.
4
+
5
+ This software, including its source code, documentation, and accompanying
6
+ Smithtek materials, is proprietary to Smithtek. It is not licensed under the
7
+ GPL or any other open-source licence.
8
+
9
+ Possession, download, installation, or public availability of this package does
10
+ not grant a licence. Use is permitted only under a separate written agreement
11
+ or express written permission from Smithtek, and only within its scope.
12
+
13
+ Without that permission, no person may use, copy, modify, distribute,
14
+ sublicense, sell, or create derivative works of this software, except to the
15
+ extent applicable law requires otherwise. Copyright and proprietary notices
16
+ must be retained in any authorised copies.
17
+
18
+ Third-party dependencies and materials remain subject to their respective
19
+ licences. These terms do not replace or restrict rights granted by those
20
+ third-party licences.
21
+
22
+ To the extent permitted by law, this software is provided AS IS, without
23
+ warranties of any kind. Smithtek shall not be liable for loss or damage arising
24
+ from use of the software. A separate written agreement with Smithtek takes
25
+ precedence over these terms where they conflict.
package/README.md CHANGED
@@ -185,6 +185,15 @@ If the cloud connection is unavailable, valid data is stored locally and sent la
185
185
 
186
186
  ---
187
187
 
188
+ ## 3DM Out Outputs
189
+
190
+ From version 2.3.0, 3DM Out has two output pins:
191
+
192
+ 1. **Telemetry result**: the existing result message, including sent, queued, rate-limit, and error fields.
193
+ 2. **Cloud online**: a message with boolean `msg.payload`: `true` when the shared MQTT connection to 3DM.space is online, or `false` when offline. The topic is `3dm.connection`.
194
+
195
+ The second output emits once after deployment and whenever the connection state changes. It works without incoming telemetry. Repeated notifications of the same state do not produce duplicate messages. A missing cloud login configuration reports `false`. This reports MQTT connection status; it does not confirm that an individual telemetry packet was delivered or stored. Existing wires on output 1 keep their telemetry behavior. Connect output 2 to a Switch node or other flow logic to react to online/offline changes.
196
+
188
197
  ## 3DM Out Input Data Type
189
198
 
190
199
  The 3DM Out node expects `msg.payload` to be a JSON object.
@@ -2613,4 +2622,6 @@ Smithtek
2613
2622
 
2614
2623
  # License
2615
2624
 
2616
- GPL-3.0-or-later
2625
+ Smithtek proprietary software. Copyright (c) 2026 Smithtek. All rights reserved.
2626
+
2627
+ This package is not offered under an open-source licence. Use requires permission from Smithtek. See [LICENSE](LICENSE) for the proprietary terms. Third-party dependencies retain their own licences.
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "node-red-contrib-3dm-space",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Node-RED nodes for 3DM.space SCADA Cloud telemetry, attributes, and local config storage",
5
5
  "main": "3dm-cloud-config.js",
6
- "license": "GPL-3.0-or-later",
6
+ "license": "SEE LICENSE IN LICENSE",
7
7
  "keywords": [
8
8
  "node-red",
9
9
  "node-red-contrib",
@@ -37,7 +37,8 @@
37
37
  "payload-precision.js",
38
38
  "icons/",
39
39
  "icon.png",
40
- "README.md",
41
- "CHANGELOG.md"
42
- ]
40
+ "*.md",
41
+ "LICENSE"
42
+ ],
43
+ "author": "Smithtek"
43
44
  }