Magnetic or inductive contact switches