Instead of writing to a text file I was thinking about triggering a battery powered timer to start when power is lost and stopped when it comes back on and make sure it doesn't reset every time it starts. That way you'll know the total length of power outage from the last time you checked the timer. I would definitely like to build something like this but have no idea where to start. I just registered today.