Magnetic Door Alarm Sensor Switch. Suitable for Raspberry Pi,Pico W, Microbit and Arduino alarm projects. Raspberry Pi is a trademark of the Raspberry Pi Foundation. Using a breadboard (not included) you can connect to Raspberry Pi (see 2nd photo).
eBay