OPC UA alarms and events
This page explains collection and verification of OPC UA alarm and event notifications. During configuration, type browsing and rule previews connect directly from the taosX host to the Server, not through taosX-Agent. Verify event tasks separately from ordinary-Point tasks.
Entry point: taosExplorer → Data Ingestion → OPC UA alarm and event configuration.
An ordinary event is one notification. An alarm may undergo multiple state changes, such as activation, acknowledgment, return to normal, and confirmation. This page collects Server-pushed notifications. It does not acknowledge source alarms or guarantee retrieval of all source historical events.
1. Prerequisites
Confirm that the OPC plugin and Server support event subscriptions, and obtain event-source browsing, subscription, and required method permissions. Prepare endpoints, certificates, and user authentication using OPC UA. Have an authorized TDengine TSDB administrator create a separate test database. Do not reuse business alarm tables with different structures.
Ask the source administrator for an event source and type approved for testing, and a test notification that can be triggered. Do not cause real equipment failures for verification.
1.1 taosX accesses the Server directly during configuration
Event capability detection, event-type browsing, event-source browsing, and configuration rule previews all access the OPC UA Server directly from the taosX host. These four configuration operations are not forwarded through taosX-Agent. A successful ordinary Point-value connection through an agent does not prove the same path is available for event configuration.
Before configuration, check endpoint address, routing, and ports on the taosX host. Prepare client certificates, private-key access, Server trust, and user browse permissions for the actual service identity. Browser access to the endpoint, or endpoint access only from the agent host, is insufficient. Use the same endpoint, security policy, and user identity as production collection so browsed types match the scope that the runtime identity can subscribe to.
If only the agent host can access the source, first confirm the supported event configuration path with deployment staff. Do not temporarily open production networking to pass a preview, or copy ordinary-Point agent configuration directly to event browsing. If a request carrying an agent returns A&E browse via agent is not supported yet, first resolve the configuration execution location. This error only says that configuration-stage agent browsing is unsupported. Whether the production event task can run through an agent still requires separate verification in the actual deployment.
2. Configure and preview
- Add an OPC UA task and select the test database. After confirming direct Server access from taosX as described above, configure connection and authentication and check connectivity. If production collection needs an agent, first confirm the deployment's event configuration path. After the ordinary connection check passes, separately complete capability detection, type and source browsing, and rule preview.
- Select alarm and event configuration, choose the required event types, then narrow the scope to one test event source. Omitting event sources may leave sources unrestricted; check scope explicitly.
- For initial alarm lifecycle verification, leave minimum severity empty so low-severity notifications such as return to normal are not filtered out. Decide filtering of ordinary events separately according to business needs.
- Generate Configuration Rule Preview and record matched types, supertable/child-table naming, columns, primary keys, and filter conditions. This preview is derived from configuration, not real events already received.
- Submit and start, then ask the source administrator to trigger an approved test notification.
2.1 Choose the correct tab and collection mode
The Point set has four mutually exclusive tabs: Select Data Points, Upload CSV Configuration File, Select Points from Tree, and Alarms and Events. Select the last tab for this page. Submission uses only the current tab and does not merge ordinary-Point configuration from other tabs into the event task. To collect both process values and events, create separate Point-value and event tasks and verify each independently.

After selection, Collection Configuration automatically locks the mode to event; do not select observe or subscribe again. Do not switch back to an ordinary-Point tab to change an event collection interval.
2.2 Narrow by type and source
- Click Event Types, find the administrator-provided type by name or NodeId, check inheritance and fields, then select and confirm. Selecting a parent type includes its subtypes; one parent node does not mean only one concrete alarm type is received.
- Click Event Source Filter and find the actual source by name or NodeId. On Servers exposing an event-source tree, expand an area and select the required leaf sources. Selecting an area may include every source underneath it. Review each entry before submission.
- If the interface reports that the Server does not expose an event-source hierarchy, enter the administrator-provided SourceNode NodeId and press Enter to add it. No hierarchy does not mean no events, and a type NodeId cannot be used as a source.
- Minimum Severity accepts
1–1000and receives notifications at or above the specified severity. Empty means no filtering by this field. Leave it empty for initial alarm lifecycle verification, then review the threshold against actual business requirements.
The following image illustrates type-tree selection. Types and NodeIds come from an example Server, not a fixed list available at every site:

