I did the math after Hurricane Isabel left me without power for 8 days a few years back. I could spend tens of thousands of dollars on solar panels and batteries enough to barely power a refrigerator and a couple lights... or drop $250 on a portable gen that power pretty much my entire house, sans heat and hot water.

The batteries needed to power a house overnight is just massive. If you assume even a modest 800W average load, that's a bank of about 72 deep-cycle batteries, at a cost of about $30k, not even counting installation. And those would need replaced every 3-5 years.

It's not even really going to be effective as a UPS because mechanical ATSs are not fast enough to beat the voltage dip when line power is lost. A whole-house UPS is cost prohibitive, but a couple $40 UPS on specific equipment would be fine to power through the transition.

You just can't beat a generator for backup power.