I finally got the Magnetic Switch / Door Open sensor working. My wiring isn't "exactly" like anything I saw on the Web.
There are 2 undifferentiated wires out of the device. In the try that worked I connected:
wire 1 to 10K resistor to GND
wire 2 to a GPIO pin (e.g., 25 for code below)
Here's a messy pic:
Now for my photo sensor.