We have $0.42/kWh summer peak down to $0.23/kWh winter off peak, so payback is on the order of 5.5 years. When I first ran the numbers a about fifteen years ago, the pay back was never, and ten years ago it was 25 years, four years ago the payback had dropped to 7.7 years and we installed solar. The electrical prices have risen substantially since we installed and the payback has dropped to 5.5, despite generating less power than we planned (fire code restrictions on the solar panel layout).
It really comes down to your local price of electricity, local installer costs, and whether or not you place any value on being able to generate power when the grid is having trouble, e.g. drought, post storm line damage, earthquake, etc.
As we transition away from gasoline / diesel powered vehicles, we will add solar to cover charging those. Local gas prices are high, too. $4.39 for regular last week, so electric vehicles become cost effective pretty quickly; currently less than half the running costs per mile of our gasoline vehicles.
All the best,
Peter