Hikvision Doorbell Camera – Chime and Motion Sensor

mqtt
Tags: #<Tag:0x00007fd0793245c8>

#1

Purchased the Hikvision Doorbell with an independent power supply unit, as I’ve read mixed reviews on powering it from the mechanical chime.

Whilst the camera run out of the box without issues, it left a gap in terms of a chime!

So this was my solution, which as serendipity goes also lead me to a way to pull the motion sensor state.

Requirements:

• Hikvision doorbell
HIk-Connect (Hikvision camera application)
• Media_player (chromecast, sonos, bose, whatever)
Tasker
Autonotification
Mqtt Client
• Download an mp3 bell chime and place in www/doorbell (one site)

Basic concept is autonotification intercepts the push-messages from Hik-Connect and fires an action (mqtt message) via Tasker.

Doorbell Chime

  1. In tasker add profile > event > plugin > autonotification
    In autonotification > intercept >configuration > Apps (select Hik-Connect) > Notification Text (type – You have a call request from a visitor.) and select/checkmark exact.

  2. Back, back
    New task > plugin > mqttclient > publish mqtt message.
    Add the state topic (for example homeassistant/sensor/doorbell
    Add payload (for example 1)
    Back, back save.

binary_sensor:

  • platform:
    name: “Doorbell Chime”
    state_topic: “homeassistant/sensor/doorbell”
    device_class: sound
    payload_on: “1”
    payload_off: “0”

automation:

  • id: doorbell_chime
    alias: Doorbell chime
    initial_state: on
    hide_entity: true
    trigger:
    • platform: state
      entity_id: binary_sensor.doorbell_chime
      from: ‘off’
      to: ‘on’

action:

  • service: media_player.volume_set
    data:
    entity_id: media_player.chromecastaudio
    volume_level: 0.9
  • service: media_player.play_media
    data_template:
    entity_id: media_player.chromecastaudio
    media_content_id: ‘http://192.168.1.XXX:8123/local/doorbell/doorbell-2.mp3
    media_content_type: audio/mp4

Doorbell Motion Sensor

  1. In tasker add profile > event > plugin > autonotification
    In autonotification > intercept>configuration > Apps (select Hik-Connect) > Notification Text (type – DoorBell Motion Detection Alarm) and select/checkmark exact.

  2. Back, back
    New task > plugin > mqttclient > publish mqtt message.
    Add the state topic (for example homeassistant/sensor/bellsensor
    Add payload (for example 1)
    Back, back save.

binary_sensor:

  • platform: mqtt
    name: “Doorbell Motion”
    state_topic: “homeassistant/sensor/bellsensor”
    device_class: motion
    payload_on: “1”
    payload_off: “0”

Sensor Reset Automation

Since the sensors only trigger to “on”, we have to create an automation to reset the payload to off after afew seconds.

  • id: reset_doorbell_sensor
    alias: Reset doorbell sensor
    initial_state: ‘on’
    trigger:

    • platform: homeassistant
      event: start
    • platform: state
      entity_id:
      • binary_sensor.doorbell_chime
      • binary_sensor.doorbell_motion
        to: ‘on’
        for:
        seconds: 10

    action:

    • service: mqtt.publish
      data:
      topic: ‘homeassistant/sensor/doorbell’
      payload: ‘0’
    • service: mqtt.publish
      data:
      topic: ‘homeassistant/sensor/bellsensor’
      payload: ‘0’

Apologies for the block quotes, but I still dont know how to use this. See below link to hastebin for clarity

https://hastebin.com/dutufawafo.bash


Hikvision doorbell and camera
Video doorbell without cloud?
Ring Doorbell
#3

So this could work for the button press as well probably, not just motion. Great work! I’ll have to look into this.


#4

@jschwalbe.
yes, it works with the button press. That was my main motivation; getting the sensor state was an after-thought.


#5

@juan11perez: It seems it is linked to the Android App on your phone, do you get also notifications when you are not at home (and your phone is with you)?

Other question: Should this work for iPhone too?


#6

Yes, you’ll get notifications on your phone if the hikvision app is installed. you’ll need to deactivate the push notification in your mobile if you dont want it.

you can use the ios app for notifications, but obviously not for the bridge as there’s not ios tasker.