A $40,000 solar plant costs about $400/month and generates monthly power savings of as much as $200 (which is high). You are losing $200/month. At the end of the 20-year term, you have cumulative losses of close to $48,000. That will take another 20 years to recoup those costs. I'm sure SDGE rates will rise so maybe...MAYBE the cost recuperation can be shortened from 40 years to 25 years but this is a VERY high risk proposition.
If you are buying a home with a production lease (like Vivint), you will get price increases but they are in the contract and thus, predictable. You have to decide whether or not the expected SDGE price increases will be equal to the increases in the Vivint contract. Today, the scheduled price increases of a Vivint contract won't reach the current SDGE prices for 12 years. This means that, if SDGE hold prices at this level, you would start "losing" money with Vivint after year 12. The buyout clause with Vivint however, declines each year so you could get out of it for about $6000. You could also ride out the contract and, over the 20 years, you will still have saved money. I believe however, that SDGE power rates will continue to rise