I already installed physical sensor like the picture in the first post.
I can connect it to the GPIO.
The whole hardware part is already done. It is currently running on an arduino but I would like to move it on the magic mirror (and therefore have a module that reads if the contact is open or closed on a pin of the GPIO).