Connecting a conventional doorbell to openhab

Read the opening topic and then move palm to forehead :slight_smile:

For example, check the right side picture.

I seeā€¦ RPI means Raspberry Pi :grin:

1 Like

Thanks for posting this creative solution. I just wired one up to my Konnected.io alarm panel that is just feet away from the doorbell.

Hi,
I just want to share you my just finished project to connect OH to my conventional 20 VAC doorbell (NICOR PrimeChime Plus) with a conventional bell button with integrated 20 VAC lamp.

Goals:

  1. I donā€™t want the change the current doorbell chime and button (it should work even if OH would be down and I donā€™t want to replace the nice bell button with such a plastic optic RF button).
  2. A slave bell at the patio should be activated when the main conventional door bell button is pushed.
  3. The doorbell chime should be able to be triggered remote via OH rules (e.g. in case of alarm, beside the sirens)

Implementation:
I need to detect, if the main door bell button is pushed. So Iā€™ve developed a circuit which detects, if the 20 VAC will drop to zero (the bell button will shorten the 20 VAC while itā€™s pushed, but in reality the voltage drops from 20 VAC to about 2-3 VAC instead of 0.0 V). After a rectifier with optocoupler a monostable circuit is used to generate a 5 VDC signal for around 4 seconds, independent of how long the button was pushed. A Fibaro FGBS-222 does the analog measurement of this signal to generate a Z-Wave event ā€œdoorbell button pushedā€.
In my situation, Iā€™ve implemented a rule to send an RF signal with a Broadlink RM2 Pro Plus_300 to activate the slave RF door bell (a SadoTech Wireless Doorbell Kit with remote RF push button - the remote of this Doorbell Kit was just used once to learn the RF code for the Broadlink). Also, Iā€™ve installed a RF remote relay (I have had some of these eMylo RF relays left) to be able to ring the main door bell remote via OH via Broadlink (used as an addon for my alarm rules). Unfortunately this additional relay is required for that, because the FGBS-222 output canā€™t be used to drive the required 230 mA for the lamp inside the original bell button (the FGBS-222 output load is limited to 150 mA).

All components are small enough to fit into the dual voltage chime in wall switch box.

All components:

Circuit enlarged:

Remote doorbell used at patio:

Update after one month using it:

Luckily, the detection circuit is working very reliable after adjusting some parameters. Until now, no ā€œbell button bushā€ detection event was missed.

In the OH Fibaro configuration the IN1 sensitivit has to be set to 5 and :

In the rules file, I added a check to only accept events if Voltag is >0.25 volts to ignore possible voltage glitches.

rule "Patio_Doorbell_When_Main_Doorbell_fired"
when
  Item DoorBellRemote_Hallway_Sensor changed
