node-red-contrib-uos-nats 0.1.25 → 0.1.26

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.
package/README.md CHANGED
@@ -4,9 +4,9 @@
4
4
 
5
5
  Node-RED nodes to read and write u-OS Data Hub variables via NATS. This package exposes three building blocks:
6
6
 
7
- 1. **u-OS Config** – stores host, OAuth client credentials and manages the shared NATS connection.
8
- 2. **DataHub Input** – subscribes to an existing provider and emits JSON messages. Enter the provider ID and optional comma-separated variable names.
9
- 3. **DataHub Output** – automatically registers a provider (default `nodered`), flattens incoming JSON structures and publishes them to the Data Hub.
7
+ 1. **u-OS Config** – stores host, OAuth client credentials and manages the shared NATS connection. Includes a **Test Connection** button for immediate feedback.
8
+ 2. **DataHub Input** – subscribes to an existing provider and emits JSON messages. Supports both **Event-based** and **Polling** updates.
9
+ 3. **DataHub Output** – automatically registers a provider (defaults to your Client Name/ID), flattens incoming JSON structures and publishes them to the Data Hub.
10
10
 
11
11
  The nodes reuse the FlatBuffer helpers from the standalone Node sample, so they speak the native NATS API.
12
12
 
@@ -38,13 +38,18 @@ The config node automatically fetches tokens via Client Credentials flow.
38
38
 
39
39
  ## DataHub Input Node
40
40
 
41
- - Select the u-OS config node, then choose one of the discovered providers from the dropdown.
42
- - **Troubleshooting**: If the dropdown remains empty, check the Node-RED debug tab. The node logs the API response count. Ensure your OAuth client has `hub.variables.readonly` permission.
43
- - Pick the variables you need from the multi-select list. Leave it empty to receive all variables.
41
+ - Select the u-OS config node.
42
+ - **Providers**: Click the **Refresh** button to list available providers. This list can be cached from the "Test Connection" button in the Config Node.
43
+ - **Variables**: Select a provider, then click *Refresh* to load its variables. **Note:** To load variables, the Config Node **must be deployed** first!
44
+ - **Polling (ms)**:
45
+ - `0`: **Events only**. Efficient and fast.
46
+ - `> 0`: **Hybrid Mode**. Receives events **AND** polls values every X ms.
47
+ - **Troubleshooting**: If lists remain empty, check the Node-RED debug tab. Ensure your OAuth client has `hub.variables.readonly` permission.
44
48
 
45
49
  ## DataHub Output Node
46
50
 
47
- - Reuses the u-OS config node. The provider ID defaults to `nodered` and is created automatically upon the first message.
51
+ - Reuses the u-OS config node.
52
+ - **Provider ID**: Leave this field **EMPTY** (recommended) to automatically use the **Client Name** defined in your u-OS Config. This ensures your permissions always match.
48
53
  - Send a JSON object to the input pin. **Nested objects are supported** and create subcategories automatically:
49
54
  ```json
50
55
  {
@@ -332,10 +332,23 @@
332
332
  <dt>u-OS Config</dt>
333
333
  <dd>Pick the connection node that holds host, port and OAuth credentials.</dd>
334
334
  <dt>Provider ID</dt>
335
- <dd>Provider to read. The drop-down lists every provider returned by the Control Center REST API.</dd>
336
- <dt>Variables</dt>
337
- <dd>Select one or more variable keys (single/multi-select). Leave unselected to stream all variables from the provider.</dd>
335
+ <dd>Provider to read. The drop-down lists every provider returned by the <p><strong>Attributes:</strong></p>
336
+ <dl>
337
+ <dt>Polling (ms)</dt>
338
+ <dd>
339
+ <ul>
340
+ <li><code>0</code> (default): <strong>Event-based only</strong>. You receive updates whenever they happen.</li>
341
+ <li><code>> 0</code>: <strong>Hybrid Mode</strong>. You receive live Events <strong>AND</strong> the node explicitly reads all values every X milliseconds. Useful if you suspect missed events.</li>
342
+ </ul>
343
+ </dd>
344
+ <dt>Provider & Variables</dt>
345
+ <dd>Click the <strong>Refresh</strong> button to load the lists. Providers can be cached, but <strong>Variables require a deployed Config Node</strong> to be loaded securely.</dd>
338
346
  </dl>
347
+ <p><strong>Troubleshooting:</strong></p>
348
+ <ul>
349
+ <li><strong>Empty Variable List:</strong> Ensure the Config Node is <strong>DEPLOYED</strong>. The "Test Connection" button only checks basic connectivity, but reading variable schemas requires a running flow.</li>
350
+ <li><strong>Permission Information:</strong> If you don't see a specific provider, your OAuth Client might lack read permissions for it.</li>
351
+ </ul>
339
352
  <p>Each message has <code>msg.payload</code> shaped like:</p>
340
353
  <pre>{
341
354
  "type": "snapshot" | "change",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-uos-nats",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "Node-RED nodes for u-OS Data Hub via NATS",
5
5
  "repository": {
6
6
  "type": "git",