DIY Video Doorbell with Voice Response | ESPHome / ESP32 Camera / DFPlayer Mini

I typically get the notification with the image about 3 seconds after the doorbell is pressed. Check to see if the automation is triggered right away by looking in the Logbook, e.g.,

image

If the automation is triggered and notifications are sent, it might be an issue of notification settings. For my Android phone, I use:

  priority: high
  ttl: 0

Without that, I sometimes see a long delay.

Another thing you can check for the camera is whether the image is not received by HA from the ESP32 or whether it’s not sent from HA to your phone or wherever. Check to see if the image show up here:

https:/<yourtoken>.ui.nabu.casa/local/images/doorbell/front_door_snapshot.jpg

If it does, that could mean that it’s not arriving at HA before the notification is sent. That could indicate a poor connection. (Mine is 60 dbm, btw.) You might need to add a delay of a second or two in the automation to given time for the image to arrive from the doorbell.

:+1:

thank you so much! It seems that problem is solved!
As I told you I changed ESP and power supply.

I had the same problem.
I noticed that device was unavailable every 2-3 minutes.
Then I decided to remove the breadboard and connect pins directly.
It worked! I didn’t have any other unavailability problems.

However the camera picture on tablet was still very slow and not updated!
I checked my cards settings and I had the live view option set to Auto and not to LIVE
as soon as I changed this it worked

The last problem I have is that I need to rotate image 90 degrees
See picture above.
Do you know how I can do this ?

on esphome sketch there is the following option but not a rotate option

  vertical_flip: false
  horizontal_mirror: false

thank you

1 Like

just to save you time from typing. I found the solution to this problem too

thank you! you are a star!

1 Like

I’m glad that you found a solution. But, if you want to send the image in a notification in addition to displaying it in a Lovelace card, it will still be rotated in the notification.

If you have a camera with a long flex lead like this one, you can make a gentle 90deg bend in the between the camera and the connector.

The rotation issue is exactly why I used a long lead camera. I’ve just updated the Github repository to point that out:

“The reason for a long lead camera module is that the camera image is rotated at 90deg when the ESP32-Cam is in a portrait orientation. Using a long lead camera module and mounting the ESP32-Cam board backwards enables making a gentle 90deg turn in the flex between the board and the module.”

BTW, there is a missing m in community in the actual link (but not in the link text) to the card-mod rotation solution, so clicking the link will not open it. Thanks, though, I didn’t know that card-mod could rotate an image.

I’d love to see some pictures of your doorbell when you’re finished.

I have corrected link.
thanks

I saw it! Very nice!
Maybe is useful for other users to point out that the camera can be rotated with the card-mod component
Credits are more than welcome :slight_smile:

I have another 2 queries if you don’t mind me asking:

  1. On the github repository you have three mp3 files.
    Do I just copy them on an SD card which then I place at dfplayer?
    Do I have to rename them?

  2. I can’t understand what the Clear Acrylic Discs Laser is for?
    What is the 2mm x 16mm ??
    2mm Thickness and 16mm diameter?

I received them today but it seems they are to small.
Please see the photo bellow

If they stand as a “cover” in front of the camera, then they are too small.
The ones that you show on your photo on github repository is much larger .

εικόνα

Please forgive me if I haven’t understand.

I’ll add more detail to the repository when I get a chance.

You can use those MP3 files or any other you like, but they do have to be renamed.

Basically,

  1. Format the SD card as FAT32
  2. Rename the files following the example: 001.mp3, 002.mp3, etc. Keep track of which files are which number so that you can refer to them correctly in the ESPHome code later.
  3. Copy the files to the card in the order of the numbering. So, for example, copy 001.MP3 to the card first.

Here is a good overview of working with the DFPlayer Mini. Note that although the guide shows Linux commands, you can use any OS as long as you can format FAT32.

Yes, 16mm diameter and 2mm thick.

The discs fit WITHIN the 3D printed camera surround, inside the yellow circle. Mine stay put just with friction.

The invoice in your photo shows 15mm, I think. If you plan to use the camera surround at the Onshape link, they do need to be 16mm in diameter, although you might be able to use glue with 15mm discs. Alternatively, you could modify the 3D part to have a smaller diameter.

Hello Ron,
Hope you are fine.

Am still facing problems with the doorbell.
Here is the latest feedback.

I had many stability problems. Doorbell disconnected, doorbell unavailable etc etc.
I decided to power supply button and dfplayer from another power supply.

As soon as I did this, the doorbell is very stable. No more disconnects, no more unavailability issues.

Something which I didn’t figure out as the current I was supplying to doorbell was more than enough. (5V/2A)

At the moment the doorbell is stable.
The button is always lit and the card on the tablet is coming out as normal 3-5’’.

Didn’t manage to make the dfplayer to work yet, but I think I burn it.
Will get another one to make sure because I tested by itself and it still doesn’t work.

The only real problem I am still facing, is that camera crashing!
Within 2-3 days the camera will crash and it will only work if I reboot the esp.
No errors in log files, but no picture either.

Has anyone face this problem too?
Have you seen it?
I tried several things, and I also downgraded picture quality to half (320x240) but it didn’t correct the issue.

Any feedback is more than welcome
thank you

