ONVIF Doorbell - EZViz DB1/Hikvision DS-HD1

Here’s a couple I’m using now. Could use some cleanup and optimizing but they work. They’re pretty general, the logic really isn’t tied specifically to the doorbell camera, can really work for ANY PIR sensor, just so happens that this is on the EZviz doorbell.

IOS Send Live view notification on PIR motion detection. Live video only works when I’m on my home network, so it doesn’t trigger if I’m not home.

automation:
  - alias: Notify - Porch Motion
    initial_state: on
    trigger:
      - platform: state
        to: 'on'
        entity_id:
          - binary_sensor.doorbell_pir_motion
    condition:
      - condition: state
        entity_id: binary_sensor.home_occupied
        state: "on"
    action:
      - service: notify.ALL_IOS
        data:
          message: Front Porch Live
          title: Motion Detected
          data:
            attachment:
              content-type: jpeg
            push:
              category: camera
              sound: "HummingbirdNotification_Haptic.caf"
            entity_id: camera.doorbell
      - service: automation.turn_off
        entity_id: automation.notify_porch_motion
      - delay: "00:01:00"
      - service: automation.turn_on
        entity_id: automation.notify_porch_motion

This one is for when I’m away from home, I take a snapshot and upload it to my backblaze b2 bucket, then since this link IS externally accessible I can view it from my phone anywhere.
The filename is somewhat randomized in order to prevent any brute force guesses viewing these snapshots.

  - alias: Porch Motion Detect - Take Snapshot
    initial_state: on
    trigger:
      - platform: state
        to: 'on'
        entity_id:
          - binary_sensor.doorbell_pir_motion
      - platform: state
        entity_id:
          - binary_sensor.front_door
        to: 'on'
    variables:
      filename: "doorbell-{{ states.sensor.snmp_cable_out.state }}-{{ now().strftime('%s') }}.jpg"
    action:
      - service: camera.snapshot
        data:
          entity_id: camera.doorbell
          filename: '/tmp/{{ filename }}'
      - service: shell_command.b2_upload
        data_template:
          filename: '{{ filename }}'
      - service: mqtt.publish
        data:
          topic: MQTTTOPIC/frontdoor/camera/last_capture
          payload_template: "{{ filename }}"
          retain: true

  - alias: Porch Motion Detect - Notify
    initial_state: on
    trigger:
      - platform: state
        entity_id:
          - sensor.lastcapture_front_door
    condition:
      - condition: state
        entity_id: binary_sensor.front_door
        state: "off"
    action:
      - service: notify.ALL_IOS
        data:
          message: Front Porch Snapshot
          title: Motion Detected - Snapshot
          data:
            attachment:
              url: "https://BACKBLAZEB2-PUBLIC-URL/file/BUCKET/{{ states('sensor.lastcapture_front_door') }}"
              hide-thumbnail: false
              content-type: jpeg
shell_command:
  b2_upload: b2 upload-file BUCKET /tmp/{{ filename }} {{ filename }}

with these doorbells you can already get the stream into home assistant right or record it with 3rd party software.

so when I want to trigger the doorbell button I just put this device: https://www.tindie.com/products/ErikLemcke/doorbell-modernizr-2/ between the wires to the Gong and Voila home assistant is triggered on button press correct?

Yes that should work!

Much information related to this Ezviz DB1 wifi doorbell can be found on this site: https://ipcamtalk.com/threads/new-rca-hsdb2a-3mp-doorbell-ip-camera.31601/page-101

I used the batch configuration tool and flashed the DB1 with hikvision firmware.

Once the camera did reset to factory firmware, I had to reset the connection, but wifi didn’t connect. I noticed a strange wifi network was available from the DB1. Using the batch config tool, I change the DB1 default wifi network name and password to match with the default Ezviz: Ezviz_CXXXX, password: CXXXX_ (or something similar). Only after setting this wifi network config, I could connect the device again into the ezviz app as this one expected this config during device connection. (the required network and password are shown in the Ezviz app during advanced device connection configuration).

