Can I deduct the mortgage interest for my main residence if I have the 30% ruling?
If you have the 30% ruling you can deduct the mortgage interest for your principal residence under the standard regulations. So the 30% ruling itself will not affect the possibility to deduct the interest. It is also not relevant whether you have opted for partial non residency for tax purposes either.
The 30% ruling may however affect the actual refund. If your salary falls in a lower tax bracket due to the 30% ruling or due to the combination of the 30% ruling and the mortgage interest deduction, the mortgage interest will be deducted against a lower tax rate which leads to a lower refund for you.
It depends on your specific situation what the effect of the 30% ruling will be.