ZHA - TheThinkingHome/device_sentinel GitHub Wiki

ZHA

Device Sentinel integrates directly with ZHA out of the box. There is nothing you need to configure. Here is what the integration does behind the scenes when you use ZHA as your Zigbee stack.

The Coordinator Watch

When your ZHA coordinator loses power, crashes, or is unplugged, every single device on your Zigbee network goes silent at the exact same moment. If we treated that as individual device failures, your phone would explode with alerts.

Instead, Device Sentinel watches the ZHA integration directly via a Bridge: ZHA sensor. When the radio stops, you get one single alert naming the coordinator and counting the casualties behind it. When it comes back, that row counts your devices home as they rejoin and gives the slow ones a few minutes before any of them is reported on its own.

More importantly, the silences that occur during this outage are safely thrown out. An outage does not stretch every device's freeze window, so a bad night for your server doesn't permanently ruin the learned rhythms of your entire fleet.

(Note: Two devices keep their own rows during an outage: one that was already broken well before it, and one that stubbornly refuses to come back after the coordinator recovers. A device that failed in the minutes just before the outage was confirmed belongs to the outage.)

Recognizing Your Handiwork

Zigbee2MQTT opens a readable "pairing window" that we can watch. ZHA handles this differently; it does not broadcast an open window, but it does announce when a device is actively re-paired, reconfigured, or removed.

Device Sentinel listens for these specific announcements. If a silent device suddenly wakes up right after being handled in ZHA, the integration knows it was your doing, not a natural recovery. It safely discards that silence gap instead of learning it, and marks it no (handled) in the silence episodes report.

For manual fixes that ZHA cannot announce, like pulling a battery or power-cycling a bulb, remember to use Maintenance Mode so your repairs aren't mistakenly learned as normal behavior.

What ZHA Cannot Do

ZHA does not feature a native "Availability" timeout like Zigbee2MQTT does. Because of this, Device Sentinel cannot offer a "second opinion" beside its own freeze verdicts. On a ZHA network, the freeze verdict stands entirely on Device Sentinel's own learned rhythms.

This limitation does not change whether a fault is caught; it only changes how much corroboration you see beside it.

The Large Mesh Blind Spot (Help Wanted)

On a small network, when the coordinator fails, everything fails. What we have not captured in the real world yet is a partial mesh failure: a scenario where one branch of a massive network dies while the coordinator stays up.

If you run a massive ZHA mesh and watch a branch die on its own, a diagnostics download taken while it is happening is worth more than any description of it. Open an issue titled "ZHA partial mesh" at Issues and attach your diagnostics file (which carries device names, but no passwords or tokens).

See Also