You didn't mention your state. The regulatory environment differs significantly between states, and determines what the electric company can do, since they're generally state-regulated public utilities. If you can sell excess electricity back to your utility at retail rates, it makes little sense IMO to buy a battery. However, if the utility will only pay wholesale rates for your excess, a battery can be cost effective, depending on your daily production/use cycle.
Also look up "solar value deflation" and understand that, as more people install solar, the value of it will decrease as net metering regulations and connection vs. distribution costs get shifted. Read up on the difficulties people with solar leases have encountered when trying to sell their home. For that reason alone, I'd recommend buying, even if it means a second mortgage or HLOC to pay for it.
I'm personally holding out for more efficient panels, cheaper batteries, and home-scale bio-fuel production for excess energy so I can size my install to support being truly off-grid throughout all four seasons.
https://news.energysage.com/how-much-does-the-average-solar-...
In Cali there was also some issue that the rebates for each Tesla powerwall were somehow distributed per company. So if we bought the Powerwall directly from Tesla, we wouldn’t have got a rebate because they had run out, but other installers could still supply the rebate.
The Tesla software to monitor the solar generation, battery use and home energy usage is really nice, certainly much better than the “enphase” software that came with the solar panels and inverters.