Face recognition with DoorBird doorbell

Not sure if some one already achieved and shared it, here is my setup for the doorbell face recognition using DoorBird, Facebox and google home assistant

Prerequisites:
Facebox setup
Doobird Setup
Google home setup

My challenge was to setup capture the image using doorbird api link and pass it to Facebox api and update the sensor in HA for name of person. To achieve this I created a custom Python script and running it as API using flask. On doorbird button press an automation triggers and calls the API exposed by Python script which calls the Facebox API passing the Doorbird image link(API) to it. Results are from Facebox are processed by script and REST API for HA is called to set a sensor value to Name passed by facebox.
image

Link to script: https://github.com/coder1313/HA-Face-Detection.git

Steps to setup

Install flask using PIP and run the script

Setup a rest command in HA in configuration.yaml like this
rest_command:
face_detect:
url: http://:5000/
Example URL for me url: http://127.0.0.1:5000/test as its running locally

Setup an HA automation for doorbird button press and call above service(face_detect) in first action

Setup an other action for automation to announce name on google assitant

My automation look like below

  • id: ‘1593866668302’
    alias: Door Ring
    description: ‘’
    trigger:
    • event_data: {}
      event_type: doorbird_front_door_somebody_pressed_the_button
      platform: event
      condition: []
      action:
    • service: rest_command.face_detect
    • data_template:
      message: ‘{{ states(’‘sensor.face’’) }} is at door’
      entity_id: media_player.living_room_speaker
      service: tts.google_translate_say

sensor.face will be created automatically once python script API is called first time, as it call HA rest API in the end to set value of face sensor to name. More information on this here

I might not be able to explain it well as this is my first project posted here, but feel free to ask questions

2 Likes

Nice :slight_smile:
By the way you can use github gist for single-file stuff.

1 Like

@daps09 thanks for this. I suppose you could use any doorbell which can be integrated with HA and use your script for facial recognition?

if you can save the image from the bell somewhere then its possible to use it with some modifications.

1 Like