Added more logging and automatic relay switching when the controller goes to standby mode.