The solar/battery stuff was just him saving an almost bankrupt company his cousins had. SpaceX and Tesla had both invested in the company, and he would have lost the money and like faced regulatory scrutiny had it went under.
Hyperloop was his effort to disrupt California's high-speed rail plans.