Make classic door bell smart?

Hello everyone,

I have a classic door bell with a 12V transformator - no wifi, no ethernet, just 12V. I’m wondering, how I can capture ring events in OH3? Anything that you folks can recommend?

Many thanks and merry christmas,
Matthias

You can find some dry contact sensor on zwave like this

In case you would like to do it in the DIY way: DIY Smart Doorbell for just $2, no soldering required » Frenck.dev

In case it uses a magnet, you can also simply use a door contact sensor (one part of it).
When the door bell rings and the magnetic field is established, the “door” sensor will be activated.
Video (in German though).

Here is another DIY project idea (if you happen to speak German): Eine smarte Türklingel mit ESP8266 und Fritz!Box bauen | reichelt.de

I made my doorbell ‚smart‘ (not really) this way. I don’t use the code sketch provided in the project but send an MQTT message instead.

Hi Wolfgang,

I saw the project you referred to before and it seemed very interesting. However I was unsure whether it is ok to have an esp-01 constantly drawing power from my 8v transformator. I‘m not very knowledgeable when it comes to electronics and thus didn’t feel like simply trying this without really understanding the implications would be a good idea. Can you maybe explain me if this could/should be done?

I realised my ‚smart’ doorbell with a battery which should last a long time by using deep sleep. However the reaction time is quite slow since it takes the esp-01 a bit more then 2 seconds to wake up, connect to wifi and send a message. It takes another second or so for the notification to reach my phone (through the myopenhab cloud). So I’m still thinking about using a different setup in the future.

Best regards,
Thomas

Hello,

there is another very simple solution. If there is some sort of Button which lights up when someones ringing the bell, you can use a photoresistor on an esp to catch that information and sending that information (for example) via mqtt to openhab.

Regards

If you want to go the ESP route, have a look into ESPNow, it should reduce start up time and also uses way less battery. Drawback though ja you need a 2nd coordinator ESP.
I use this concept in my water flow (shower) sensor.

Since I use the deep sleep until I register a button press my batteries should last for years so I‘m not really concerned regarding battery life (it’s rechargeable anyway).

I’m more interested in speeding up the message transmission from the esp to my mobile. How would ESPNow reduce the startup time and what is the coordinator used for? Thanks for your suggestions!

ESPNow does not require WiFi connection on your sensor and the ESPNow connection is hence faster.
The coordinator then acts as WiFi and, if needed, MQTT gateway and is connected the whole time.

In case you want to use only one chip with WiFi make sure you declare all WiFi variables (IP, DNS etc.) and hardcore them in the WiFi connect line, this also reduces connection time slightly.

Edit: from my experience, my ESPNow connection lasted not even a second when I tested it with one payload only and timed it. This includes starting up after deepsleep etc.

1 Like

Thank you for your explanations, I was already thinking about something non-wifi, I didn’t know that this can be done with espnow. I will look into that, thank you!

1 Like

Have A look at:

The installation of nodejs is a bit olddated but for the rest it is stil working fine in my house

your information is very interesting and good question but i am not idea.

Hi,

I have the same config and bought a Shelly Uni.
But I die Not find the time to install it though the Specs Look like it can be solved with it

1 Like

Consider not extending but replacing your door bell with … a sensor (any of your tech choice).
Then choose from all of OH’s capabilities to notify residents.
I for instance simply attached a loud speaker to my OH server and play a sound there.
For conservatives, you can record your old door bell sound. For all others, take your pick what to play. I have a collection of bell related samples like the intro from AC/DC ‘Hells Bells’ that I keep cycling through.

Bonus of this approach: you can silence your doorbell via OH when you have a need to (do not disturb mode at night or when you turn your home cinema on).

The esp draw on your doorbell transformer is very negligible.
I use Tasmota for all my esp chips and have very fast response times. Flipping a phisical relay switch on the sonoff r2 mini is instant.
I do find it a bit laughable when they say “a $2 project”… The relay, eps, wires and box will cost you $30. Ftdi board would be another extra cost. May need some capacitors to smooth out your power.
But it would be tones of fun.

I was overly fixated on Getting a doorbell button working, when I installed a video doorbell camera I found less then 30% of visitors actually push the button. I don’t know if it is a covid 19 thing but most couriers and postman will not push the button. A PIR sensor that is ZigBee is very small and cheap and will catch the people that don’t push a button.

What do they do? Just scream at the door?!

Good old Fashioned knock on the door or the house. Interested to hear if it is just my house or if others find the same. So consider using a sensor that does not need a person to push the button as not everyone will.

