Skip to content
© 2026 The ThingsBoard Authors
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Alarms Count

Use this node to count alarms matching configured criteria and write the count as telemetry — for example, maintaining a real-time activeAlarmCount metric on a device asset that increments when new alarms are created and decrements when they are cleared, or tracking how many critical alarms occurred in the last 24 hours.

  • Count alarms for propagation entities — when enabled, counts alarms not only for the message originator but also for all entities to which those alarms are propagated.

A table where each row defines one alarm count metric:

Field Description
Target telemetry Key name on the entity where the alarm count is stored
Status filter Restrict to alarms with specific statuses (e.g., ACTIVE_UNACK). Leave empty to include all statuses.
Severity filter Restrict to alarms with specific severities (e.g., CRITICAL, MAJOR). Leave empty for all severities.
Type filter Restrict to alarms of specific types. Leave empty for all types.
Specify interval When enabled, only count alarms created within a configured time interval.
  1. Receive an alarm-related message: ALARM, ALARM_ACK, ALARM_CLEAR, or ENTITY_CREATED / ENTITY_UPDATED about an alarm.
  2. For each mapping row, execute an alarm count query against the originator entity (and propagated entities if configured), applying the status, severity, type, and time interval filters.
  3. Write each count result as a POST_TELEMETRY_REQUEST message with the originator as the entity.
  4. Route generated messages via Success. If the count query fails for an entity, route a failure message via Failure.
Connection Condition
Success Generated POST_TELEMETRY_REQUEST for the entity with the alarm count.
Failure Alarm count query failed; failure message contains the reason.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "TbAlarmsCountNodeConfiguration",
"type": "object",
"additionalProperties": true,
"properties": {
"countAlarmsForPropagationEntities": { "type": "boolean" },
"alarmCountMappings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"targetKey": { "type": "string" },
"statusList": { "type": "array", "items": { "type": "string" } },
"severityList": { "type": "array", "items": { "type": "string" } },
"typeList": { "type": "array", "items": { "type": "string" } },
"specifyInterval": { "type": "boolean" }
}
}
}
}
}