In the short run sure. But electricity isn't going to get cheaper. Think of it like prepaying your electricity bill for 15 years, and then after that, it's free.
(I don't mean to deter you, I dropped 20k on home solar, but it wasn't really for the economics).
https://www.pv-magazine.com/2021/07/02/exploring-the-depths-...