How to detect when a 3v supply is on with Raspberry Pi
You do not need to go through this much trouble. This is doable with dirt cheap components at a fraction of price. You can use this opto-isolated circuit:


Consider these changes in the above image:

1) 12 V is actually 24 V in your case.

2) Left GND attached to PC817 is the GND of 24 V signal. Right side GND is not connected to Left side GND. Right side GND is GND of raspberry pi. VCC is 3.3 V which comes from raspberry pi.

3) ARD_GPIO will be a gpio of pi in your case.

Working of circuit:

When door opens and you receive that 24 V signal, the optocoupler will turn ON and you will get a HIGH on your GPIO.

Once the door closes, 24 V will be cut off and you will get a LOW on your GPIO.

RC network of 390K and 0.1uF is used to smooth out the signal. You will have to modify these values to suit your requirements. A minimum of 10K resistor is advisable. You can remove the capacitor altogether. Once you remove it, it will give you a pulsating output when door is opening and will give you a solid HIGH when the door has opened. Solid LOW if door is closed.

This also keeps your pi isolated from 24 V line which is usually a good thing to do.