Unless you have an automatic backup generator or a whole-house battery for your solar installation, you are dependent on the power company for power to run your various smart-home devices that plug into the wall (in the US that is 120 VAC). While many sensors (such as door open) run off of internal batteries, many other devices require AC power. For example, if you have automated your home to allow for control when you are not present, then you will need to make sure your internet is available when the house power is down, so generally you need to backup your router and cable modem. If you have a remote control water shut-off valve, it needs backup power, since valves and such actuators take more power than can be supplied by internal batteries.
Backup power comes in two main types: if your device accepts DC power, then you may be able to use an external battery pack for backup; if your device plugins into the wall (i.e., requires AC power) then you must use a UPS (uninterruptible power supply) that generates AC power from a battery.
External Battery Pack
For devices that accept DC power, an economical and efficient solution is an external battery pack wired in parallel with the power pack supplying the device. During normal times, the battery pack is continually charged; when the house power fails, the battery supplies power to the device.
Uninterruptible Power Supply
For devices that require AC power, you are forced to use a so-called uninterruptible power supply (UPS). This provides AC wall-power to plugged in devices. This is a more expensive route than an external battery pack and less efficient since power from the battery is converted to 120 VAC which is converted back to DC for the device. Efficiency is always a consideration since for most people wall-power is reliable.