The following image illustrates a source tree. Replace source names with actual site nodes. If only one production line is needed, do not select the Server root instead of that line.
If type or source lists differ from the administrator's information, first confirm the connected endpoint, security identity, and browse permissions, then refresh using the interface. Refreshing accesses the Server; control its scope. Do not repeatedly refresh the entire tree instead of diagnosing permissions. Even ordinary events without alarm lifecycles can lose business notifications through severity filtering; confirm audit requirements as well.
2.3 Read the configuration rule preview
After selecting at least one event type, click Generate Preview and check each item:
| Preview content | Before submission |
|---|---|
| Matched event types | Include subtypes expanded from selected parent types. Confirm that no unwanted notification types are introduced. |
| Supertable and fields for each type | Review column names, target types, tag flags, and event primary keys by type or page. Do not check only the first page. |
| Effective filters | Type, SourceNode, and severity match the selections. For a complete alarm lifecycle, confirm that no severity threshold was set accidentally. |

The preview connects from the taosX host to the source and derives a model from type and other metadata. Local network access, certificates, and browse identity must remain available during preview. It does not establish a production event subscription or write target data, and cannot prove actual event field values, source acceptance of subscriptions, or successful target writes. If it is empty or errors, first check type selection and browse errors rather than repeatedly submitting empty configuration. Table names, counts, and fields in the image are illustrative; use the current Server's actual preview.
2.4 Event options in a direct DSN
For a direct DSN, set collect_mode to lowercase event. event_types must contain at least one complete event-type NodeId, not merely an interface display name. event_source_filter uses complete SourceNodes; omitting it adds no source filter. An explicit event_min_severity must be 1 to 1000; 0 does not disable filtering.
Type and source lists use ASCII commas. Semicolons, equals signs, spaces, and other characters must still be encoded according to the complete DSN's URL rules. Shell quoting does not replace encoding, and NodeIds must not be split arbitrarily. If a NodeId identifier itself contains a comma, do not assume backslashes or URL-encoding the entire value preserves it as one list item. First confirm that the supported entry point can express it. Check the actual endpoint and approved scope, then verify real events. For exact types, defaults, and reporting parameters, see OPC collection and runtime parameters.
3. Models and verification
Different event types use separate models. Do not assume all alarms share a fixed table name. Event tables identify records using time and event_id together; distinct events at the same time cannot be deduplicated by time alone.
Run SHOW <测试库>.STABLES; and SHOW <测试库>.TABLES; in the taosExplorer Data Browser or taos CLI, replacing placeholders with the actual database. Run DESCRIBE <测试库>.<实际表>; on tables recorded from the preview, confirm time, event identifier, and state columns, then query recent records in the test window.
Compare event time, event ID, severity, source, and message with the source. For alarms, check notifications such as activation, acknowledgment, and return to normal using the actual Server-supported workflow, not only one activation record. Use actual generated state-column names rather than copying fields from another event type.
3.1 Type and event-source selection
The event-type tree discovers BaseEventType and its subtypes; selected types also include their subtypes. Type and event-source trees contain different objects: the former determines notification types, while the latter restricts sources by SourceNode. If the Server lacks a complete event-source tree, enter actual SourceNode values in the interface. Do not use an event-type NodeId as a source NodeId.
The event Server must have corresponding event/alarm capabilities, and the EventNotifier of Server node i=2253 must permit event subscriptions. OPC Classic AE (DCOM) cannot be ingested directly using this page; a supported UA Wrapper must expose it as UA. A Wrapper may not expose every semantic field from the original system. Alarm snapshots also require the corresponding ConditionRefresh call. Not needing alarm acknowledgment permissions does not mean every protocol method call must be prohibited.
3.2 Automatic modeling rules
| Object | Ingestion rule |
|---|---|
| Supertable | Separate by event type, with prefix st_alarm_ for alarms and st_evt_ for ordinary events. Convert the type name to lowercase snake case, then check trailing _alarm_type, _event_type, alarm_type, and event_type in that order, removing only the first matching suffix. Retain other type suffixes. |
| Example types | ExclusiveLimitAlarmType produces st_alarm_exclusive_limit, and DoorOpenedEventType produces st_evt_door_opened. AcknowledgeableConditionType in the preview image matches none of these suffixes and produces st_alarm_acknowledgeable_condition_type. |
| Alarm child table | Organized by alarm condition instance, accumulating repeated triggers and state changes for that alarm Point. A new table is not created for each alarm occurrence. |
| Ordinary event child table | Organized by event source, with each notification written as a separate row. |
| Child-table name | Composed from the supertable, SourceNode, and alarm ConditionName, among other fields. Invalid characters are normalized. Long names may be truncated with a hash; do not guess final names by concatenating strings. |
| Primary key | ts is event time; event_id is the second primary key, VARCHAR(64), storing the event ID as a hexadecimal string. |
| Schema maintenance | Added fields can extend target columns; removed fields do not delete existing columns. Existing incompatible structures still need handling. Arbitrary changes are not guaranteed to be automatically compatible. |
3.3 Field types and state columns
| OPC UA type | TDengine type |
|---|---|
Boolean | BOOL |
SByte, Byte, Int16, UInt16, Int32 | INT |
UInt32, Int64, UInt64 | BIGINT |
Float | FLOAT |
Double, Duration | DOUBLE |
DateTime, UtcTime | TIMESTAMP |
ByteString | VARBINARY(255); EventId separately uses VARCHAR(64) as a primary key. |
StatusCode | INT |
String, LocalizedText, NodeId, ExpandedNodeId, QualifiedName | NCHAR(255) |
| Structures or unknown types | NCHAR(255) |
Default mappings do not guarantee lossless storage of arbitrary unsigned values, oversized text, or complex structures. Check ranges, lengths, and write errors with actual samples, not only column names.
State fields such as ActiveState, AckedState, ConfirmedState, and EnabledState split into Boolean xxx_id and readable xxx_text, such as active_state_id and active_state_text. State text is not a stable basis for Boolean decisions. Prefer the corresponding Boolean column when filtering active states. Whether a field exists depends on the selected type's preview.
Common tags are device_id, source_node, source_name, event_type, and server_endpoint. Alarms also include condition_id and condition_name, with type NCHAR(255). device_id comes from event information and does not guarantee an automatically shared device dimension with ordinary-Point tasks. Check tag values before joins.
3.4 Lifecycle queries
Assume the test database is opcua_ae_demo, and the source provides ExclusiveLimitAlarmType with the following state fields. Replace the database, type, and condition names with site values. Run the following in the taosExplorer Data Browser or taos CLI:
DESCRIBE opcua_ae_demo.st_alarm_exclusive_limit;
SELECT ts, event_id, severity, active_state_id,
acked_state_id, confirmed_state_id, message
FROM opcua_ae_demo.st_alarm_exclusive_limit
WHERE condition_name = 'Tank1_Level'
ORDER BY ts DESC LIMIT 20;
For example, activation, acknowledgment, return to normal, and confirmation of the same alarm Point produce multiple rows with different event_id values, rather than a later state overwriting the same notification. The following table illustrates result interpretation, not a mandatory four-step workflow for every Server:
| Notification | active_state_id | acked_state_id | confirmed_state_id | Observation |
|---|---|---|---|---|
| Activation | true | false | false | Source limit-exceeded notification. |
| Operator acknowledgment | true | true | false | Acknowledgment occurs at the source HMI/SCADA, not through taosX. |
| Return to normal | false | true | false | Severity may decrease; do not filter it out with a threshold during initial verification. |
| Confirmation | false | true | true | Support depends on the source type and configuration. |
Different events with the same source time are distinguished by event_id. Deduplication of resent snapshots depends on their actual event times and IDs. Even with a composite primary key, check the actual Wrapper for duplication or loss.
4. Troubleshooting
| Symptom | Check |
|---|---|
| Preview shows structure but no records arrive | Check that an actual test event was generated after the subscription took effect, and that source and type filters match. |
| Activation appears but return to normal does not | Check whether the source sends return-to-normal notifications and whether severity or type filters exclude them. |
| Unexpected record counts at the same time | Check event_id, composite primary keys, and actual table structure; do not compare by time alone. |
| Vendor-defined types missing from the list | Check endpoint, type-browsing permissions, and source exposure of type inheritance. A standard type list does not prove vendor types are absent. |
| Rule preview fails | Confirm selected event types, then check source metadata browsing and plugin logs. A preview is not a target-data query. |
For other task, write, and runtime problems, see Troubleshooting by symptom.
5. Stopping, recovery, and limitations
After stopping and recovering the original task, check active alarm snapshots and new events after recovery. Snapshot behavior such as ConditionRefresh does not replay all offline event history. The source must guarantee historical audit completeness. Verify severity filtering, disconnection windows, and multiple event types separately.
Cold starts and reconnections attempt to retrieve a snapshot of currently active alarms. If the source does not support or rejects ConditionRefresh, subsequent new events may still arrive, but this does not establish that existing active alarms were recovered. If logs show ConditionRefresh not accepted by server, ask the source administrator to confirm method support and authorization. Use Logs and performance to collect logs and target results for the same window. Do not blindly grant alarm acknowledgment or control permissions as a workaround.
Collection on this page does not execute Acknowledge, Confirm, or AddComment, and does not write back to Points. Servers, subscriptions, and browsing still consume resources. Assess subscription scope; read-only does not mean no production impact. The current entry point filters by type, source, and minimum severity. It does not offer arbitrary handwritten ContentFilter expressions or per-field selection. A static preview does not verify Server acceptance of a real subscription.