>And the optimization problem at this point in time is that -ideally- you want to have some amount of excess generation on your solar panels, then time shift that with batteries to a point in time when power is more expensive, and have some amount of excess capacity in batteries so you can also sell that power; versus the (amortized) cost of that extra capacity; and/or what will actually fit on your roof.
Yep, that's the ideal case - given you're in the region where you have reliable sunshine in the winter. It's not the case where I live, when we had total of 7 hours of sun in December 2023.