The SolarEdge battery has a built in fire suppression system that triggers if thermal runaway is detected, which should be enough time to evacuate (in the UK it's also mandatory to have a smoke alarm fitted in your solar "plant room").
At the time Powerwall2 were the best value/capacity by a country mile, but I didn't trust Musk to not burn my house down.
So its outside, with a very large planting trough above it to provide some level of weather shield, and a strategic supply of sharp sand if the powerwall goes full Musk.
The fire risks that I worry about do not really include the genny. The fridge in the kitchen is potentially far worse. I have, of course, put in a fire detection and suppression system inside the computer room.
At home I actually have a more involved fire risk assessment than at work. My wife does dog boarding at home and one day I will stop her leaving a cloth to dry on the cooker ... sigh. Anyway, making sure that humans and dogs get warned and get out safely is quite involved.
As we all know there are three ingredients required for fire: a source of ignition, a combustible material and finally: oxygen. Remove one and fire does not happen. Unfortunately some reactions will generate copious amounts of heat and oxygen, ie all three requirements for combustion and become self sustaining. Lithium batteries for example can do this. It's a bit of a nightmare but techniques are being developed to deal with "self igniting metals" and the like.
I drive an EV.
Having the generator within 4 feet of a door or a window that can open is a bad idea.
You'll also want the exhaust port pointed away from the house.
Chimney in my case.
I mean: Sure, there's ways to improve that. There's even climate-controlled outdoor racks, and rack-mount batteries from vendors like EG4 to slot into them.
But a common goal of home battery arrays is to improve the energy efficiency of that home. Heating (or, I suppose in extreme cases, perhaps even cooling) a battery box runs counter to that goal.