Hi,
Unfortunately to query the state of the main power source would require us hardware and software changes to be made on the device , so it's not really possible with current functionality. The only way would be probably having some kind of external circuit that would control incoming power to your device and if it would be connected to digital input - it could alert you on power loss or power receive.
EB.