Tutorial: Integrate The Foscam Video Doorbell 2K VD1 / DBW5 with Home Assistant

Intro
Recently I’ve been in the market for a new doorbell, and I think I’ve finally found one I can live with. As we know, the smart doorbell tech is less than perfect when it comes to integrating with Home Assistant and I’ve tried several over the last year without much success.

  • Nest Hello – No RTSP feed therefore no frigate without hacky solutions
  • EZViZ DB* - Tricky to capture button press and fisheye video
  • Amcrest AD110 – Poor quality video (glare), Poor night-vision, couldn’t get casting to my Google Hub working without delay
  • Amcrest AD410 – No idea but expensive and hard to source in the UK

Wishlist
The following are the features I was after

  • RTSP / Frigate
  • Ability to capture button presses
  • Cast to my Google Hub / Alexa Show

Foscam Video Doorbell 2K VD1 / DBW5
image

The Foscam met all of my requirements and then some. Below is the feature list

  • 2k Video
  • RTSP H264/5
  • MJPEG
  • 2.4Ghz / 5Ghz / Ethernet
  • Google Assistant / Alexa Compatible
  • API

What we will get working
I’ll show you how we can capture button presses using node-red and then trigger an automation to
announce on your smart speakers that someone is at the door and cast a live video to your devices. I’ll also show you how to get the RTSP stream into Home Assistant

Prerequisites
First of all you will have to download the foscam app and setup your device. Make sure to remember your device username / password as we will use that later to setup the stream.

Perform any pending firmware updates, the latest version 1.17.2.9_2.134.2.31 is required to get the correct API working correctly. Interestingly I had to do 2 upgrades to get on the latest version.

Download and install the desktop software VMS. I used this to set the url to call when the doorbell is pressed. Note: You can also set this up using CGI commands but using the VMS software is easier and allows you to play with some of the advanced settings.
https://www.foscam.com/downloads/app_software.html

Install the Home Assistant node-red addon.

Configuring the cameras in Home Assistant

There are 2 urls we can use to video the video feed

rtsp:// yourusername:yourpassword@cameraip:88/videoMain

This is the high res video. Note, by default this is set to H265. If you want this to be H264 you have to turn this option on in the mobile app

image

rtsp://username:password@cameraip:88/videoSub

This is the sub stream, now to get the video to cast to my google hub I had to set the format to MJPEG, to do this you paste the link below into your web browser, changing the username/pass etc

http://cameraip:88/cgi-bin/CGIProxy.fcgi?cmd=setSubStreamFormat&format=1&usr=yourusername&pwd=yourpassword

You can now add this cameras to home assistant using the generic camera / MJPEG camera integrations

Capturing button presses

OK so this isn’t as easy as I would like because we have to work around a limitation in home assistant. Foscam allows us to call a webhook when the doorbell is pressed but only sends a GET request rather than a POST request that Home Assistant expects. The workaround is to use Node-Red to capture this webhook and then call an automation. You could also have Node-Red toggle a switch or whatever you prefer.

First of all fire up the VMS app, connect to your doorbell and then navigate to the following in the setup page

Here I have added a url that points to my node-red server, and I’ve added an endpoint called ‘doorbell-alarm’. Note, I had to disable SSL in Node-Red for this work - you might not need to.
Next, import the following flow into Node-Red

