Introduction: DoorMaster

Hello everyone!

In this project I'll show you how to integrate a door buzzer and a door bell into your smart home!

Since I use FHEM as my smart home system, I can only show you the FHEM way, but I'm sure you can translate that to any other system easily! :-)

I have to admit, that I'm no professional! Most of my projects (like this one) are just for fun... I get the Idea of something and then I realise it!

This project is a mix of laziness and cleverness I would say... so I hope you have fun! :-)

Used hardware (needed):

- Accessible door bell

- Wemos D1 mini (ESP8266) -> Amazon link (search)

- Finder 40.61 relais (12V ~) -> (found it in our local store at reichelt but it should be this one even though the image does not match the description, since it is showing as 230V)

- Cables / jumper wire -> Amazon link (search)

- Shelly 1 -> Shelly link (product)

Used hardware(optional):

- Wemos D1 mini battery shield -> Amazon link (search)

- Solar panel 6V 6W -> Amazon link (product)

- Battery holder -> Amazon link (product)

- Rechargeable battery -> Amazon link (product)

- Amazon Echo -> Amazon link (product)

Step 1: The Door Bell

Hardware used in this step (needed):

- Accessible door bell

- Wemos D1 Mini

- Cables / jumper wire

- Finder 40.61 (12V ~ / 16A) (This is for my door bell... please ensure you use the right relais for your door bell!)

- Breadboard

Hardware used in this step (optional):

- Wemos D1 mini battery shield

- Solar panel 6V 6W

- Battery holder

- Rechargeable battery

How to connect the door bell to wemos d1 mini (fritzing file for download available)

**NOTE** The relais used in the fritzing picture is just for example

For the Wemos side, we choose the lower part of the breadboard!

Wemos connects to:

1) 5V Output to lower plus section

2) Ground to lower minus section

Relais connects to:

1) Relais coil pin 1 to upper plus section

2) Relais coil pin 2 to upper minus section

3) Relais switch common to lower plus section

4) Relais switch terminal B (the inactive one) to the D2 Pin of the Wemos, put a resistor of 120 Ohms 1% between terminal B and the connection to the D2 Pin as shown in the picture to debounce. One leg of the resistor goes in between and the other leg goes into the lower minus section

Door bell connects to:

1) Plus from the door bell to the upper plus section

2) Minus from the door bell to the upper minus section

Thats it for the connection!

Arduino Part (arduino project for download available)

Create a MQTT project for your Wemos and set it up so it can connect to your Wifi and is connected to your fhem instance!

Declare the following variable before the setup section:

const int relaisPin = 4;

int relaisState = 0;

int oldRelaisState = 0;


Add the following to the setup section:

pinMode(relaisPin, INPUT_PULLUP);


Add the following to the loop section:

relaisState = digitalRead(relaisPin); //Read the current state of the relais input and save it

if (relaisState != oldRelaisState) { // We only want the notification once per trigger.. so lets compare it!

if (relaisState == HIGH) { //Do we have a high here?

oldRelaisState = relaisState; //Yes we have! Let's save it for our little comparison two lines above

Serial.println("Ring!!!"); //Ring ring :-)

client.publish("/Status", "RING"); //Let's publish our "Ring" as MQTT Status

client.publish("/STATE", "Online"); //For me it worked better by publish my state to online...

}

}


FHEM Part

In the following line, I show you how you can Read the Status of the FHEM Device. In my case I use my pushover account to send me a push notification to my mobile phone, with a nice little text (no.. that's not the real text I use ;-))

define on_NormalRing notify MQTT2_KlingelSensor:Status:.RING {system ("curl -s -F 'token=XXX' -F 'user=XXX' -F 'message=RING RING RING RING RING RING RING BANANAPHONE!' https://api.pushover.net/1/messages.json")}

You need to rename the marked "MQTT2_KlingelSensor" to the name of your FHEM Device!

That's it! We have (hopefully) connected our door bell to our smart home system... nice!

Let's move on to the next chapter, connecting the shelly with our door buzzer :-)

Step 2: The Door Buzzer

This part is really quick and simple.

- Connect the shelly to a power source (I used power from the light switches above my buzzer)

Since the shelly does not care what it switches, we simply ADD the shelly to our switch, that fires the buzzer and opens the door downstairs.

Now add the Shelly to your smart home and control it however you want. In my case, Alexa is opening the door for me by adding a custom command :-)

Possible ways:

- Shelly app

- Amazon Echo

- Google Assistant

- Siri

... you got the point I guess ;-)

Step 3: Just a Little Idea...

For people like me, who are not only a bit lazy but also tend to forget their keys I can tell you the following:

With this setup it is possible to code a "door-bell-codekey-system" in a "morse-code-way"!

I did this in the arduino project and if the "morse code" (I called it emergencycode in my project) got entered correct, I published the MQTT Status to "EmergencyRing".

The FHEM line looks like this:

define on_EmergencyRing2 notify MQTT2_KlingelSensor:Status:.EmergencyRING set Tuerklingel on-for-timer 3

The buzzer will open the door for 3 Seconds!

You forgot your key? Just use your own door bell and let your smart home system open the door for you! ;-)

Step 4: Thank You for Reading!

Thank you for reading my first ever project!

Maybe you've learned something, maybe you got inspired... but I really hope you had a bit fun following along.

Alex