> You can install a solar+battery system because it makes economic sense and pays for itself
Would take longer than 20yr at current power rates in many US locales.
If you have free night charging plan you can recoup quite faster. My system paid off for itself in 3 years - although I designed and set it up myself, so it was about 3x cheaper than through contractors (and yes I'm in US and I pulled permits to do this).
It's nice to do this for more than just the direct economic costs. The generator doesn't have to run 24/7 since the batteries absorb the excess power produced by the generator. This means less fuel wasted as well as less noise produced. I used to have two small generators that I could run (and team, if needed) but adding a battery component meant being able to sleep at night without a combustion engine burning fuel all night long.
And in some, like ours, it takes 5.
Highly dependent on where you are, what your electricity costs, and what your backfeeding compensation scheme is (eg net metering). In California solar alone is no longer economically viable with NEM 3.0 but solar+batteries to maximize self consumption is still in that sticky ~7 year layback range - and those calculations tend to assume today’s power prices, that are in reality going up quite quickly.