Connecting a conventional doorbell to openhab

@mlommers - thanks for the info!

I’m seriously considering making one of these using the USB GPIO you suggested. A few differences / questions:

  • My doorbell system is 20V on the secondary of the T1 transformer. I have an old house, not sure if that was an older standard. Anyway, looks like I’d need to adjust the R1 current limiting resistor from 680ohms to 1.7kohms to give the same current.

  • I have a front and side door bell system that uses 2 separate circuits to ring different chimes. My plan is to basically make two detect circuits with outputs to two different GPIOs {and no mute circuit). I’d want the software to be able to see each and trigger different MQTT events. Do you foresee any issues with just running two different instances of this same program - one for each GPIO I connect to?

  • I’ve never really used a GPIO like this before. If I use the USB GPIO you suggested, I’m not sure where I’d get the 3.3V pullup for the output. Would you suggest commanding one of the GPIOs to output 5V and use that as the pullup (Adjusting R2 as needed)? I do also see a header on board that has a Vdd pin, but I can’t figure out for sure if that is the input for an off board power supply (when the USB isn’t enough) or if that is an output.

Thanks again for your help!

  • 2 instances
    2 instances would nog work out of the box as the GPIO pin is hardcoded in the script
    so you could add a 2nd GPIO configuration & .watch function in the script or create 2 seperate scripts and change in one of the scripts the GPIO configuration
    If you also want to determine the difference inside openHab between front door en side door, you should also change the mqtt channels and for example make myHome/front_doorbell/ring and myHome/side_doorbell/ring
    if you do that also not forget to change the .item file by updating the existing mqtt channel and add a 2nd switch which listens to the right mqtt channel. For perstistency also add the 2nd item also to the persistence file if you want to pertain the history.

  • Pull-up resistor:
    if I read the doucmentation: https://docs.numato.com/doc/8-channel-usb-gpio-module-with-analog-inputs/
    1 Introduction
    Pull-up resistors on individual IOs
    This would mean a pull upp resistor is not necessary
    5.2.Using GPIOs with switches
    The pull up resistor is connected between the GPIO and VDD
    and an example is given
    So my conclusion if without is not working you can always add one as suggested and connect to Vdd

It is possible to use (abuse?) OH serial binding to look for short/open between serial pins 2 & 7 (RTS) to give effectively one single input pin.
http://docs.openhab.org/addons/bindings/serial1/readme.html

1 Like

Hi Rossko57 -

Wondering you you use the serial binding this way? I’ve tied this a bunch of times and spent a few days trying to debug and I can’t seem to get it to work. I have a little DB9 with a wire connected to pins 2 & 7 that I short together, but no change in state of my switch item.

Nope, no personal experience. I guess the port needs configuring for hardware flow control, operating system dependant.

I’m doing something similar with my doorbell. I don’t have easy access to wires coming from the button, so I set up a relay to switch the power being outfitted from the transformer.

I’m using an Arduino Mega with an Ethernet shield and MQTT rather than the GPIO pins. I have time based rules that shut off the doorbell for my son’s nap time and for bedtime. I also have the switch exposed to HomeKit so I can shut it off manually when I work nights (notice how two night shift workers thought of this :grinning:).

At some point I’ll venture into my attic to pursue a more robust solution like yours but for now this helps us stay asleep when the delivery guy comes.

As the pictures show, I’m doing a lot more with the arduino than control the doorbell so my code might not be too helpful… but if there’s interest I will post snippets.

1 Like

This is what I did (as described in a different thread), making use of as many "of the shelf components as possible…
http://www.redgrendel.com/the-doorbell/

What needs to happen if the bell button is pressed can be set, either the doorbell rings, or the lights flash (or both)
Notification is send to my smart phone…

3 Likes

Can you expand a little regarding how you have this setup and what specific components you used (e.g., for the switch)? I am trying to do something similar with an Arduino Uno, but I don’t have a doorbell chime at all (the buttons will be wired directly to the 16VAC doorbell transformer).

I have received suggestions (at the link below and via private messages) to use either a switch or optocoupler and I am just trying to figure out my easiest option from a hardware perspective. I am more of a software guy, so once I can accurately detect the doorbell button press in the Arduino, I am confident I can program the rest of the behavior that I need.

http://forum.arduino.cc/index.php?topic=521126.new

Thanks!

I built my doorbell alert on top of an ESP8266 (Wemos D1 mini, to be exact). I have a 18650 Li-Ion battery as power source and a magnetic switch for inputting the doorbell signal to ESP. This has been in use for few months now and so far I have not noticed any missing signals.

These magnetic switches are typically used for detecting door/window open-close state, but since they are quite sensitive to the magnetic field, they are also good for detecting the doorbell coil. Another nice thing with them is that you don’t need to touch any of the doorbell wiring, just place the switch close enough to the coil and it should work fine.

Oh and one thing worth mentioning is that you can use the INPUT_PULLUP on Arduino or ESP so that you don’t need to add a separate pull-up resistor - just hook the magnetic switch between the input pin and GND and you’re good to go.

1 Like

I used an approach based on the piface addon.
My doorbell button is completely decoupled from the bell itself, only connected to an input of the piface module. One of the relays acts as trigger in the physical bell circuit.

This has the drawback that the doorbell completely relays on a working openhab system. The benefit is that the time the bell button is pressed has no influence on the duration the bell rings.

@scruzloose33 Sorry, I haven’t had a lot of time for openHAB stuff lately and missed your message.

Basically, I just used a relay to interrupt the power to the doorbell. The doorbell itself is original to the house and consists of the 18v transformer, the bell unit, and a pushbutton. I added the relay between the transformer + terminal and the bell unit.

I used a simple relay board from eBay* hooked up to an Arduino with an Ethernet shield, which in turn connects via MQTT. It’s mapped to a Switch item that’s toggled off while my kids are sleeping. So, basically, my setup currently has no way to detect a button press, it’s more like a “do not disturb” feature.

I am willing to share my code, but frankly the Arduino does lots of other stuff and I’m not sure it’d be more helpful than some of the other examples floating around this forum.

It sounds like you have bigger and better ambitions, so I’m not sure I have much more to offer. I have plans to do something similar down the road, but it’s currently low on my priority list.

*Note: I bought the board a few years ago and can’t find the seller I got it from, so I’m just offering the link as an example.

I saw this WiFi Doorbell. Looks like you could do the same thing here without much effort building it yourself. Connects to a wired doorbell and sends MQTT message. https://www.fireflyelectronix.com/product/wifidoorbell

Seems a tad on the expensive side?
Does anyone know if this project can be done with a pi 3?

Yep, no problem for pi 3

Great. Could you point me a tutorial that details doing this with a Pi 3?

Scroll to the top?

1 Like

I must be missing it. Where is there an entry about a setup with Pi?

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.