How to check a device still online in the ZigBee network

Big thank you for this. I used it as a base to create a Homeyscript to copy what I did earlier in dzVents on Domoticz. Both to get the status of the ligths and also to turn of the lights if they are contiuously unreachable for set time period.
I posted and discussed the code here: topic