Yes, and payback period in many places is less than 10 years, while the equipment will typically last well past its 25 year warranty.
There’s also a 26% federal tax credit, and in some cases state, local, and utility incentives. Generators and fuel don’t receive those financial incentives.