https://tristam.ie/2023/758/ Skip to content [ ] No results * Home * Categories + Raspberry Pi o Raspberry Pi Cases + 3D Design & Printing + Python + Ender 3v2 Mods + Linux + Home Assistant * My Kit * About me Tristam Plays with tech. # # * About me Search * Home * 3D Design & Printing * Ender 3v2 Mods * Raspberry Pi + Raspberry Pi Cases * Linux * Python * Home Assistant Tristam Plays with tech. # # Menu Privacy friendly ESP32 smart doorbell with Home Assistant local integration * tristamtristam * 3 August 2023 * 3D Design & Printing, Home Assistant * 13 Comments Privacy focused "smart" doorbells seem to be few and far between so I decided to build one that integrates with Home Assistant via ESPHome and is easy to build. This project is aimed at being simple while allowing a ton of customisation and flexibility. To get started, you'll need an instance of Home Assistant running with the ESPHome add-on as well as the Home Assistant companion app on your mobile phone to receive notifications when someone presses the doorbell button. I have used an 8 RGB LED ring light in my version but if you want to simplify things, you can skip this and use the ESP32-CAM's built in LED as a flash - it's surprisingly bright. Parts list: * ESP32-CAM (Amazon - US, UK, DE) Make sure to get one with a "flash/download/io0" button to make your life easier when you flash ESPHome onto it for the first time. If you make the same mistake as me and buy the one without that button, follow this guide to flash the ESP32-CAM using an FTDI adapter. * Momentary push button (Amazon - US, UK, DE) * 10k resistor * 8 RGB LED ring light (Amazon - US, DE) Note: these aren't the exact ones that I used but they are the closest ones that I could find. I used the Pi Supply PIS-1270 from RS Components. * 10m Micro USB cable (Amazon - US, UK, DE) * M2.5 brass inserts (Amazon - US, UK, DE) * M2.5 screws (Amazon - US, UK, DE) * eSUN white PETG filament (Amazon - US, UK, DE) You can find the .stl's on Printables here and the home assistant config in my github repo: thatguy-za/esp32-cam-doorbell. Build guide Step 1 - Printing the enclosure This step takes the longest so lets send the .stl's to the printer while we crack on with the rest of the build. There are three pieces that you'll need to print: 1. The main body 2. The ESP32-CAM retention plate 3. The back plate/wall mount You'll need to print the front and the back of the enclosure with supports. I printed it using PLA but you'll want to use PETG or ABS filament so it is waterproof and use 20-30% infill. Once everything has printed, you'll need to add two M2.5 threaded inserts: 1. Into the front cover so you can screw the ESP32-CAM retention bracket into it. 1. Into the bottom of the backplate so you can screw on the face plate with a 10mm M2.5 screw [esp32_doorbell_inside_w_cover-1024x576] [esp32_doorbell_mounting_plate-1024x576] Step 2 - Configuring the ESP32-CAM in ESPHome Hold down the "flash/download/io0" button and connect your ESP32-CAM to your computer using a micro USB cable. This will boot it into flashing mode. Launch Google Chrome, go to your instance of Home Assistant and launch the ESPHome Add-on by clicking Settings -> Add-ons -> ESPHome -> Open Web UI. Chrome is important because it seems to be the most reliable browser for flashing firmware onto the ESP32-CAM. Click + New Device to add a new device.Give it a name ("Doorbell" is probably a good starting point). When asked to select the device type, select ESP32 and check the box "use recommended settings'. Once the configuration has been created, you can skip installing it onto the device - we'll do that later. From your list of ESPHome devices, click Edit on the device that you have just created. At the bottom of the yaml file (below captive_portal:), paste the configuration code from my github repository that is linked above. Click Save and Install. Select Plug into this computer. Click Open ESPHome Web, this will allow you to flash the firmware onto the device from the web browser. This is where it is important that you are using Google Chrome. Once the firmware has compiled, you should be able to click Download Project - this could take a few minutes. Head over to ESPHome Web and follow the prompts to flash the firmware onto your ESP32-CAM. Home Assistant should discover the new device once the new firmware has been flashed onto it - yay! Now you can add whatever entities you want to your dashboard. [Screenshot-2023-08-01-153724]Screenshot: New device found in Home Assistant. Step 3 - Time for some automation & notifications We want to create an Automation to take a snapshot from the doorbell's camera and send it to your mobile phone when someone presses the doorbell button. Click Settings -> Automations -> + Create Automation and then create a new automation from scratch. Click on the three vertical dots in the top right hand corner of the screen and then click Edit in YAML Paste the automation from my github repo (linked above) into the editor and update entity names for devices such as your mobile phone. Save the automation and restart Home Assistant so the new automation becomes active. Here is a summary of how the automation should behave. [esp32_doorbell_process-1-1024x417] Step 4 - Time to wire it up Once the enclosure is printed, we can start the final assembly. There are a few variants of the ESP32-CAM board, each with slightly different pinouts so double check the pinout on the board you get. Follow the wiring guide below. I soldered everything onto the back of the lower PCB (the one with the micro USB port). It's important to add the 10k ohm pull down resistor between GPIO14 and ground because without it, I noticed GPIO14 was floating high on quite often. [esp32_doorbell_wiring-1024x497] This is what it should look like when you're done. Bonus points for covering the resistor in heatshrink tube. [esp32_doorbell_inside-1024x576] Here are some pics of mine before it goes up next to the front door! [esp32_doorbell_on_wall-1024x576] [esp32_doorbell_outside-1024x576] [esp32_doorbell_outside_2l-576x1024] *The product links in this post may contain affiliate links. Any commission earned is used to keep the servers running and the gin cool. Thanks for making it to the end of the post! Did this article help you or do you like my work? [?]Buy Me a Coffee[?] If you like this project, you might like these... [usb_fan_thumbnail-300x200] Home Assistant compatible desk fan (120mm) * 22 July 2023 [router_pi_2-300x169] Raspberry Pi x OpenWRT Travel Router * 14 May 2023 [automation_meme-300x225] Automatically shutting down Octoprint from Home Assistant * 31 March 2023 13 Comments 1. tristam Christian 7 August 2023 / 13:00 Reply Sounds cool. Is there any facility to have the door bell button ring a classic bell rather than needing a home assistant computer to be up to hear the door bell? + tristam Jakub 7 August 2023 / 17:58 Reply If you somehow (maybe with a relay or something) hooked up the bell to either that esp or another esphome device, you could set it up as a gpio switch and have an automation to turn it on for a couple seconds, or while the button is pressed + tristam tristam 12 August 2023 / 09:13 Reply As Jakub mentioned below, you could hook up a relay to one of the GPIO pins on the ESP32 which could sound a bell. + tristam Reyo 15 August 2023 / 23:28 Reply Maybe combine stuff with https://frenck.dev/ diy-smart-doorbell-for-just-2-dollar/ 2. tristam David 7 August 2023 / 18:06 Reply The problem I found with esp32 was the low quality video is hard to compete with a 2k door camera, and it suffered from high latency 3. tristam Guy Streeter 11 August 2023 / 15:13 Reply The write-up doesn't talk much about final installation of the doorbell. How did you supply power to it? Does it run on existing doorbell wiring? + tristam tristam 12 August 2023 / 09:15 Reply Yeah, I wasn't keen to have my house on the internet. I've run a 10m USB cable to the doorbell and powered it from a normal phone charger. I'm going to work on an option that accepts 24v AC which is what most doorbells run on so keep an eye out for that. 4. tristam Steve R 11 August 2023 / 17:23 Reply Guy S - the parts list did mention a 10m USB cable, I suppose that's the power, although the article didn't mention it. Ah, one of the images has the white USB cable shown. I was wondering about how to waterproof the camera hole - as water coming in there would quickly ruin everything. I am creating several ESPHome devices with I2S speakers, so I could make them do a "ding dong" sound when someone presses the button. + tristam tristam 12 August 2023 / 09:17 Reply Hey Steve, as you said, the camera hole means that it isn't waterproof so it would need to be installed somewhere that is protected from rain. 5. tristam Yaniv 12 August 2023 / 19:36 Reply I would love to see a MK2 version with electric lock control + tristam tristam 14 August 2023 / 12:14 Reply That sounds like an fun challenge! 6. tristam Dean 14 August 2023 / 09:31 Reply Hey man awesome writeup and awesome project thanks for this. Im just stuck on one thing, the deviceid in the automation. I cant find the device ID to use and also cant use a entity name as that doesnt seem to work. Any ideas? Thanks + tristam tristam 14 August 2023 / 12:04 Reply Hey Dean! I used the automation builder to create that automation so it must have populated automatically. One way to get it is to go to Settings -> Devices & Services -> Devices tab -> Click on the device (the doorbell in this case) and the device ID is the last part of the URL (from / device/ onwards). Good luck! Leave a ReplyCancel Reply Your email address will not be published. Required fields are marked * Name * [ ] Email * [ ] Website [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] Add Comment * [ ] [ ]Save my name, email, and website in this browser for the next time I comment. Post Comment [ ] [ ] [ ] [ ] [ ] [ ] [ ] D[ ] Copyright (c) 2023 - Tristam