How to stop electricity from going into the grid in on-grid
There are basically two ways to do that: off-grid inverter that will supply electricity from the grid when solar / batteries cannot deliver the power that appliances need, pretty much the opposite