Get signal from apartment intercom to know when someone ring
It sounds like your "12V" is AC, not DC. You could fix this in software by simply ignoring any high input that doesn't last for more than, say, 1 second.