To alert on missing data, give silence its own alarm that fires when no reading has arrived for a set time; a threshold alarm only judges values that exist. Set the time from the reporting interval, watch each value you alarm on as well as the device, and alarm on the gateway rather than every sensor behind it.
I design dashboards and alarm screens for factories, cold rooms and buildings. A sensor that stops sending opens no high or low alarm, and a value tile can keep showing its last reading.
How do you detect that a device stopped sending data?
Keep the time of the last message per device and compare it with the clock on a timer. The check has to run on a schedule, because absence brings no message that could trigger a rule.
Rules that run when a reading arrives never see the reading that did not come. A query has the same blind spot: one that looks for values above a limit returns nothing during an outage, and an empty result raises no alarm. Ask instead how long ago the last reading arrived, or count the readings in each window and alarm when the count is zero.
How long should you wait before an offline alarm?
I wait for two missed reports plus a margin for network delay. A shorter wait alarms on one lost message; a longer one spends the time someone needs to react.
| Device reports every | Missing-data alarm after (my starting point) |
|---|---|
| 1 minute | 3 to 5 minutes |
| 15 minutes | 35 to 45 minutes |
| 1 hour | 2 to 2.5 hours |
Two limits move these numbers. Devices on mobile networks drop and rejoin, so give them more margin. And the wait can never be longer than the process can drift unwatched: a cold room probe that reports hourly may need a shorter reporting interval rather than a longer timeout.
How do you detect a stale sensor value while the device stays connected?
Watch each value you alarm on, not only the device. A device can stay connected, and even keep sending other values, while one sensor behind it has stopped.
Under MQTT 3.1.1, a client with nothing to publish keeps its network connection open with PINGREQ packets, and, when a keep alive is set, the server must disconnect it if no packet at all arrives within one and a half times the keep alive period. So online only tells you the client is alive. Per value, I use a timer that each new reading restarts: when it runs out, the alarm opens, and the next reading clears it. A value stuck at one number is a different fault, caught by the no-change check I mentioned under sensor spike filtering.
Hermetry connects field devices to live dashboards, rules and alerts: IoT telemetry and SCADA in one platform. Its Device offline rule on a device profile opens an alarm a set time after the device goes offline, from 10 seconds to 7 days with 600 seconds as the default, or at once when the device has sent nothing for the profile’s inactivity timeout. The rule does not look at telemetry content; for one value that goes silent, a recipe in the flow cookbook uses a watchdog that raises an alarm after 15 minutes without a temperature and clears it when one arrives.
How do you stop one dead gateway from raising a hundred alarms?
Alarm on the gateway’s silence, and make the sensors behind it depend on that alarm. When the gateway is offline, hold back their missing-data alarms or roll them into the gateway’s.
A hundred alarms with one cause bury the one that names it, and the operator has to work out that they share a gateway. I write the gateway alarm’s text as the first action, for example checking power and the link at the site, and raise sensor alarms only while their gateway is online.
Frequently asked questions
Should a missing-data alarm clear itself?
Yes, when fresh data arrives, but keep it in the history. If a gateway later sends buffered readings with their original timestamps, the chart fills in, yet the alarm was still right: nobody could see the values while they were missing.
What severity should a missing-data alarm have?
As high as the alarm the silent sensor protects. When a cold room probe stops reporting, nobody can see a high temperature either, so its missing-data alarm gets the same severity as the high-temperature alarm. An office comfort sensor can stay at the lowest level.
Can a missing-data alarm replace a check on the sensor itself?
No. It tells you the data stopped, not why. A failed probe, a cut cable, a flat battery and a lost link look the same from the dashboard, so the alarm text should list what to check on site, quickest first.

