Batteries are unrealistic, but supply responsive controls, thermal storage, etc can help a home to use as much of the electricity when they generate it, rather than selling it back. Batteries cost about $0.10/kWh over their useful life in capital terms. When you add in the inefficiencies and the cost of the solar panels, you are around $0.25/kWh total for an off-grid system (cost of capital = 0).
The problem the utilities are having is that for residential customers they don't break out demand charges and energy charges. In practical terms, your demand charge should be based on magnitude and not direction of power flow. The energy portion then becomes more time sensitive as well, with the peak pricing around 4-6PM rather than 12-2PM, and subject to change on overcast days.
Distributed generation is hard to make work well when the generation is not consumed locally.