I do sometimes very briefly lose connection with doorbell in Home Assistant. This is a known issue with ESP-based devices. I haven’t noticed a missed notification because of that, though.

I have the DFPlayer and D1 Mini powered separately, albeit from the same USB cable–I just split the wires. I did that for flexibility in placement, but maybe I inadvertently avoided some stability issues by doing so.

I haven’t seen this. ESP32-Cam boards appear to vary a lot in quality, so maybe that’s the issue??? As a workaround, you could try automatically restarting the doorbell every night.

Will try it! Thank you
Will keep you updated

hello,

It seems I have solved all the issues with ESP32-cam and it is now very stable.
Camera streams constantly for over a week and it hasn’t crash!

So I was about ready to print the 3d design.
But when I visited onshape.com, I found out that they want 1500$ / year subscription to be able to download the 3d sketch.

Would you please upload the design to the github repository so we can download it?

thank you in advance

Good news. Glad it’s working for you.

They’ve recently been changing some things since Onshape got acquired, but you should still be able to create a free (not free trial) account. Go here and see if works.

I only have a free account. The difference between the free account and the paid ones is that every document you create can be seen publicly.

It’s better to start from an editable Onshape document rather that the STL files in case you need to modify anything. Explore a bit and see how you get on. The learning curve isn’t too steep, and there are lots of how tos on YouTube.

If you don’t want to make any changes after all, just right click on the bottom tabs and choose Export. Make sure that STL is the chosen format. You don’t need to change any other export settings.

image

This is suck a great project! Thank you for sharing all the information.
For some reason my DF-Player was not working with 5V as you had on your diagram. I connected it to 3.3V and then it was working. I had everything working and then I decided to add and change some mp3 files on the card. After that, I can’t hear any sounds/mp3s. I formatted the card and copied each file in order as I did before. Any ideas? The logs on esphome are as follows:

[15:03:03][V][dfplayer:103]: Ack ok
[15:03:03][D][light:275]: 'camera_4_button_light' Setting:
[15:03:03][D][light:284]:   State: OFF
[15:03:03][D][light:275]: 'camera_4_button_light' Setting:
[15:03:03][D][light:284]:   State: ON
[15:03:04][V][dfplayer:074]: Received message cmd: 0x3f arg 0x02
[15:03:04][I][dfplayer:093]: TF Card available
[15:03:04][D][light:275]: 'camera_4_button_light' Setting:
[15:03:04][D][light:284]:   State: OFF
[15:03:04][D][light:275]: 'camera_4_button_light' Setting:
[15:03:04][D][light:284]:   State: ON
[15:03:04][D][light:275]: 'camera_4_button_light' Setting:
[15:03:04][D][light:284]:   State: OFF
[15:03:05][D][light:275]: 'camera_4_button_light' Setting:
[15:03:05][D][light:284]:   State: ON
[15:03:05][D][light:275]: 'camera_4_button_light' Setting:
[15:03:05][D][light:284]:   State: OFF
[15:03:05][D][light:275]: 'camera_4_button_light' Setting:
[15:03:05][D][light:284]:   State: ON
[15:03:06][D][light:275]: 'camera_4_button_light' Setting:
[15:03:06][D][light:284]:   State: OFF
[15:03:08][D][esp32_camera:156]: Got Image: len=12138
[15:03:12][V][sensor:023]: 'camera_4 Uptime': Received new state 698.939026
[15:03:12][D][sensor:117]: 'camera_4 Uptime': Sending state 0.00000 h with 0 decimals of accuracy
[15:03:13][D][binary_sensor:036]: 'doorbell_button': Sending state OFF

Maybe this helps https://www.hackster.io/julianfschroeter/stream-your-audio-on-the-esp32-2e4661 to get the two way audio running??

Or this is a good hint for voice integration

@bachoo786 @ronschaeffer

Sorry, been away from the forum for awhile. Were you able to the MP3s working?

How did you solve it, did you identify the issue?

Yes, I had to get different MP3 modules. The problem were the modules I was using. Thanks

1 Like

hello again,
I have stay offline for a long time as we had a busy summer.

I am one step before I attach the doorbell to the wall. :slight_smile:
I have solve all power issues, I have solve camera and stability issues.

All of the above seems to go away with a good power supply 5V / 2A
Don’t try your luck with something less.

With 5V/2A I was able to supply esp, button and dfplayer.
it is really stable without problems and camera’s stream is fine!

My problem is with the 3 phrases and the dfplayer.
I have add them to the sd card. They work (standalone mode) and dfplayer can read them manually (pressing next IO_2 )

My problem appears when I try the same with HA tablet or our mobiles.
it doesn’t work

Here is my yaml code for “someone is coming”

alias: Doorbell someone coming
description: ''
trigger:
  - event_data:
      event_data:
        action: someone_coming
    event_type: mobile_app_notification_action
    platform: event
condition: []
action:
  - data:
      file: 2
    service: esphome.doorbell_dfplayer_play

When I press button or RUN ACTIONS from automation’s page to test it, I get the following to ESP logs:

[22:36:28][D][dfplayer:032]: Send Command 0x3 arg 0x02

But unfortunately nothing happens. Nothing plays.
At the SD card (root) I have copy 3 mp3 files as follows:

001.mp3
002.mp3
003.mp3

Any help will be appreciated very much
thank you