Noise in simple BC547-Raspberry Pi GPIO doorbell?
Your voltage-detection circuit has a very high impedance. I would go for a (much) lower impedance, for instance an 10k resistor, with an additional 10k resistor between the base and emitter of the transistor. This makes it much less likely that a stray voltage (moisture?) triggers your circuit.