I’m not sure, in some locales you are not permitted to have solar unless it is co=generation and goes onto the grid. In other you can have a stand-alone or a separate system that uses additional wiring that doesn’t connect to the wires connected to the Electric power Company.
We are doing off grid at our cabin because its basically going to be for when there isn’t any electricity. I expect that to happen sooner rather than later. At that point there isn’t going to be anybody talking about the electric rules anymore. :-)