How can I identify when my Matter device is disconnected from the hub?

Hi there,
I’m developing a Matter device and I would like to know if is there any option to check when my device connects and disconnects to the hub.