I used this specific hikvision firmware as it allows you to enable Onvif protocol. Yet, I’m still using the Ezviz app on phone. The HA Ezviz HACS plugin didn’t work well for a while, so I used ONVIF for a long time, but now ezviz cloud is working very well, so Onvif and the specific firmware may no longer be needed.

In order to be able to cast the life stream onto a Google Nest Hub, I had to lower the resolution of the camer to 1024x… as the default of 2048x… was only shown rotated on the hub. But all of this can be configured with the Batch Config tool.

Within HA, I used Ezviz cloud HACS plugin to connect Ezviz, it creates many different entities and allows to control several setting of the DB1 (ir, light on bell, sound, etc). When the DB1 is connected, all functionalities as streaming and motion detection entities became available, as well as a HA alarm to arm and disarm DB1.

Config used in configuration.yml:

ezviz_cloud:
    cameras:
      CXXXXXXX:
        username: !secret ezviz_cam_username
        password: !secret ezviz_cam_password

Automation for motion detection:

  • id: ‘XXXXXX’
    alias: Motion detection Ezviz DB1
    description: ‘’
    trigger:
    • platform: state
      entity_id: binary_sensor.db1_cXXXXXX_motion_trigger
      to: ‘on’
      condition:
      action:
    • service: notify.notify
      data:
      message: motion detected
      mode: single

service to play camera stream on nest hub:

  - service: camera.play_stream
    data:
      media_player: media_player.hub
    entity_id: camera.cs_db1_XXXXXXXX_mainstream

service to record camera stream:

  - service: camera.record
    entity_id: camera.cs_db1_XXXXXXXX_mainstream
    data:
      duration: 30
      lookback: 5
      filename: /config/recordings/ezviz_{{ now().strftime("%Y%m%d-%H%M%S")
        }}.mp4

I did not want to use the cloud plugin as I wanted to keep everything local. The configuration I posted allows the camera/doorbell to work without any internet connectivity aside from the very initial setup to configure the wifi password, once that’s done everything is local-only.

Does the EZVIZ cloud hacs expose the door bell button also? will this work on the newer version of the camera the DBC1?

Sorry to bring up something so old but how did you get this working? I have a Hikvision camera with 2-way audio and cannot hear the audio from it at all in HA

no, so far didn’t find any integration that supported the door bell button / doorbell push. Only workaround if seen (not tested) is by checking DNS logs:
New RCA HSDB2A 3MP Doorbell IP Camera | Page 296 | IP Cam Talk as mentioned by DeMichell:

Hi,

Im a long time lurker on this post, eagerly waiting to see someone pop up with a solution to intercept the doorbell push in openhab.
Then i can use my google home speakers to play a sound when the doorbell has been pressed.
I just wanted to share my current workaround of doing this.

I have openhab running on a windows server. I installed the DNS services on my server en changed the DNS address on my Ezviz DB1 trough Batch Configuration to point to my DNS server.
I Enabled logging on my DNS server and it writes the log to c:\temp\log.txt I then have a powershell looping trough the log sending a http request to my openhab.
Here is an example of the DNS request that is been made everytime the doorbell is pressed:
12/11/2020 11:01:58 0C04 PACKET 00000231F06CBFF0 UDP Rcv 192.168.1.37 0030 Q [0001 D NOERROR] A (5)alarm(2)eu(2)s3(9)amazonaws(3)com(0)
Here is an example of how to use this trough powershell:

Get-Content -Path C:\temp\log.txt -Tail 3 -Wait | where { $_ -match “alarm” } |
ForEach-Object{
Write-Host “DOORBELL PRESSED”
}

In the example above the everytime a dns request in the log containts the word alarm, powershell will echo Doorbell Pressed.
You can switch this to a http request answering to a virtual switch in openhab. I hope to find a better solution in the future.

