Skip to content
Stand with Ukraine flag

Device alarm status

  • Widget
  • 20 installs
  • v1.0.0
  • Aug 3, 2026
  • MIT license
  • v4.2+
Device alarm status

Shows one alarm the way an operator reads it: severity, type, how long it has been going on, and whether anyone has acknowledged it. The card takes its colour from the severity, so a row of them is legible at a glance. The figure counts while the alarm is active and freezes when it clears, or keeps counting since it started. Shows the most severe alarm from the source or the most recent, with dark and light schemes.

Widget Type
  • Alarm
Category
  • Cards & Info
  • Gauges & Indicators

Alarm card

Shows one alarm the way an operator reads it: what it is, how long it has been going on, whether anyone has acknowledged it, and which machine it came from. The whole card takes the severity colour, so a row of these is legible from across a room without reading a word.

Features

  • Severity chip, entity name, alarm type, a large duration and a status line — and rows that disappear rather than leaving a gap when you switch them off
  • One colour per severity drives the card, the chip, the text and the buttons, so the palette stays coherent and there is a single field to change per level
  • Six ways to render the time, from 1 h 19 m to 01:19:00 to the moment it started
  • Acknowledge and clear from the card, each button disappearing once its job is done
  • Arrows to step through every alarm the filter matched, pinned to the corner with the buttons beside them
  • Always queries all of time, so an alarm stays visible for as long as it is open, whenever it started
  • Dark and light schemes
  • The duration refreshes on its own, without waiting for the alarm to change
  • One quiet grey state when nothing matches, naming the entity it is watching
  • Optional click action carrying the alarm’s originator

Alarm source

This is an Alarm widget for one entity. Configure that entity and the filter — severity, status, type, propagation, assignee — in the widget’s own Alarm source section. The card passes that filter to the query unchanged and never second-guesses it, on current and older ThingsBoard versions alike, and assigned to current user resolves to the signed-in user.

Filtering to Active alone is what most dashboards want, and the card’s status line then only ever varies in acknowledgement.

The card reads the alarm’s type, severity, status, the time it was raised, and the times it was acknowledged and cleared. A severity the platform does not define reads as Indeterminate rather than breaking.

Alarms to fetch before choosing one only sets how many candidates are considered and counted; one is displayed. Fifty is plenty unless a single entity can hold hundreds of simultaneous alarms.

Time range

An alarm widget’s query is bounded by a time window, which is a trap for a status card: an alarm raised three days ago and still open vanishes under a last hour window, and the card reads No alarms while a machine is down.

The card therefore queries all of time, and gives itself a ten-year window when its configuration carries none at all — as happens with a card created before this behaviour existed. The widget’s time selector consequently has no effect on this card, which is the intent.

When the card stays quiet

Two platform behaviours make an alarm widget go silent without complaining, and both are handled.

An entity alarm source whose filter has not resolved makes the platform answer with an empty page and no error; entity aliases resolve asynchronously, so the card waits for the source and subscribes as soon as it is ready. If it never resolves, the card says Alarm source is not configured rather than implying that all is quiet.

A failure inside the subscription call would otherwise abort everything after it and leave the card on its previous state. It is caught and reported on the card instead.

What the figure counts

Always time in alarm: it runs from the moment the alarm was raised and freezes at the moment it was cleared, so a cleared alarm shows how long the incident lasted rather than how long ago it happened.

How the time reads offers six formats:

Format1 hour 19 minutes3 days 4 hours 12 minutes45 seconds
Compact1 h 19 m3 d 4 h45 s
Short1h 19m3d 4h45s
Words1 hour 19 minutes3 days 4 hours45 seconds
Largest unit1 h3 d45 s
Clock01:19:0076:12:0000:00:45
When it started13:4112 Mar 13:4113:41

Clock keeps counting hours past 24 rather than rolling over, so a long outage reads 76:12:00. When it started swaps the duration for the timestamp, showing the time alone for today and the date as well for anything older.

The figure updates every fifteen seconds on its own. Alarm subscriptions only deliver on change, so without that tick a card would show 1 h 19 m for as long as nothing happened. An alarm with no start timestamp shows , and one stamped in the future reads 0 s.

