Key OPC UA alarms on ConditionId, not SourceName.ConditionName (OtOpcUa imported conditions) #147

Closed
opened 2026-11-24 22:59:02 -05:00 by dohertj2 · 3 comments
Owner

OtOpcUa (lmxopcua, gRPC data connections phase A3, master 91438049, undeployed) now exposes imported alarm conditions forwarded from another OtOpcUa cluster. Their ConditionId is an opaque c1. NodeId in https://zb.com/otopcua/mapped/conditions, stable for the life of the data connection; their SourceName is <branch>/<origin SourceName> and moves when the primary placement mapping changes (by design — only notifiers and SourceName move).

ScadaBridge keys alarms on SourceName.ConditionName (OpcUaAlarmMapper.cs:45-51), so a mapping change would appear as one alarm disappearing and a new one appearing. Key on ConditionId (OtOpcUa's guidance already says ConditionId is the identity), or at least for conditions in the mapped/conditions namespace.

Needed before OtOpcUa's alarm-forwarding (A4) is fleet-deployed. See lmxopcua docs/AlarmTracking.md "Imported conditions" and docs/plans/evidence/grpc-data-ext/A4-docs.md.

OtOpcUa (lmxopcua, gRPC data connections phase A3, master `91438049`, undeployed) now exposes *imported* alarm conditions forwarded from another OtOpcUa cluster. Their `ConditionId` is an opaque `c1.` NodeId in `https://zb.com/otopcua/mapped/conditions`, stable for the life of the data connection; their `SourceName` is `<branch>/<origin SourceName>` and **moves when the primary placement mapping changes** (by design — only notifiers and SourceName move). ScadaBridge keys alarms on `SourceName.ConditionName` (`OpcUaAlarmMapper.cs:45-51`), so a mapping change would appear as one alarm disappearing and a new one appearing. Key on `ConditionId` (OtOpcUa's guidance already says ConditionId is the identity), or at least for conditions in the mapped/conditions namespace. Needed before OtOpcUa's alarm-forwarding (A4) is fleet-deployed. See lmxopcua `docs/AlarmTracking.md` "Imported conditions" and `docs/plans/evidence/grpc-data-ext/A4-docs.md`.
dohertj2 added the type:featurepriority:p2cross-repo labels 2026-11-24 22:59:02 -05:00
Author
Owner

Update from the OtOpcUa A4 review: an imported condition's SourceName can also change without any config change. The consumer picks the primary placement among the mappings currently contributing; if the primary mapping is temporarily Unavailable/Denied (in retry), another placement becomes primary and SourceName flips, then flips back on recovery. Keying on SourceName.ConditionName would therefore re-key alarms on a transient origin refusal. ConditionId does not move in either case — key on it.

Update from the OtOpcUa A4 review: an imported condition's `SourceName` can also change *without* any config change. The consumer picks the primary placement among the mappings currently contributing; if the primary mapping is temporarily Unavailable/Denied (in retry), another placement becomes primary and `SourceName` flips, then flips back on recovery. Keying on `SourceName.ConditionName` would therefore re-key alarms on a transient origin refusal. `ConditionId` does not move in either case — key on it.
Author
Owner

Follow-up: OtOpcUa A4 round 1 now keeps an imported condition's SourceName stable while its primary mapping is only temporarily not contributing (refused/Unavailable/retrying/capacity). It still moves when (a) the mapping is undeployed or no longer lists the condition, (b) a higher-priority mapping starts listing it, or (c) a condition first seen while the Raw mapping was unavailable starts with the UNS SourceName and moves once Raw lists it. ConditionId never moves in any of these — keying on ConditionId remains the fix.

Follow-up: OtOpcUa A4 round 1 now keeps an imported condition's `SourceName` stable while its primary mapping is only temporarily not contributing (refused/Unavailable/retrying/capacity). It still moves when (a) the mapping is undeployed or no longer lists the condition, (b) a higher-priority mapping starts listing it, or (c) a condition first seen while the Raw mapping was unavailable starts with the UNS SourceName and moves once Raw lists it. `ConditionId` never moves in any of these — keying on ConditionId remains the fix.
Author
Owner

Fixed in d3067ca0 (main @ d4d5be3b). Conditions in the namespace https://zb.com/otopcua/mapped/conditions are now keyed on ConditionId, written in the nsu= form (stable across OtOpcUa failover). ConditionId is read from a new event field, falling back to SourceNode. All other OPC UA conditions keep the SourceName.ConditionName key, so existing alarms, MES scripts and screens are unaffected. A new DisplayName field holds the SourceName.ConditionName text and updates in place. It is carried through AlarmStateChanged, sitestream proto field 26, the debug snapshot (site_command field 22), ScriptAlarm and native_alarm_state.metadata_json. Alarm Summary and Debug View show it. Rows persisted under the old key are retired after the first completed refresh: one return-to-normal, then deleted. Native-alarm-source bindings and filters are unchanged. Unit-tested only: not yet checked against a live OtOpcUa A3/A4 node.

Fixed in d3067ca0 (main @ d4d5be3b). Conditions in the namespace `https://zb.com/otopcua/mapped/conditions` are now keyed on ConditionId, written in the `nsu=` form (stable across OtOpcUa failover). ConditionId is read from a new event field, falling back to SourceNode. All other OPC UA conditions keep the `SourceName.ConditionName` key, so existing alarms, MES scripts and screens are unaffected. A new `DisplayName` field holds the SourceName.ConditionName text and updates in place. It is carried through AlarmStateChanged, sitestream proto field 26, the debug snapshot (site_command field 22), ScriptAlarm and `native_alarm_state.metadata_json`. Alarm Summary and Debug View show it. Rows persisted under the old key are retired after the first completed refresh: one return-to-normal, then deleted. Native-alarm-source bindings and filters are unchanged. Unit-tested only: not yet checked against a live OtOpcUa A3/A4 node.
Sign in to join this conversation.