Renewable energy/mains power integration controller and switching module