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
-
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. -
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’
- platform: state
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
-
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. -
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’
- platform: homeassistant
Apologies for the block quotes, but I still dont know how to use this. See below link to hastebin for clarity