Can I use a KASTA switch with a sensor

Yes, but you need a KASTA-5RSIBH input module in between.