A smart doorbell is a convenient and innovative way to enhance your convenience and home security and find who is at your door, even when you are not at home.
Using two ESP8266 boards, we will build a fully functional Wi-Fi smart doorbell that integrates with Home Assistant smart home automation software and sends push notifications to your smartphone whenever someone rings the doorbell. This works both locally and remotely.

Things You Will Need
You will need the following components to build the DIY Wi-Fi smart doorbell.
Step 1: Compile the Firmware
We will compile two different firmwares:
To compile the smart bell speaker and smart bell switch firmware, follow these steps:
Take a small-capacity microSD card (as low as 512MB will work). Connect it to your PC. Download your favorite bell sounds from the internet, or you can record your own or your voice, and save them as MP3 files on the microSD card. Make sure to name these files as1.mp3,2.mp3, etc.

Step 3: Flash the Firmware to the ESP8266 Microcontroller
To flash the firmware, connect the NodeMCU or D1 Mini to the PC using a micro USB cable and then follow these steps:
Follow the same steps to flash the firmware on the two ESP8266 boards.

Step 4: Wiring ESP8266 Board with DFPlayer and Speaker
Refer to the following diagram to wire the DFPlayer with the ESP8266 on which you flashed thesmart-bell-speakerfirmware.
You can use jumper wires to make these connections and use a soldering iron to connect the speaker to the DFPlayer (MP3 player module).

Once everything is connected, use two jumper wires (male to female) and connect them to thesmart-bell-switchESP8266 board. You need to connect one wire to theD2pin on the NodeMCU or D1 Mini ESP8266 board and another to the3Vor3.3Vpin. Then connect the other two ends to your traditional push-button bell switch, as shown in the diagram below.
Make sure to double-check the wiring before proceeding.
Step 5: Add Devices to Home Assistant
We need to add both devices to Home Assistant. To do so, follow these steps:
Step 6: Create Automation for Custom Bell Sound and Push Notifications
To enable push notifications for your smart DIY Wi-Fi smart doorbell, you need to create an automation in the Home Assistant. To create, one, follow these steps:
If you now push the doorbell button, the bell sound will play from thesmart-bell-speaker. You can check the logs for more details if automation is working.

Make a Smart Door Bell Smarter
Building your own DIY Wi-Fi smart doorbell using ESP8266 microcontroller boards and Home Assistant is a rewarding and cost-effective project.
Once the basic functionality of the DIY Wi-Fi smart doorbell is working correctly, you can add a CCTV IP camera, and integrate with Home Assistant using Frigate NVR to create advanced home automation and improve home security. You may also integrate a PIR sensor or a touch capacitive sensor instead of a traditional doorbell switch. The possibilities with Home Assistant are endless.