A switching device comprising: a housing, a moveable element made of a header, a first magnet and a second magnet and slidably mounted in the housing, the moveable element being adapted to move relative to the housing between a released position and an engaged position, a printed circuit board comprising a microcontroller and an upper face on which are mounted upfront a first magnetic sensing element and a second magnetic sensing element positioned to face the first magnet and the second magnet, wherein the first magnetic sensing element and the second magnetic sensing element are configured to detect respectively a first magnetic field and a second magnetic field generated respectively by the first magnet and the second magnet, wherein the pole configuration of the first magnet is opposed to the pole configuration of the second magnet and the first magnetic field generated by the first magnet is reversed in magnitude with respect to the second magnetic field generated by the second magnet, wherein the first magnetic sensing element and the second magnetic sensing element are able to produce respectively a first output signal and a second output signal from the first magnetic field and the second magnetic field, characterized in that the moveable element is closer to the first magnetic sensing element and the second magnetic sensing element in the engaged position than in the resting position, wherein the microcontroller is able to validate a reliable position of the moveable element: if the first output signal is included in a first range of values and if the second output signal is included in a second range of values, and if the sum of the first output signal and the second output signal is substantially equal to a predefined value derived from the difference between the magnitude of the first magnetic field and the magnitude of the second magnetic field. a housing, a moveable element made of a header, a first magnet and a second magnet and slidably mounted in the housing, the moveable element being adapted to move relative to the housing between a released position and an engaged position, a printed circuit board comprising a microcontroller and an upper face on which are mounted upfront a first magnetic sensing element and a second magnetic sensing element positioned to face the first magnet and the second magnet, wherein the first magnetic sensing element and the second magnetic sensing element are configured to detect respectively a first magnetic field and a second magnetic field generated respectively by the first magnet and the second magnet, wherein the pole configuration of the first magnet is opposed to the pole configuration of the second magnet and the first magnetic field generated by the first magnet is reversed in magnitude with respect to the second magnetic field generated by the second magnet, wherein the first magnetic sensing element and the second magnetic sensing element are able to produce respectively a first output signal and a second output signal from the first magnetic field and the second magnetic field, characterized in that the moveable element is closer to the first magnetic sensing element and the second magnetic sensing element in the engaged position than in the resting position, wherein the microcontroller is able to validate a reliable position of the moveable element: if the first output signal is included in a first range of values and if the second output signal is included in a second range of values, and if the sum of the first output signal and the second output signal is substantially equal to a predefined value derived from the difference between the magnitude of the first magnetic field and the magnitude of the second magnetic field. if the first output signal is included in a first range of values and if the second output signal is included in a second range of values, and if the sum of the first output signal and the second output signal is substantially equal to a predefined value derived from the difference between the magnitude of the first magnetic field and the magnitude of the second magnetic field.