node-red-contrib-opcua-config 1.3.0
Node-RED nodes for OPC UA tag mapping and topic snapshot tables
node-red-contrib-opcua-config
Node-RED nodes for OPC UA tag ID-to-name mapping, topic snapshot tables, type-based routing, and table-format mapping. Designed to work with node-red-contrib-opcua.
Nodes
opcua-mapping
An editable table that maps OPC UA NodeIds to human-readable names with data type classification. Stores mappings in both file system (persistence) and Node-RED context (runtime lookup).
- Input: Any message triggers subscription output (output 4).
msg.payload = "clear"clears all mappings. - Output 1: One message per row —
{topic: nodeId, payload: nodeId} - Output 2: One message per row —
{topic: nodeId, payload: uns} - Output 3: One message per row —
{topic: nodeId, payload: {id, uns, tagType}} - Output 4: Aggregated subscription format for OpcUa-Client —
{topic: "multiple", payload: [{nodeId}], interval: 3000} - Popup Editor: Bulk edit mappings in a resizable window with per-column filters, Excel-compatible copy/paste (TSV format), and auto-save.
- Context Store: Mappings stored in
globalorflowcontext as forward (id → {uns, tagType}) and reverse (uns → {id, tagType}) dictionaries. - Persistence: Data saved automatically to
<userDir>/opcua-mapping-data/<nodeId>.jsonon every change. Survives restarts.
opcua-snapshot
A live snapshot viewer that stores the most recent message per msg.topic. Provides a popup viewer with auto-refresh, row filtering, and missing-topic detection.
- Input: Stores each message by
msg.topic(overwrites previous).msg.payload = "get"sends snapshot to output.msg.payload = "clear"clears all stored data. - Columns: Configurable comma-separated list of message property paths (e.g.,
topic,payload.value.value,payload.value.dataType). Supports dot notation for nested properties. - Missing Topic Detection: When configured with a mapping context key, topics in the dictionary that haven't received data yet are shown in orange with a MISSING badge — lets you see which configured tags are silent.
- Output: Array of objects — one per topic with the configured column values.
- Popup Viewer: Resizable window with Refresh, Auto-Refresh (2s), row filter, and Copy for Excel.
opcua-type-router
Validates OPC UA messages against a context lookup map, enriches them with tag metadata, and routes to typed outputs.
- Input: OPC UA messages with
msg.topicmatching context map entries. Case-insensitive lookup fallback. - Output 1 (rejected): Messages failing validation with a
reasonfield (unknown_topic,empty_payload,null_value,bad_quality). - Output 2-5 (typed): Validated messages enriched with
msg.uns,msg.tagType,msg.value,msg.timestamp,msg.statusCode.- Output 2: bool/boolean/digital/bit
- Output 3: long/int/integer/dword/word
- Output 4: string/str/text/char
- Output 5: float/double/real/number
- Context Map: Reads from flow/global context — populated by
opcua-mappingnode, each entry has{uns, tagType}.
opcua-table-mapper
Maps message fields to a structured table row format with symbols (string tags) and typed columns. Useful for preparing data for database writes.
- Input: Messages with fields to map.
- Symbol Mappings: Map msg fields to string symbol columns.
- Column Mappings: Map msg fields to typed columns with type conversion (auto, float, double, integer, long, boolean, string, timestamp).
- Timestamp Field: Configurable field path for the row timestamp.
- Output:
{topic, payload: {symbols: {}, columns: {}, timestamp: ...}} - Field Path Syntax: Dot notation (
payload.sensor.value) and array access (payload.readings[0]). - Source Types: msg, flow, global, str (literal), jsonata expressions.
Installation
cd ~/.node-red
npm install node-red-contrib-opcua-config
Or for local development:
git clone <repo-url>
cd node-red-contrib-opcua-config
npm link
cd ~/.node-red
npm link node-red-contrib-opcua-config
Requirements
- Node-RED >= 2.0.0
- Node.js >= 18.0.0
License
MIT