Matter - is there a notification on device Reboot

Is there any way for a driver to receive notification of a device reboot (e.g., due to device restart or if it has been powered off then plugged back in).

After a few power off / on test on some of my devices - if looks the device loses attribute and event subscription and there is a need to re-perform attribute and event subscription within the driver.

Section 11.1.6.1 of the Matter 1.2 Core spec references a StartUp event, but if the device has lost event subscription, I'm assuming it won't be received (and I've been unable to detect any such events)

So, my question - is there some kind of a reboot event that is broadcast by a node to all other devices on the node's fabrics at startup that can the be received by every driver, regardless of subscription states, to inform a driver that it should re-initialize? I'm envisioning something like this is critical to keep the system working without a lot of manual monitoring. Anybody know?

Devices can't subscribe to events, but if they have the Initialize capability, the initialize() method will be run at start up.

I understand that's the case for startup of Hubitat. But what about when Hubitat is operating, the device undergoes a power-cycle with a delay before restarting, and then the device re-starts. I don't think that calls Initialize (or does it?)

Any time the hub reboots a device with the Initialization capability will call the initialize() method.

To clarify - when I referred to the "device" rebooting, I was not talking about the Hubitat hub. I'm looking for information on how to recover when it is the end-device that does a reboot. I.e., the dimmer switch goes offline and restarts, a light bulb was unplugged then plugged back in and needs to reconnect, etc. . How does the hub know that one of many end-devices has restarted and how does it tell the driver so the driver can re-initialize device subscriptions?

We don’t even receive this (yet)

4 Likes

That clarifies it. Thanks. At least I know I'm not just missing something.

As a backup, I guess I could set a subscribe with some reasonable "maximum" report time and if the driver doesn't hear anything within the maximum, assume a re-subscribe is needed.

1 Like

That's what I do in my Matter drivers.
A healthCheck scheduled job pings the device every hour (configurable). If the device has been reset, the next ping (reading the Basic Information Cluster: DataModelRevision attribute) will fail, resulting in automatically calling the initialize() method of the driver.

An idea for a temporary workaround - we could use location.hub.uptime to distinguish between the initialize() method being called because of a recent hub reboot or because of unknown matter reasons...

1 Like