Rates will change! Energy doesn’t look like it will get cheaper, especially with EV fleet rollouts.
Accounting for planned 2 EV purchases at 10k miles/year, the largest system I can build on my roof has something like $150k savings against <$50k cost over 20 years.
That gives a lot of room for unexpected issues and feels like a wise bet to take.
But there's a bunch of other ways to think about it: you save about a K a year on average. Not a ton but not bad.
You are hedged against electricity pricing going up.
You are somewhat protecting against electricity outages in your area.
I think panels keep your roof cooler.
Plus tax benefits.
On the other hand it might however also not include maintenance costs.
It also is a useful form of diversification. If you only had $15k, it might not be the best overall investment, but if you have more money than that lying around it probably isn't a bad place to invest some of your money assuming you plan on using lots of electricity over the next 20 years. At some point having all your money in the stock market isn't the best money allocation either.