Device heartbeat grid
Which of them stopped talking? Every device becomes one cell, colored either by how long it has been since anything arrived from it or by a status value the device reports about itself, so a fleet of four hundred is read at a glance instead of row by row. The cells resize themselves to fill whatever space the dashboard gives them, counts per state sit beside the title, and a cell names itself and its last reading on hover.
Who it’s for
Whoever gets asked whether the fleet is alright. A connectivity or operations engineer with a few hundred sensors on a gateway, a service provider who owes a customer an availability number, an integrator commissioning a site and needing to see which units were provisioned but never spoke. The question is never “what is device 214 reading” — it is “is anything wrong, and with which ones”, and a table of four hundred rows answers that only by being read.
What it does
Two hundred sensors report every minute. One stops. Within ten seconds its cell turns red on its own, the count beside the title reads 199 reporting · 1 silent, and hovering the red cell says which pump it is, that nothing has arrived for three hours, and what it last sent.
- Turns a fleet into one picture: one cell per device, colored by whether it is alright, and sized so the whole fleet fits the widget it is given.
- Decides “alright” one of two ways — by how long since the last reading, or by a status value the device reports about itself, with as many statuses as the device actually has.
- Keeps the colors honest between updates. A device that goes quiet sends nothing to trigger a redraw, so the ages are recomputed on a clock rather than on arrival, and a failure shows up without anything having to happen.
- Separates “never reported” from “stopped reporting”, because the first is usually a provisioning mistake and the second is a failure.
- Names the device, its state and its last reading on hover, and opens whatever you wire to a cell click.
- Shows state, not history. For when a device went quiet and how often, pair it with a time series chart on the same entity.
How to set up
Data keys
Add one datasource per device, each with a single key.
- One key per device —
TimeseriesorAttribute. The device’s pulse. In freshness mode the key’s value barely matters — its timestamp is what is read, so any key the device reports regularly will do. In value mode the key is the status being judged. A device whose key has never been written is drawn in the no-reading color rather than treated as a failure, and with no datasources at all the widget says so instead of drawing an empty grid.
State
- What decides a device’s color — time since the last reading by default. Freshness needs no cooperation from the device and is the only thing you can ask of one that has gone quiet. The value itself is sharper when the device reports its own health flag — but a device that dies without saying so keeps its last color, so choose freshness when the failure you fear is silence.
- Values that count as healthy —
trueby default. Matched against the key’s latest value, ignoring case. Comma separated for several, such astrue, ok, running. - Values that count as a warning — empty by default. An optional middle state
for a key with more than two statuses, such as
degraded, maintenance. Left empty, a value is simply healthy or not, and anything in neither list counts as a fault.
Freshness
- Still reporting if heard from within (minutes) — 5 by default. Set it a little above the device’s reporting interval. Too tight and the whole fleet flickers between reporting and late on every cycle.
- Late if heard from within (minutes) — 60 by default. The grace period before a device counts as silent. Anything older is a problem rather than a delay.
How to customize
- To match your own severity palette — set Good, Warning, Bad and No reading. The same four colors serve both modes: good is reporting on time or a healthy value, bad is silent or a value in neither list.
- To arrange the devices — set How the devices are arranged. By name, the default, is the order a person can navigate: when a cell turns red, knowing roughly where its name falls is how you find it. Datasource order is the order they appear on the widget’s Datasources tab, which is yours to arrange only when you added them one by one — an entity alias resolves in whatever order the platform returns, and that can differ between loads.
- To drop the counts beside the title — turn off Show the counts beside the title. They are the number someone reports upward, so it is worth a reason.
- To see every state at all times — turn off Leave out states with nothing in them. On by default a healthy fleet reads as one number rather than four, three of which are zero.
- To restyle the counts — set Count, Caption font and Caption. The caption pair also styles the hover text and the no-data message.
Tips
- Point the widget at a key the device sends on its own schedule, not one written by a rule chain. A key another process refreshes makes the grid report on that process rather than on the device.
- Set the first threshold from the reporting interval, not from how quickly you want to know. A fleet reporting every fifteen minutes and judged against five will spend most of its life amber.
- Use value mode when the device already publishes a health flag, and add the warning list rather than collapsing three statuses into two — a unit in maintenance and a unit that has failed should not be the same color to whoever is on call.
- Wire the cell click to a dashboard state carrying the entity, so the grid becomes the way into a single device rather than only a picture of the fleet.
- Give the widget room. The cells size themselves to the space, so the same configuration is a wall display at full width and still readable at a quarter of it, but a fleet of four hundred in a tiny widget will scroll.
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.