Key OPC UA alarms on ConditionId, not SourceName.ConditionName (OtOpcUa imported conditions) #147
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
OtOpcUa (lmxopcua, gRPC data connections phase A3, master
91438049, undeployed) now exposes imported alarm conditions forwarded from another OtOpcUa cluster. TheirConditionIdis an opaquec1.NodeId inhttps://zb.com/otopcua/mapped/conditions, stable for the life of the data connection; theirSourceNameis<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 onConditionId(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" anddocs/plans/evidence/grpc-data-ext/A4-docs.md.Update from the OtOpcUa A4 review: an imported condition's
SourceNamecan 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 andSourceNameflips, then flips back on recovery. Keying onSourceName.ConditionNamewould therefore re-key alarms on a transient origin refusal.ConditionIddoes not move in either case — key on it.Follow-up: OtOpcUa A4 round 1 now keeps an imported condition's
SourceNamestable 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.ConditionIdnever moves in any of these — keying on ConditionId remains the fix.Fixed in
d3067ca0(main @d4d5be3b). Conditions in the namespacehttps://zb.com/otopcua/mapped/conditionsare now keyed on ConditionId, written in thensu=form (stable across OtOpcUa failover). ConditionId is read from a new event field, falling back to SourceNode. All other OPC UA conditions keep theSourceName.ConditionNamekey, so existing alarms, MES scripts and screens are unaffected. A newDisplayNamefield 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 andnative_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.