@buurman
There is a video out there showing that microswitches are actually very, very good when it comes to repeatability.
They are simple, safe and if you don't use the plain kind (not circuit board) they only need 2 wires. If you go the route be sure to the the COM and NC connections.
The kind with the circuit board have a couple of advantages (usually). They provide an LED to verify state. The signal is actively pulled-down or pulled-up so the signal wire to the Duet is never dealing with an open circuit which can act like an antenna pickup up noise.
There may be kinds a circuit board that don't behave that way but all the ones I have used do.
Frederick