Another sensor you could use is an IR reflectance sensor. You can then put a white label on your sliding door which will reflect the light back when it's closed. It might be easier than mounting a magnet on it.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Another sensor you could use is an IR reflectance sensor. You can then put a white label on your sliding door which will reflect the light back when it's closed. It might be easier than mounting a magnet on it.