Integrate "old fashioned" doorbell into HA with Xiaomi

I cut the metal and placed it at the top. When the doorbell rings it’s turns the state to off but it doesn’t set it back to on. I have to use the xiaomi magnet to reset it.