For those you need an automatic transfer switch (ATS), such as the Enphase Enpower. Such devices contain circuitry to automatically manage disconnecting your home from the grid, so you 1) maintain power in the home (at least on the critical circuits you decide on), and 2) don't island your home (so linemen don't die).