Help reliably reading switch on long wire

Thanks for getting back to me.

you either need to add proper filtering or switch to polling to ensure proper software debouncing is in place

I agree with adding proper filtering. The issue is I'm not sure how!

Debouncing in the strict sense isn't required, I am happy for the switch to trigger the interrupt multiple times when it is closed, I just don't want it triggering it at all when it isn't closed!

I agree that polling could potentially cure this but it may affect the operation of the machine as it will have to poll the switch multiple times before it is "sure" it is closed THEN stop the motors moving it towards the switch.

If you have the possibility, put an oscilloscope in there to see what you are battling against.

I wish I had an oscilloscope but do not :(.