@neil @Edent you definitely can have this! But there needs to be a transfer switch which isolates the house from the grid when the grid power is out. And that switch has to talk to the battery and be appropriately certified by the grid operator.
Tesla provides a product called the "Backup Gateway" which does this for their batteries, but many other manufacturers don't.