Background
I have an Fridland AC doorbell that I am about to make "smart". My approach is to connect a device named a shelly uni
inside the doorbell that draws power from the doorbells own transformer. The shelly device has inputs to read the button press and I can then decide if I want to sound the doorbell (activating an output) besides being able to get notifications on my phone when someone is at the door. The doorbell transformer outputs 12V AC.
The problem
I have connected the Shelly to the transformer and power is good. The issue here is the input from the doorbell as the cables pick up noise. I am getting everything between 0V and 17.5V on the input making it impossible to tell when the button has been pressed. If this was a DC circuit it could easily be solved with a PullDown resistor and I'm wondering if this can be done here too? The frequency of the transformer should be the same as on the mains which I think is 50Hz.
simulate this circuit – Schematic created using CircuitLab