Sell it back at night when there's already a surplus of electricity? This is exactly why they want EV's charging at night, because there's less demand.
Nuclear and traditional dammed hydro prefer to be setup to provide extremely consistent power too so there's a gap in the power generation if we completely eliminate fossil fuels. Even if we don't completely eliminate them, peaker plants are extremely expensive to operate because their base costs and ideally low usage means their cost per megawatt is pretty high.
I thought the issue was that solar panels are generating electricity during the day only. So as someone with solar, you want to sell during the day and buy at night. No?
My point is, rather than using batteries to store huge amounts of energy and lose much of it in the process, find efficiencies and use credits instead.