node-red-contrib-3dm-space 2.1.0 → 2.2.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.
Files changed (2) hide show
  1. package/README.md +239 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,18 @@
1
1
 
2
+
3
+
4
+
5
+
6
+
7
+
2
8
  ![This is an alt text.](https://github.com/smithtekIOT/ArtWork/blob/master/3dm%20github.png?raw=true")
9
+
10
+
11
+
12
+
13
+
14
+
15
+
3
16
  # node-red-contrib-3dm-space
4
17
 
5
18
  Node-RED nodes for connecting Smithtek PassPort gateways to **3DM.space SCADA Cloud**.
@@ -46,7 +59,9 @@ This package includes four nodes:
46
59
  - **3DM Out**
47
60
  - **3DM In**
48
61
  - **3DM Config Store**
49
- ![This is an alt text.](https://github.com/smithtekIOT/ArtWork/blob/master/3dm%20nodes.jpg?raw=true")
62
+ - **3DM Join**
63
+
64
+ ![This is an alt text.](https://github.com/smithtekIOT/ArtWork/blob/master/3dm%204%20nodes.jpg?raw=true)
50
65
 
51
66
  ---
52
67
 
@@ -1343,8 +1358,231 @@ output2 skipped - output disabled
1343
1358
 
1344
1359
  Increase Active Outputs or change the item to `output1`.
1345
1360
 
1361
+ ---
1362
+ ---
1363
+
1364
+ # 3DM Join
1365
+ ![This is an alt text.](https://github.com/smithtekIOT/ArtWork/blob/master/3DM%20join%20nodes.jpg?raw=true)
1366
+ The **3DM Join** node collects multiple JSON payloads, merges them into one payload, then sends one combined message after a configurable timeout.
1367
+
1368
+ It is useful when data arrives from multiple sources at slightly different times, but the user wants one clean telemetry update sent to 3DM.space.
1369
+
1370
+ Typical use:
1371
+
1372
+ ```text
1373
+ Mako RF Station 1
1374
+ Mako RF Station 2
1375
+ Mako RF Station 3
1376
+ ↓
1377
+ 3DM Join
1378
+ ↓
1379
+ 3DM Out
1380
+ ↓
1381
+ 3DM.space
1382
+ ```
1383
+
1384
+ ---
1385
+
1386
+ ## Why Use 3DM Join
1387
+
1388
+ The 3DM Join node simplifies flows where telemetry is collected from more than one source.
1389
+
1390
+ Instead of sending each small payload separately to 3DM.space, the Join node can collect the values first and send them as one larger JSON object.
1391
+
1392
+ This is ideal for RF systems where each remote station may respond a few seconds apart, but the user is happy with one complete site update every minute.
1393
+
1394
+ Example:
1395
+
1396
+ ```text
1397
+ Bore 1 data arrives
1398
+ Bore 2 data arrives
1399
+ Tank data arrives
1400
+ Weather data arrives
1401
+ ↓
1402
+ 3DM Join waits for the timeout
1403
+ ↓
1404
+ One combined payload is sent to 3DM Out
1405
+ ```
1406
+
1407
+ ---
1408
+
1409
+ ## Input Data Type
1410
+
1411
+ The 3DM Join node expects `msg.payload` to be a JSON object.
1412
+
1413
+ Correct:
1414
+
1415
+ ```json
1416
+ {
1417
+ "b1 dc": 24.3
1418
+ }
1419
+ ```
1420
+
1421
+ Correct:
1422
+
1423
+ ```json
1424
+ {
1425
+ "b2 flow": 88.5
1426
+ }
1427
+ ```
1428
+
1429
+ Incorrect:
1430
+
1431
+ ```json
1432
+ 24.3
1433
+ ```
1434
+
1435
+ Incorrect:
1436
+
1437
+ ```text
1438
+ b1 dc
1439
+ ```
1440
+
1441
+ Invalid payloads are ignored.
1442
+
1443
+ ---
1444
+
1445
+ ## Timeout
1446
+
1447
+ The timeout starts when the first valid message arrives.
1448
+
1449
+ The timer does not restart when more messages arrive.
1450
+
1451
+ Example:
1452
+
1453
+ ```text
1454
+ Timeout: 10 seconds
1455
+ ```
1456
+
1457
+ If the first message arrives at 12:00:00, the joined output is sent at 12:00:10.
1458
+
1459
+ Any valid JSON payloads received during that 10 second window are merged together.
1460
+
1346
1461
  ---
1347
1462
 
1463
+ ## Duplicate Keys
1464
+
1465
+ If the same key arrives more than once during the timeout window, the latest value is used.
1466
+
1467
+ Example:
1468
+
1469
+ ```json
1470
+ {
1471
+ "b1 dc": 24.1
1472
+ }
1473
+ ```
1474
+
1475
+ then:
1476
+
1477
+ ```json
1478
+ {
1479
+ "b1 dc": 24.4
1480
+ }
1481
+ ```
1482
+
1483
+ Final joined output:
1484
+
1485
+ ```json
1486
+ {
1487
+ "b1 dc": 24.4
1488
+ }
1489
+ ```
1490
+
1491
+ ---
1492
+
1493
+ ## Example Joined Output
1494
+
1495
+ Incoming message 1:
1496
+
1497
+ ```json
1498
+ {
1499
+ "b1 dc": 24.3,
1500
+ "b1 fb": 1
1501
+ }
1502
+ ```
1503
+
1504
+ Incoming message 2:
1505
+
1506
+ ```json
1507
+ {
1508
+ "b2 dc": 24.1,
1509
+ "b2 fb": 0
1510
+ }
1511
+ ```
1512
+
1513
+ Incoming message 3:
1514
+
1515
+ ```json
1516
+ {
1517
+ "tank level": 76.5
1518
+ }
1519
+ ```
1520
+
1521
+ Output after timeout:
1522
+
1523
+ ```json
1524
+ {
1525
+ "b1 dc": 24.3,
1526
+ "b1 fb": 1,
1527
+ "b2 dc": 24.1,
1528
+ "b2 fb": 0,
1529
+ "tank level": 76.5
1530
+ }
1531
+ ```
1532
+
1533
+ ---
1534
+
1535
+ ## Recommended Use With 3DM Out
1536
+
1537
+ The 3DM Join node is normally placed before the **3DM Out** node.
1538
+
1539
+ ```text
1540
+ RF / PLC / Sensor Inputs
1541
+ ↓
1542
+ 3DM Join
1543
+ ↓
1544
+ 3DM Out
1545
+ ```
1546
+
1547
+ This keeps telemetry updates cleaner and helps reduce the number of separate cloud messages.
1548
+
1549
+ For example, an RF system may poll several stations over 30 to 45 seconds, then send one complete site update to 3DM.space every minute.
1550
+
1551
+ ---
1552
+
1553
+ ## 3DM Join Status Messages
1554
+
1555
+ ### waiting
1556
+
1557
+ The node is waiting for the first valid JSON payload.
1558
+
1559
+ ### collecting
1560
+
1561
+ The node has received at least one valid payload and is collecting keys until the timeout expires.
1562
+
1563
+ ### sent
1564
+
1565
+ The timeout expired and the combined payload was sent.
1566
+
1567
+ ### bad payload
1568
+
1569
+ The incoming `msg.payload` was not a JSON object.
1570
+
1571
+ Check the payload going into the 3DM Join node.
1572
+
1573
+ ---
1574
+
1575
+ ## Notes
1576
+
1577
+ - Use 3DM Join to combine multiple telemetry payloads before 3DM Out.
1578
+ - The timeout starts from the first valid message.
1579
+ - The timer does not reset when more messages arrive.
1580
+ - Payloads must be JSON objects.
1581
+ - Duplicate keys are overwritten by the latest value.
1582
+ - The output is one combined `msg.payload` object.
1583
+ - This is useful for RF polling systems, multi-device sites, PLC data blocks and grouped telemetry updates.
1584
+
1585
+ ---
1348
1586
  # 3DM SCADA Canvas Smart Control Integration
1349
1587
 
1350
1588
  ![This is an alt text.](https://github.com/smithtekIOT/ArtWork/blob/master/Canvas%20SCADA%203dm.jpg?raw=true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-3dm-space",
3
- "version": "2.1.0",
3
+ "version": "2.2.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
6
  "license": "GPL-3.0-or-later",