Unavailable devices card and badge
A lamp that lost its WiFi, a sensor with a dead battery, a plug somebody pulled out. Home Assistant shows each of their entities as unavailable, and tells you nothing. This shows the devices that dropped off: the card lists them, the badge counts them.
Both are gone when every device is there. They take no room on your dashboard, and turn up when one goes.
It needs Spook on your dashboards switched on.
The unavailable devices card
The devices that dropped off, the one gone longest at the top. One row per device, not per entity. Per row:
- The name of the device.
- Its integration, and its area when the name does not say it already.
- Since when it is gone.
An administrator selects a row to open the device. That is where Spook's label goes on, for a device that is off on purpose.
What counts as gone
A device is gone when every entity of its own is unavailable, and has been for a day. Its own: the entities of the integration the device belongs to. A helper or a template you put on the device says nothing about whether the device is there.
The day is yours to change. It is a day by default for a reason: plenty of devices are unavailable for a while as part of their day, and none of that is a device that dropped off.
What does not
Every one of these looks unavailable, and none is a device that went:
- Home Assistant starting. Entities come up unavailable until their device says it is there. The card says nothing for the first five minutes after a start, and no device counts as gone because of a restart.
- An integration that reloads, or retries to set up. Its entities are unavailable for a moment, or kept around as restored. That is one integration, not twenty devices. A setup that keeps failing belongs on a list of integrations, not of devices.
- Disabled. A disabled entity, device or integration is not looked at.
- One entity of a device. A device with one unavailable entity and the rest working is a device that works. A sensor it does not have, or a feature that is off.
- Unknown. An entity that is there with nothing to tell yet is not unavailable. A sensor that never had a value at all never dropped off: it never was on.
- A device Spook never saw working. Some entities are unavailable for good, like a feature you do not use. A device only counts as gone after Spook saw it report.
- Spook's own devices.
A hub, and a whole integration
A hub that went takes the devices behind it along: they are on the row of the hub, as With 12 behind it. One cause, one row.
When every device of one integration is gone at once, like an MQTT broker that went down, that is one row for the integration: All 20 devices. Selecting it opens the integration.
Off on purpose
A Christmas tree in July. A printer that is off unless you print. A television at the wall. Spook cannot tell those from a device that broke: they all stop talking. You can.
Put Spook's label, the Excluded from Spook label, on the device, and the card leaves it alone. On its area, and everything in that area. On a hub, and everything behind it too. The card says how, with the name your label has.
A device is on the card until you do. That is on purpose: Spook would rather show a Christmas tree once than hide a dead smoke detector.
A label on only some entities of a device changes nothing: the others still tell whether the device is there. Spook goes by the label itself, not its name. Renamed, it still works.
Since when
Since the moment Spook saw the device go. Spook writes that down, so a device gone for a month still says a month after a restart of Home Assistant. Home Assistant itself starts over at every restart.
What Spook cannot know:
- A device that went while Home Assistant was off gets the moment Home Assistant was back. It may have gone earlier, never later.
- A device that was already gone before you started using Spook's dashboards never showed Spook that it worked. It is on the card once it was back, and went again.
Adding it to a dashboard
- Open the dashboard, and edit it.
- Select Add card, and search for Unavailable devices (Spook).
- Pick your options, and select Save.
While you edit the dashboard, the card is always there, so you can find it again. With every device there, it shows the ghost.
Options
| Option | What it does |
|---|---|
| Title | Shown above the list. None if left empty. |
| Gone for at least | A device that is gone for less is not on the list yet. A day if left empty, a minute at the least. |
| At most | The longest gone first, and a line with how many more there are. All of them if left empty. |
| Stay when every device is there | Off, the card is not there at all while no device dropped off. On, it stays, with the ghost saying all is there. |
In YAML
type: custom:spook-unavailable-devices-card
title: Unavailable devices
unavailable_for:
hours: 4
max_devices: 5
show_empty: false
| Key | Values | Default |
|---|---|---|
title | Any text | No title |
unavailable_for | A duration, like hours: 4 or "04:00:00", a minute up | A day |
max_devices | A whole number, 1 up | All |
show_empty | true or false | false |
The unavailable devices badge
An icon with how many devices dropped off, counted like the rows of the card: a hub with what is behind it is one. Gone at zero. Hover it to see which ones, and since when.
There is nothing to select on the badge: picking one device out of three would be a guess. The card is where they are.
Add it like any badge: edit the dashboard, select Add badge, and search for Unavailable devices (Spook). It takes the same time as the card.
type: custom:spook-unavailable-devices-badge
unavailable_for:
hours: 4
| Key | Values | Default |
|---|---|---|
unavailable_for | A duration, like hours: 4 or "04:00:00", a minute up | A day |
Who sees what
Everybody sees the devices they may see the entities of, administrator or not. In most homes, that is every device.
Only an administrator can open a device from the card, and gets the line on how to mark one as off on purpose: both are about Settings, which is theirs.
Do you want the card for some people only? Use the Visibility tab of the card, and show it to the users you pick.
Always up to date
The card and the badge follow your devices as they come and go, without reloading the page. Putting Spook's label on something, or taking it off, shows within seconds.
They only do work when a device comes or goes. A light turning on somewhere in the house does not make them look again.
Batteries card and badge
A card with every battery that needs attention, lowest first, at your own threshold. Phones, what charges and what carries Spook's label left out. And a badge with how many there are. Both gone when every battery is fine.
Failed integrations card and badge
A card with the integrations that failed to set up or keep retrying, why, and since when, with a reload button. And a badge with how many there are. Both gone when every integration is set up.
