Integrate "old fashioned" doorbell into HA with Xiaomi

What if you turn the sensor to the side. So the side with the arrow is pointing towards the coils?

Had to remove it from its case to get it to fit properly. Found a place that seems to work.

A little more hacky than what I had to do, but I am glad you got it to work :slight_smile:

It’s glitchy though cuz the state changes very quickly from on to off (milliseconds) so i find the automation doesn’t catch it all the time…

OK with the timer_doorbell_off it’s much more stable. Thanks again!

What does this do?

I’m trying to send a snapshot of my blueiris camera to my email or even better as a notification to my mobile device.

aaahh… Dang such an good idea. Sadly I cant cut into mine because I live in a rented flat (btw - this beast is ringing on 230V ) - maybe Ideas?


The “bolt” fires first to the right and then jumps to the left side.

Hi, today received the door-sensor.
I have it working. but not as good as expected.

What happened;
I use zigbee2mqtt. Doorbell rings, xiaomi sensor -> state true to mqtt -> payload ‘contact’: true.
But sometimes after a while i receive another payload with ‘contact’: false. (payload ‘{“contact”:false,“linkquality”:118,“battery”:80,“voltage”:2965}’)

The automation has a optional field payload. But don’t know what to fill in there to have it only reacting on the true-state?
Have tried ‘true’, “contact”: “true” etc. But that doesn’t work.

You can specify what triggers it. Any change, only change to on, only change from off to on etc.

Look at my code earlier in this thread. I only trigger when it goes to off.

Ok. But what can i fill in the field payload to only trigger on the true-state of the mqtt payload?

EDIT:
Okay, solved that. Filled in the template-value inside condition.
But saw that true from the contact-field was written without quotation marks. It was not possible to delete them inside the gui. Edited that in the automations.yaml.

Never worked with the web version of automation, sorry :).

I’m sure you can find the answer in the cookbook.

I can’t get mine to work reliably. Sometimes I get it to report “closed”, but then it doesn’t reset to “open” again.

Has anyone tried a similar hack, but with the vibration sensor? Or is that not sensitive enough?

1 Like


Hello boneless,

Thanks for you great idea! I have bought the Xiaomi wireless door sensor and tried to place it somewhere near the electro-magnets but no luck so far. Do you think it is possible to place it somewhere without removing the top from the sensor or the top of the case of the electro-magnets? Or is the signal to weak to make it work? Otherwise I have to try to crack it and look what’s inside :frowning:

Hi Maurice,

I think it is a bit of a hit n miss honestly. Opening the sensor is quick, so that would be my first try, but not sure if it would help.

Sorry I can’t be of more help!

I have opened the sensor, removed the relay and connected the two switch-wires to the two points the relay was soldered to. I also placed a 100nF capacitor between the two contacts, that helps to avoid “fake rings” when it rains (due to elektrostatic discharges).

This works very well for me :slight_smile:

I did the same had to remove it from the casing. Love when all my Alexas say “someone rang the door bell” :slight_smile:


Hello Bouwe,

You didn’t break or removed anything from the sensor but just connected two switch-wires on both sides of the ‘bar’ as show in my picture? And theses wires are directly connected to the relay? Do you have any photo’s you could share? I also search on the Internet for the 100nF Capacitor, I found them with 50V, do you mean those? I did study electronics, so I can soldered, but the theory of connecting capacitor is gone.

Please let me know. I really would like it to make it work

Maurice Bekkema

I did remove the relay that you show in your picture. In its place I soldered the 100nF 50VDC capacitor, a through-hole type, not as SMD-type. And then I soldered the two wires of the doorbell-switch onto the two capacitor wires, one to each side of the capacitor. That’s all.

Hello Bouwe,

Thanks for your replay. I really going to try it but I will first remove the hood of the electro-magnets en try to place the uncovered sensor somewhere on top of it to see if it works. With no succes I will have to order a 100nF capacitor online :frowning: (because all non-essentials shops are closed at the moment). I found it online for € 0,18 per piece, but with shipping-cost It’s much more expensive.

Happy to help. Good luck with your experiments :slight_smile: