In this area, and I suspect in many more, when excess power is produced by someone with alternative power, that excess can so “sold” back to the supplier of commercial power. Technically, I cannot get paid for that excess that you put into the grid. What happens is I get credit, which can be used at times when I am unable to produce enough power. In the case of solar power, this is at night, when the sun is at an oblique angle, or when clouds are too thick.
This can benefit the environment because it reduces the amount of power that must be produced otherwise if that means burning more fossil fuel. It also has the effect of reducing the peak production by the power plant, and it thus spreads the load over time more evenly. So, you effectively replace dirty power with clean power, making your net impact on the environment less even though you use commercial power some of the time.
But commercial power can be interrupted by storms, or other occurrences. So, your concern is how do you handle such outages? Generators are not as environmentally friendly as alternative power, but generators do offer an option. And, for prolonged outages they may be the best option.
Batteries are another alternative. Special batteries are available that convert direct current to alternating current and deliver the proper level and frequency to make appliances operate properly.
Conserve power during battery usage. Unless your system has a large bank of batteries you can drain a battery in hours. I have one battery that should make it through one night supplying one refrigerator. When the sun comes up my system could not handle a smooth running of the power needs of one home, and without commercial backup cloud passage does change the available power. To prevent overloading the circuit there is a switch that disconnects everything except one outlet. Into that outlet would be the battery, which is rechargeable. From that battery is an outlet that would power the refrigerator, so it could run in the day without draining the battery and at night on the converted alternating current. Having multiple batteries might make operating some other devices possible. A battery system is cleaner than a generator, but batteries will not run such things as a central heating unit or air conditioning. It works well in short term outages.