I had a Xiaomi MCCGQ11LM contact sensor that my cat had played with and broken the glass tube. So it was pretty useless for its main function, so I used it as a door bell sensor. Connected it in parallel to the wires powerig the bell, when the voltage is applied, the bell would ring and the contact sensor would generate lots of state switches in a short period of time. What i noticed is that the state changes would appear sometime on its own, not sure why, but generally a rather low number, while the real bell ring would generate something like 10-12 every time. So in order to avoid false positives, the number of states switches that are required in a 5s interval I set to 8, then the event registers as a door bell activation, captures a picture from the entrance camera and sends it to my phone, turns on external light if it is night etc.

Here are the items

String          sens_contact16_status                   "DoorBell [MAP(sens_contact.map):%s]"                   <soundvolume>           (gPers_Change_Day)              {channel="mqtt:topic:mymosquitto:sens_contact16:status"}        //excluded from gZB_contact
Number          sens_contact16_batt                     "DoorBell Battery [%.1f %%]"                            <battery>               (gPers_Change_Day, gZB_bat)     {channel="mqtt:topic:mymosquitto:sens_contact16:batt"}
Number          sens_contact16_volt                     "DoorBell Volt [%d mV]"                                 <energy>                (gPers_Change_Day)              {channel="mqtt:topic:mymosquitto:sens_contact16:volt"}
Number          sens_contact16_link                     "DoorBell Link: [%s]"                                   <qualityofservice>      (gPers_Change_Day)              {channel="mqtt:topic:mymosquitto:sens_contact16:link"}
Number          sens_contact16_lastseen_epoch           "DoorBell [%s]"                                                                 (gZB_lastseen)                  {channel="mqtt:topic:mymosquitto:sens_contact16:lastseen_epoch"}
DateTime        sens_contact16_lastseen_datetime        "Last Seen: [%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS]"
Switch          sens_contact16_doorbell                 "DoorBell"                                                                      (gPers_Change_Day)
Number          sens_contact16_counts                   "Counts"                                                <switch>
Switch          sens_contact16_timer                                                                            <switch>                                                {expire="5s, command=OFF"} // Timer set not to accept more then 1 press per 5 sec
Switch          sens_contact16_timer_ring                                                                       <switch>                                                {expire="5s, command=OFF"} // Timer to indicate that the doorbell was actually activated.

And here is the rule

rule "contact_16_triggered"
  when
    Item sens_contact16_status received update
  then


  var increment = sens_contact16_counts.state as DecimalType + 1
  postUpdate(sens_contact16_counts, increment )
  logInfo("DoorBell",  sens_contact16_counts.name + " is " + sens_contact16_counts.state)
  postUpdate(sens_contact16_timer, ON)

  if ( sens_contact16_counts.state >= 8 && sens_contact16_timer_ring.state != ON ) {
      logInfo("DoorBell: ", "DoorBell activated. " + sens_contact16_counts.state)
      postUpdate(sens_contact16_timer_ring, ON)
      sendPushoverMessage(pushoverBuilder("DoorBell activated at " + now.toString ("yyyy-MM-dd HH:mm:ss")))

      var FrontDoorCam = "FrontDoor" + now.toString ("yyyy-MM-dd_HH-mm-ss") + ".jpg"

      executeCommandLine("curl -q http://192.168.222.31/snap.jpeg -o /var/log/doorbell/" + FrontDoorCam)
      Thread::sleep(1000)
      sendPushoverMessage(pushoverBuilder("DoorBell activated (w.photo) " + now.toString ("yyyy-MM-dd HH:mm:ss")).withAttachment("/var/log/doorbell/" + FrontDoorCam))


      //Turn ON ext.light at night time for 5 mins.
      if (Night_State.state == ON && Shelly1_01_Power.state != ON) {
         sendCommand(Shelly1_01_Power, ON)
         postUpdate(Shelly1_01_Timer, ON)
         logInfo("DoorBell: ", "Turning ext light on")
      }

  }
  //If somebody constantly pushes the Doorbell
  else if ( sens_contact16_counts.state >= 200 && sens_contact16_timer_ring.state != ON ) {
      logInfo("DoorBell: ", "Crazy person at the door. " + sens_contact16_counts.state)
      postUpdate(sens_contact16_timer_ring, ON)
      sendPushoverMessage(pushoverBuilder("DoorBell active. CrazyPerson at the door."))
  }

end


rule "contact_16_timer_off"
  when
    Item sens_contact16_timer received command "OFF"
  then

  logInfo("DoorBell", "Timer: " + sens_contact16_timer.name + " to " + sens_contact16_timer.state)
  postUpdate(sens_contact16_counts, 0)
end


rule "Shelly1_01_Power_Timer to OFF"
  when
    Item Shelly1_01_Timer received command "OFF"
  then

  logInfo("DoorBell", "Automatically turning external lights OFF")
  sendCommand(Shelly1_01_Power, OFF)
end