[{"id":"dabe49dae1a5027b","type":"tab","label":"Foscam Doorbell","disabled":false,"info":"","env":[]},{"id":"92ef6e2c36db918a","type":"http in","z":"dabe49dae1a5027b","name":"","url":"doorbell-alarm","method":"get","upload":false,"swaggerDoc":"","x":200,"y":120,"wires":[["beea1568a03685c5","21a2b9903c593c18"]],"info":"http://192.168.1.50:1880/endpoint/doorbell-alarm"},{"id":"beea1568a03685c5","type":"api-call-service","z":"dabe49dae1a5027b","name":"","server":"08bb60b9054bcc48","version":5,"debugenabled":false,"domain":"automation","service":"trigger","areaId":[],"deviceId":[],"entityId":["automation.doorbell_button_pressed"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":290,"y":200,"wires":[["93a85c4d6da594dc"]]},{"id":"93a85c4d6da594dc","type":"http response","z":"dabe49dae1a5027b","name":"","statusCode":"200","headers":{},"x":440,"y":280,"wires":[]},{"id":"21a2b9903c593c18","type":"debug","z":"dabe49dae1a5027b","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":400,"y":60,"wires":[]},{"id":"08bb60b9054bcc48","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m"}]

There is an automation trigger in this flow, edit it to point towards whatever automation you want to run when the doorbell button is pressed.

Automation
The final step is to create an automation. Here is mine that announced on my google devices that someone is at the door when the bell is pressed and then stream the video to my google hub.

alias: Doorbell button pressed
description: ''
trigger:
  - platform: webhook
    webhook_id: doorbell_webhook
    id: doorbell button pressed
condition: []
action:
  - service: tts.google_say
    data:
      entity_id: media_player.google_speakers
      message: Somebody's at the door!
      cache: true
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: media_player.play_media
    data:
      media_content_id: >-
        http://cameraip:88/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=yourusername&pwd=yourpassword
      media_content_type: image/jpeg
    target:
      device_id: 9477e76aa79f4237943b2c28b18ffc6a
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: media_player.turn_off
    data: {}
    target:
      device_id: 9477e76aa79f4237943b2c28b18ffc6a
mode: restart

Other options
Here are some other options you can now do which I’ll not cover in this guide

  • RTSP-Simple-Server – Used to proxy the stream and therefore minimise the stress on the camera when multiple view the stream simultaneously
  • Frigate – Detect and record motion events
  • Double Take – Facial Recognition software

Happy hacking!

7 Likes

Thanks for the writeup! I’m following your howto, but couldn’t get the GET request to work. Looks like the URL in node-red needs to be endpoint/doorbell-alarm in your example (or remove the endpoint part in the foscam URL).

I also changed the result to a simple event: doorbell-pressed, to mirror a home-assistant integration as much as possible.

In node red you just add doorbell-alarm but node red auto prefixes it with endpoint

So in VMS you need to add /endpoint/doorbell-alarm

hmm, weird, I don’t have that message at the bottom and it didn’t work until I prefixed it with endpoint/. I’m on the latest version as well.

Thank you first. After purchasing the corresponding doorbell now, I am setting it up accordingly. I’m new to node-red, so I don’t know how to write it. Are there any guides made with snapshots or videos?

I have the strangest thing, the endpoint has simply stopped working. The node-red and home assistant part seem to be working fine (I can send a manual GET from my PC and it is picked up) but actual doorbell presses are ignored. Does this sound familiar to anyone?

[edit] hmm, I tried the old “off and on again” and it is working again. so technically it is solved, but it does worry me a bit because all other functionality was working fine…

@totalitarian many thanks for the write up! It’s awesome and saved me tons of time figuring this out on my own.

Originally I was going to buy the Amcrest 4K doorbell but it wasn’t available in Canada, then I came across your post. Everything worked as described. The only thing I’d like to warn fellow home automators is that when updating the firmware, make sure you use the first package first (V-1.17.2.9). You’d think you could skip that and go direct to the latest package (V-2.x.2.33), but it doesn’t work that way.

The first package updates the system and the second package updates the on-device app. If you did it in the wrong order, like I did, you will not be able to update the system version anymore. As a result, I am stuck on system firmware 1.17.2.8, but fortunately still able to use the latest on-device app version. The latest on-device app version is absolutely required for sending events through webhooks. It will all make sense once you play with the UI for some time.

So far it works really, really well as a local only solution, compared to my old Ring Pro setup. Ring tried too hard to conserve bandwidth and I could not get a live feed most of the time, but with VD1 I get real time video every time.

1 Like

I can’t get the mjpg stream working. Just doesn’t load/show. Any advice?

Alternatively you can add the camera’s RTSP stream by enabling ONVIF through the Foscam mobile app (Settings->Advanced settings) and add it through the ONVIF component.
Configure it with the doorbell’s IP address, port 888, and the credentials you entered while initially setting up the doorbell.

Looks like a thorough write up, but surprised to see 2 way audio missing from your wish list. Surely this is a must have feature for a video doorbell? Otherwise you might as well just use a video camera alongside a wireless button.

My search for a suitable smart doorbell continues…

1 Like

Did you find something? I can’t go with Reolink as they don’t have a battery option. Eufy seems expensive. Blink seems ridiculously cheap for some reason I can’t understand. And then all the no-brand options like Foscam, which I’m unsure how they’ll integrate.

I’m searching myself atm and AFAIK the 2-way audio is not something that can be integrated into HA as of now. For this reason I think it’s important to choose a doorbell based on its app, as you’ll be forced to use it at least for that function.

So I kind of don’t see the point of integrating anything else into HA. If you’re not at home, you’ll want to open the app. If you’re at home, you’ll hear the chime. Show the camera wherever you like. I don’t see more case scenarios.

Still not found a viable solution.

For me it’s about trust and having a local, non-cloud-based, solution.

I ended up going with Reolink and I figure out how to do the wiring. There was just no other option that integrated the button, had 2 way audio in HA, and was local, and didn’t bring a hub. I almost went with Blink even if cloud. Due to the battery option.

Just wanted to say thanks for this tutorial it was really helpful! I had the same experience as @sophof - the /endpoint path was not added automatically and so I had to remove that part. The other thing I changed was to have node-red call a script rather than an automation.

For anyone else like me who’s a complete noob to node-red and trying this out make sure you press the “Deploy” button at the top right after making any changes in your node-red setup, otherwise they don’t do anything!

Hi @totalitarian , I tried you setup, but im facing one issue, the foscam vms (3.10) sw is bugge and it doesnt let me input Video-call url. By any chance have you older working version of foscam vms and could you please share it with me? ( via PM ) ? Thnak you.

Sorry pal, I no longer have this doorbell

Hi, NP at all. I figured out, that FW and SW of the bell is outdated (OMG) and only way hot to update it, was manually thorough Foscam VMS. Than, when updating via Foscam VMS wasnt working anymore, I check for updates in mobile app and finish remaining ones from the mobile. It was quite a hell, how they can exist ?!? :smiley:

P.S. its working now like a charm, thank you for your tutorial.

So what happened? Did you decide it wasn’t going to work or did it break… Now what are you using? :slight_smile: