I use an old 12vdc wall wart (transformer) connected to a 12v relay, I then connect the relay to my Ocelot and whenever the power goes out, the relay turns off and my Ocelot says the power is out.
This had the advantage as I had all the parts laying around, and there is a small buffer built in...