When several alarms match

The card shows one and offers arrows to walk the rest, in the bottom right corner with the acknowledge and clear buttons just to their left. Browsing starts on the alarm the card would have chosen anyway and counts the position — 1 / 3.

It stays on the alarm you are reading across updates: the list is re-sorted whenever data arrives, so an index on its own would slide you onto a different alarm. If the one you are reading is acknowledged away or cleared out of the filter, the card falls back to the first.

Which alarm decides where browsing starts and what a card shows when browsing is off. Most severe, then most recent suits an overview tile; Most recent suits a feed-style dashboard where the newest event matters more than its level.

Turn Let viewers step through the matching alarms off and the card names the count instead:

On the cardMeans
nothingthe alarm shown is the only match
+1 moreone other alarm, of a different severity
+4 more warningfour others, all at the severity on the chip
+3 more · 1 criticalthree others, one sharing the chip’s severity

The count comes from the page total, so it stays honest when the filter matches more alarms than Alarms to fetch allows; in that case the severity breakdown is dropped, because the severities beyond the page are unknown.

If the count is routinely high, this widget is the wrong shape for that source: it answers “what is the worst thing here”, not “what is going on”. Point it at one machine, or pair it with an alarms table.

Acknowledging and clearing

The buttons call the platform’s alarm service and then update the card immediately, without waiting for the subscription to catch up. Ack is filled, Clear is outlined — acknowledging is the common action, clearing usually belongs to whoever fixed the thing. Each disappears once its job is done, so the card only ever offers what is still possible.

A rejected command — no permission, alarm already handled elsewhere — leaves the card exactly as it was and logs the reason. Clicking a button never triggers the card’s click action.

Settings

GroupDescription
AlarmWhich alarm to show, how the time reads, the status line, the entity name, browsing, the count of others, the text for an empty card, and how many alarms to consider.
ActionsThe acknowledge and clear buttons, and their labels.
AppearanceColour scheme, the severity chip, and whether text scales with the card.
FontsPer-text font settings; leave a size empty to keep the built-in proportion.
Severity coloursOne colour per severity level.

Title, background, padding and margins come from the widget’s own Appearance settings. The card paints its severity tint over whatever background is set, so leaving the widget background transparent gives the cleanest result.

How the colours are derived

Each severity has one colour. On a dark dashboard the card background is that colour at 28% brightness, the chip at 50%, and the text is the colour mixed 41% towards white. On a light dashboard it inverts: card and chip are the colour mixed 90% and 78% towards white, and the text is the colour at 62% brightness. Change Critical to your own red and the whole card follows — including the filled Ack button, which uses the text colour as its surface and the card colour as its ink.

The quiet state uses the Indeterminate colour deliberately, so a card with nothing to report never looks like a card with something to report.

Sizing

The card uses fixed proportions chosen to fit its default size — chip 10 px, entity 12, alarm type 15, figure 26, status line 12, buttons 11 — so a wall of cards has identical type no matter how each one is sized. That is the default: Scale the text with the card size is off.

Turn it on and one scale is chosen so the whole column fits the space available, then eased back a tenth so the text is not pressed against the edges; every text follows that scale, and a size you set on any font scales along instead of being exact.

Either way the figure is capped to the width, so 3 d 4 h cannot push past the edge, and a card too short for everything drops rows rather than clipping them: the status line first, then the buttons and arrows, then the severity chip. At the default 4×3 nothing is dropped even with a two-line alarm type.

Tips

  • One card per critical machine, filtered to that machine’s alarms, reads better than one alarm table for the whole plant. The table answers “what happened”; these answer “is anything wrong right now”.
  • The entity name in the corner is on by default and worth keeping: it is the only thing that tells you which machine a card is about when several look alike.
  • Point the click action at an alarm details or machine dashboard state — the action receives the alarm’s originator, so the target can open on the right entity.
  • If a card looks permanently dramatic, check the filter: it is probably still matching cleared alarms.

Share Your Widget with the Community

Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.