Short power failures have almost no effect on an aquarium, but if your electricity is out for much longer it is worth taking measures to make sure that your fish are OK.
The largest problem that occurs during a power failure is not temperature, which will only change slightly, but the effect that is has on the beneficial bacteria (BB) in your filter and substrate. Without a continuous supply of oxygen created by water flowing through the filter the BB begin to slowly die, and won’t be able to process all of the fish waste products. If the power failure is only an hour or less, bacteria in the filter will likely quickly recover after the filter resumes running, but if the power is off for much longer than that it can create a significant problem. External hang on the back (HOB) filters which are exposed to air will degrade the slowest along with box filters that are in an aquarium. Sealed external canister filters degrade the quickest and are the slowest to recover their BB after a power failure due to them being sealed and a lack of oxygen until the electricity and water flow continues. If the power failure is longer than an hour the media in a sealed canister filter should be removed and placed in aquarium water. A bucket works well for this or even leaving the lid off of the canister filter. If you leave the lid off, make sure all the valves are closed, or the canister filter is elevated, so water does not siphon from the tank to the……floor!
During a power cut keep feeding levels to a minimum. No food at all is best, and keep an eye on water quality by doing water tests. You do have a test kit don’t you?
You want to make sure that ammonia stays at or extremely close to 0 ppm as well as nitrites. Nitrates should preferably be in the 0-10 ppm range. If you see any ammonia, any nitrites, or nitrates over 10 ppm do at least a 20% water change and check you readings again. Always use water of the same temperature as the aquarium when doing water changes and make sure it has been treated for chlorine or chloramines if they are present in your tap water. Give your aquarium at least 2 weeks to fully recover after a power failure and a month after an extended power cut. Monitor your tanks water daily during this time and make sure that ammonia and nitrites are at 0 ppm. If not, do daily water changes of at least 20% until readings have stabilized. Do not add ANY additional fish until your aquarium has fully recovered.
During an extended power cut in cold weather, a severe drop in water temperature can be a problem. A blanket or two placed over the aquarium will help insulate the aquarium from the cold. Monitor the temperature closely and regulate the temperature by doing water changes, if necessary. DO NOT make abrupt changes in water temperature while doing so! Make changes 2 degrees at a time at the most.
You could always invest in a UPS (uninterruptible power supply) device which you could plug the filters into. This is effectively a battery which will continue to run power to your devices after a power cut. They’re often designed for computers to make sure they don’t switch off during a power cut so you have time to save work.
Ii is advisable to work out your total power requirement before investing in an uninterruptible power supply to ensure it will cover all your filters and air pumps. You probably won’t want or need to plug the heaters in to this though due to their high wattage and if temperature is an issue then a longer term solution such as blankets as mentioned above would be required anyway. Overall, for peace of mind for when you are at work, a UPS could be a life saver (literally!).