then
  var doorbellSensorVoltage = (DoorBellRemote_Hallway_Sensor.state as Number).doubleValue;

  /* detect event if voltage changes from very low (around 0 Volts) to high >0.25 Volts */
  if ( doorbellSensorVoltage > 0.25 ) {
...

Interesting project. I wish i would have seen this before.

I accomplished something very similar to this by buying a Honeywell DCP917S and plugin a RTL-SDR/DVB-T receiver into my openhab raspi.

Using GitHub - merbanan/rtl_433: Program to decode radio transmissions from devices on the ISM bands (and other frequencies) i can pass doorbell rings via MQTT to openhab.

Hi Maody,
if changing the currently installed doorbell will be an option, your solution is definitely the easier way to go. My solution looks a bit ā€œover-engineeredā€ and results in much more hardware work for just using the ā€œoldā€ doorbell. But it works for me and it was a interesting project to see if Iā€™m still able to develop and build a circuit (I learned this 35 years ago in a 3-year Vocational training but after that I directly ended up in the software industry and havenā€™t used this skill since than) :slightly_smiling_face:

I am proud to say as of this morning, I have effectively connected my old-fashioned doorbell to openhab, and this guide was absolutely instrumental!

Thank you so much for taking the time to detail this for the community. I had a different goal than you, and a number of challenges to over come, so I thought I would come here, and give some details for the next person.

For the record: I had no intention of muting my doorbell, so I omitted that part entirely. I followed this guide on a RPI4 running openhab 3 on openhabian.

I went a different route. I own a small motel attached to my house, so this was to ensure I could be notified on my phone when someone rings the doorbell, if Iā€™m in the back yard, or just out of hearing range of the door bell.

In its current iteration, I just used the openhab app on my phone, since I also use sitemaps, and broadcast a notification. Iā€™m looking at the idea of using tasker on my phone to do more complex actions when the notification is received, and potentially pop up a camera feed from outside the office door on my phone, but thatā€™s a project for another day. I suspect that will involve setting up a MQTT client on my phone, and going a different route how ever.

Anyway, this guide is awesome, and the vast majority of it worked, and was very easy to follow.

First I want to specify how I did this. I actually used a little electronic hobby kit, and spare doorbell transformer, and my RPI to first simulate this on my work bench before wiring it to my actual doorbell, which really made thing easier when building and understanding the circuits, but also created the new challenge of why doesnā€™t it work here, when it worked there?

however here are the challenges I faced:

So on my work bench is where I started, and this is what challenges I faced in a very controlled environment:

  1. In my case, using the exact wiring as laid out in the diagram, my RPI would not detect falling voltage, and I had to check for rising voltage. For what ever reason watching for falling voltage would never trigger. I am not knowledgeable enough to know why this is the case. (any ideas?) Here is my alternative code:
var Gpio = require('onoff').Gpio,
    door_bell_button = new Gpio(18, 'in', 'rising');
  1. I found your Logic for number of triggers, and time since last ring etc to be overly complex, and didnā€™t work great in my case.
    I really simplified it and, in my case anyway, this works great.
    here is my code:
      RingTimeNow = Date.now()
    if (global.JustStarted == true) {
        client.publish('myHome/doorbell/ring', 'ON')
        console.log('Someone rings the doorbell: %s', RingTimeNow);
    } else{
                if (RingTimeNow - global.LastRingTime >= 250) {
                        client.publish('myHome/doorbell/ring', 'ON')
                        console.log('Someone rings the doorbell: %s', RingTimeNow);
          }
     }

    global.LastRingTime = RingTimeNow
    global.JustStarted = false
    client.publish('myHome/doorbell/ring','OFF')

  1. Using your systemd .service file as designed did not work work on my system and failed every time it ran. Again, I canā€™t say why exactly, Iā€™m not good enough with Linux, but ultimately i have a guess. This line was the problem: ExecStart=/usr/bin/nodejs /home/pi/doorbell_ring.js
    after some serious banging of my head against my desk, I just tried throwing ā€œ/usr/bin/nodejs /home/pi/doorbell_ring.jsā€ right into my terminal, and then it all made sense. I guess I have 2 versions of node or something? because launching my file preceded by ā€œ/usr/bin/nodejsā€ causes it to fail loading onoff. I changed that line to ā€œExecStart=node /home/pi/doorbell_ring.jsā€ and it worked.

So once I overcame all this, I had a fully functional prototype sitting on my work bench.

I put the circuit in a project box, wired it all up to my actual doorbell, and test it all out, and nothing. No voltage detected on GPIO 18, I switched from rising back to falling, nothing. I frantically swapped out parts, thinking maybe something happened to the optocoupler or something? After alot of trial and error I found that even with the doorbell side completely disconnected, just disconnecting and reconnecting the ground caused it to trigger in the software. This was literally my first attempt at anything with electronics and circuits like this, so I have no clue why this worked, but I just removed the ground completely, and replaced GPIO 18 with the ground. so current runs out pin 1 3.3v through the 10k resistor through the optocoupler, and through the 2k2 (2k in my case) resistor to GPIO18. this works perfectly. Why did it work on my test bench? why didnā€™t it work after I moved it? This is still a major mystery to me.

anyway, hopefully this helps someone. let me know if you have questions.

Check out Telegram binding and also Pushover.

Telegram allows you to use buttons in the message to do actions at your home and can display MP4 video.
Pushover can display the moving GIF or JPG without the need to unlock the phone or open the app.

Can I get the pushover syntax for the OH rule to do this?

Best, Jay

The bindings docs have an example rule. You just send the picture as an attachment and pushovers default is to show it in a thumbnail which on IOS does not need the phone unlocked.
Donā€™t know how Android handles it. Handy when your busy and a notification comes in as you can see the car that pulled in and know itā€™s family without unlocking the phone.

Telegram can do mp4 which can do audio and buttons. Gif can not do audio hence why I moved over. I miss the ability to see without unlocking as it was handy.

Works the same but I was curios about the moving image statement you mentioned. I have the static image working, didnā€™t know you could send a video clip?

Best, Jay

There is actually a full example here in the ipcamera bindings documentation.

IP Camera - Bindings | openHAB

Pushover does not support MP4, but an animated GIF works great.