Door bell with pi camera and motion detection

Hi Andy
My pi zero’s use motioneye OS , they seem to run fairly stable.
the settings i use are as follows from the top:

General settings :
Advanced settings : ON

Settings under Network are obvious

Services:
All off

Video device:
Automatic brightness off
Brightness: 50%
Contrast: 50%
Saturation : 50%
Resolution: 640 x 480
Frame rate: 10

Text overlay:
I left as default

Video Streaming:
Frame Rate: 10
Quality : 50%

Expert settings:
Only two parameters I change are
Fast Network Camera : OFF
Camera LED: OFF

Still images:
All default except
capture mode: Motion triggered (One Picture)
preserve pictures : for 1 week

Movies:
Movie quality: 75%
Recording mode: Motion Triggered
Max Movie Length: 30 seconds
Preserve: for one week

Motion Detection:
Frame change threshold: 1.4%
auto noise detection: OFF
Noise Level : 12%
Light switch detection: Outside 0% : Inside 25%
despeckle filter: OFF

Motion Gap: 10
Captured Before: 0
Captured After: 100
minimum motion frames : 10

Mask : OFF

Show frame changes : ON (FPS goes down but I find it tolerable)
Create Debug Media Files: OFF

Motion Notifications:
Run a command: ON
Command:
curl -X POST -H “x-ha-access: #####” \ -H “Content-Type: application/json” \ -d ‘{“state”: “on”, “attributes”: {“friendly_name”: “frontcam”}}’ \ http://myaddress.duckdns.org:8123/api/states/binary_sensor.frontcam

Run an End Command: ON
Command: curl -X POST -H “x-ha-access: #####” \ -H “Content-Type: application/json” \ -d ‘{“state”: “off”, “attributes”: {“friendly_name”: “frontcam”}}’ \ http://myaddress.duckdns.org:8123/api/states/binary_sensor.frontcam

1 Like

Hi Andy,

I’m quite new to HA, but I have implemented a solution that matches your requirements.

My solution is based on the doorpi project and I have been using it for two months now.

I run a Raspberry Pi 3 with a piface add-on board for connecting the doorbell button, switch on/off audio, nextion 3,2 inch display and IR LEDs (for night view). The camera is a pi noir camera equipped with a fish eye lense.

Motion detection is done via the software solution “motion”, video streaming via mjpeg_streamer, the main doorpi software manages events and establishes the SIP call.

When motion is detected, the LED lighting of the button and the Nextion are being switched on for one minute.

If a visitor uses the button, a pushbullet message including a snapshot is being sent.

I experimented with Google Cloud Vision to detect parcel services, but this is not so easy. The response times are acceptable, but the results are not reliable. Additionally, you always have to think of the legal requirements depending on where you live.

My SIP server is a Fritzbox (built in support for SIP), my client is a Fritzfon C5, but can be any other SIP client. Should also work with Asterisk as SIP server.

All status updates are being sent to HA via MQTT.

I have also built in a convenience feature to play a standard message “Coming to the door” when I cannot answer the call on the Fritzfon. This message can be played using an Alexa routine anywhere in the house.

The main obstacles for production readiness were:

a) Making the doorpi weather proof (rain, heat, cold, insects(!))
b) Secure the home network (cut lan connection on sabotage detection)
c) Echo cancellation, this is a serious problem that you have to address in one way or another. I’m using pulseaudio, additionally I rely on the capabilities of the Fritzfon. Don’t underestimate that problem.

EDIT: I tuned the rpi 3 for low power consumption, switching off everything I do not need and using a fixed cpu clock of 600 MHz. That should also help with any potential heat problem. The idle power consumption is about 2 watts, when audio, IR LED and nextion are activated, it will go up to about 7 watts.

With the motion detection running all the time, the CPU utilization is about 15%. The still images of the last 3 visitors are accessible through the doorpi webserver.

2 Likes

may I know how?

1 Like

Hi! @meganoodle and @robmarkcole are you okay?

What is the current status of your doorbell projects with Raspberry Pi?

I’m currently playing with a similar project and I still haven’t managed to communicate through the cell phone and a speaker connected to the raspberry pi

I think there are a number of projects doing this with RPi, you could also check Hacksterio

you can follow this project:

when will be available, you can buy a cheap SIP doorbell (like Dahua, Hikvision or Akuvox ) and use it from a lovelace card
a few pros of a ready made doorbell vs DIY are:

  • echo cancelation

  • high grade Audio & Video with nightvision

  • cloud app for push notifications

  • integration with NVR/DVR for advanced deployment

  • weather proof solution for external installation

1 Like