But the sun is slowly exhausting its stock of nuclear fuel, which means it will eventually no longer be able to input energy into the Earth which in turn means life will no longer be viable. So it is not perpetual motion and the 2nd law of thermodynamics still applies.
RE: Perpetual Motion Discovered