Trigger rule when ZigBee device registers on network


I am trying to configure a trigger when a device registers on the zigbee network.

I have a Ledvance zigbee plug, which is added to hubitat and is working fine (i can turn it on and off via the hub). The downside of this plug is that it doesnt "remember" its state when it gets unpluggeed from the wall and then replugged (or a power outage occurs).

My initial go-to idea was to just "Capture" the device state every time a "switch" event occurs (ie the switch turns on and off) and then "Restore" the state when the device registers on the zigbee network (ie when it says "im online and can be controlled").

Initially i thought the device sends a "power" event every time when it connects, but that doesnt seem to be the case (the "power" event only seems to be sent when the "configure" option is used).

When i enable debugging logs on the switch, and i unplug/replug it, i see the following things in the logs:

dev:12023-06-22 05:33:40.688 PMinfoTest ledvance plut is off [physical]

dev:12023-06-22 05:33:40.685 PMdebugdescMap:[raw:185C0300060800001000, dni:185C, endpoint:03, cluster:0006, size:08, attrId:0000, encoding:10, command:0A, value:00, clusterInt:6, attrInt:0]

dev:12023-06-22 05:33:36.708 PMdebugdescMap:[raw:catchall: 0000 0013 00 00 0040 00 185C 00 00 0000 00 00 005C188EB20A0AAA3EB07C8E, profileId:0000, clusterId:0013, clusterInt:19, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:185C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[00, 5C, 18, 8E, B2, 0A, 0A, AA, 3E, B0, 7C, 8E]]

So the question is - how can i setup a rule in Rule machine (or any other way) - to trigger, when this "event" happens? Is it possible at all?

PS: the plug is added as a "generic zigbee plug"

There are drivers for Generic Zigbee devices that support presence. I would think you can try the one for the Generic Zigbee Outlet and see if it works properly, if it does you can then create a rule that if the device changes from not present to present as the trigger.

Here's a link to the topic of the drivers with download links... [Release] Generic Zigbee Drivers with Presence and Recovery