I use Tasker to set my night time settings (volume, brightness, etc) when my phone is plugged in to the charger and connected to my home Wi-Fi. You could easily set your alarm based on the same conditions. The only problem with that is when the power goes out (no charger, no Wi-Fi).
But I am sure there are plenty of settings in Tasker to make this work.
-- Frank