Classic 230v doorbell and xiaomi door sensor

Hi everyone,

I’m a newbie, I just swapped my system from Domoticz to HA last days and I found a nice way to use Xiaomi Door Sensor (together with Aqara gateway) to notify me about someone ringing to my door (incl. sending a snapshot from my external camera)

Between my 230v doorbell and Xiaomi door sensor, I’ve installed a small relay. It allows me to run the reed switch on Xiaomi (the reed switch is still in position, for future use, I just sold the wires to it.

Then there is only a few lines of automation:

  • alias: Camera - Snapshot
    • entity_id: binary_sensor.door_window_sensor
      from: ‘on’
      platform: state
      to: ‘off’
      • data:
        filename: /config/tmp/snapshot1.jpg
        service: camera.snapshot
      • data:
        - /config/tmp/snapshot1.jpg
        message: below
        title: ‘Someone is ringing’
        service: notify.notification_gmail

I hope it helps someone :wink:


This looks like what I need to achieve!

I have a 230v AC doorbell, which is installed in the house and cannot be easily changed (wiring is embedded in the walls, the property is rented etc).

I’m therefore thinking I need to sense when the 230v feed goes live to activate the buzzer - it looks like this is what you’re doing using a 230v ac coil relay, is that correct?

Looks to be this;

My understanding is that when this relay is fed with 230v, it closes the relay contacts. You’re directly connecting these relay contacts in the place of the reed switch on the door sensor, causing it to be triggered. This looks like a very simple and easy to implement solution! :slight_smile:

Hi John. Correct.

Very simple solution, but works like a charm at my home and I’m satisfied. I really enjoy you like it :slight_smile:

1 Like

I do indeed, it’s a very simple and elegant solution.

I found an alternative relay which looks to be functionally identical but cheaper and have ordered a couple to experiment with. I figure I can use a perf board and 3d print a small case to fit it all into.

Thanks for the pointer!

I found another option which looks like it’ll be a simpler/cleaner installation (I’m lazy):

This device is unusual in that it can accept a 230v input as a switch, to control a relay. For our purpose the relay isn’t necessary, but we can at least use it to trigger a MQTT message when the 230v goes live.

I’ve not received the device yet, so have not tested this, but I will report back once I do :slight_smile:

I have a bunch of Shelly devices, they are working fine.

But I wanted to have a battery unit rather than the device connected to electricity and Wifi all the time.