I have been making my own Zigbee module.
It is a DC powered Environment Sensor. At current state, it has battery backup and expansion port. I think this single module has all the ingredient that you need.
The battery backup allow the module still running in the event of power loss.
The module has digital input expnasion that can be wired with a relay, transistor, or in my case opto-isolator to sense the 5V input power.
Here is a demo how it work.
As a note, my dth abstract out the expansion pad as a child device. I have motion device handler that I can use to quickly show how it work. It will be easy to abstract out the digital input state to any capability.
The module is a Zigbee Router as well.
I hope this is useful information for anyone who is looking for a way to detect power loss in one module.