you may look into hikvision batch configuration tool to enable Onvif. Once Onvif is enabled, you can use Onvif default intergration in HA and get stream. WebRTC plugin can then also be used to get fast stream in browser.

I’ve got the cameras working in HA via ONVIF, didn’t need any config tool, but there is no audio stream coming into HA from what I can tell.

I tried to find out solution, how to catch button press, but i was unable to get it.
ONVIF does not seem to be sending button press info.
HOWEVER i’ve found workaround.
AC relay, power pack, and i’m gonna get some ESP to send signal via mqtt. Relay installed instead of mechanical chime will ‘catch’ signal when button is pressed, then other end of relay will close or open circuit, and that can be grabbed by any ESP with even tasmota and sent to HA or whatever. Ordered relay, i’ll try it in next few days, but it seems to be easy enough.

1 Like

please can you provide a tutorial ?

I’m looking for a doorbel, ezviz or amcrest.

Amcrest seems more simple to integrate, Ezviz seems more tricky, and i read that is cloud polling, not local like amcrest ?

EDIT: i bought from now an amcrest ad410, i’m waiting that arrive, i hope that is more simple to integrate, than ezviz

Another option to catch the ring button pressed might be to integrate a Shelly1. They describe on their shelly website a use case to get notified of dumb doorbell pressed, see also Make a dumb doorbell smart with Shelly 1.
But I didn’t try it yet myself.

Unfortunately I noticed that it does not always execute the DNS query, sometimes it doesn’t, probably there’s a local cache. When it does, the “alarm” string is always present. But it’s not reliable, so I don’t think it can be used as a good trigger.

Did you ever get this working? I am trying to go down this route, but cannot get the relay to change state. It’s always activated. I think I may need a resistor inline with the relay to simulate the mechanical chime.

For those who want to catch the button press; I have created a small tutorial in the past. You can find it at: Getting Ezviz DB1 (or Hikision or LaCie) doorbell presses

1 Like

I see above, mention that the IR can be controlled using Ezviz Cloud HACS. I’ve installed the EZVIZ official integration (not cloud - and I am on Core), I see the Infrared_Light entity, but when I switch it (through device controls or developer tools entity), my DB1 doesn’t seem to update, the image remains “true colour” and not “infrared”.

Does anyone have this working? I have a bright streetlight that acts as a backlight to anyone approaching the camera and want to be able to automated turning the IR on/off (since the DB1 itself won’t do this with anything other than a schedule since it see’s enough ambient light it doesn’t think the IR is needed).

With sunrise/sunset changing through the year, I’d like to automate this rather than having a set on/off time.

I just completed a detailed report on how I detected doorbell presses using a Shelly Uni powered off the existing doorbell circuit. I also include details of an investigation into the DB1/DS-HD1’s traffic (from a security perspective), a comparison of various apps, and detailed screenshots of desktop configuration and the firmware upgrade process. I posted the blog link on the forums over here (and I would welcome comments and feedback in that post):

I have EZVIZ flashed with hikvision firmware. I would like to record directly on the SD card added to the camera and access the files with HA. Do you think it’s possible to access the file system with HA/node red?

this link : New RCA HSDB2A 3MP Doorbell IP Camera | Page 366 | IP Cam Talk may help in getting more info from the Ezviz DB1/Hikvision DS-HD1 Video Doorbells. may also have a way to make a custom firmware (I dont know how to) as this one company actually has provided the u-boot file for their version of the Ezviz DB1/Hikvision DS-HD1 Video Doorbells firmware called Clare Controls - Clare Video Doorbell v3.

-also-

this may also help in commands better as this is the NVR driver (for ONVIF?) for their version of the Ezviz DB1/Hikvision DS-HD1 Video Doorbell
New RCA HSDB2A 3MP Doorbell IP Camera | Page 366 | IP Cam Talk