I suppose you could erect solar panels on the uninhabited outside of each "hollow earth" to capture solar energy.
Sure. It will work fine. But if you intend to go travelling in your hollow asteroid to other stars it won't do the job. For that something else is needed. I'll leave the tech design to others since I don't imagine I will be leaving the solar system.