I have integrated my AD410 doorbell into Home Assistant using the built-in amcrest integration and this helpful comment which pointed to @calisro’s bug comment with a workaround for problems with reliability in the Dahua integration.
I now have an entity for the doorbell in Home Assistant with sensors for online, doorbell pressed, human detected, and motion detected.
Here’s exactly what I did (I’m still learning Home Assistant, so please let me know if there’s something I should improve).
configuration.yaml
homeassistant:
packages: !include_dir_named packages
amcrest: !include amcrest.yaml
secrets.yaml
amcrest_password: "PUT YOUR AMCREST AD410 PASSWORD HERE"
amcrest.yaml
- host: 192.168.XX.XX <-- PUT YOUR AD410 IP HERE
username: admin
password: !secret amcrest_password
name: Front Door Bell
resolution: high
stream_source: rtsp
scan_interval: 15
binary_sensors:
- online
Create a directory called packages
under the directory that has your configuration.yaml
. Put this file in the packages
directory.
packages/package_amcrest_triggers.yaml
template:
- trigger:
- platform: event
event_type: amcrest
id: start
event_data:
camera: "Front Door Bell"
event: CrossRegionDetection
payload:
Code: CrossRegionDetection
action: Start
data:
Action: Appear
Object:
ObjectType: Human
- platform: event
event_type: amcrest
id: stop
event_data:
camera: "Front Door Bell"
event: CrossRegionDetection
payload:
Code: CrossRegionDetection
action: Stop
data:
Action: Appear
Object:
ObjectType: Human
binary_sensor:
- name: Front Door Bell Human
icon: mdi:motion-sensor
state: >-
{{ 'on' if trigger.id == 'start' else 'off' }}
- trigger:
- platform: event
event_type: amcrest
id: start
event_data:
camera: "Front Door Bell"
event: AlarmLocal
payload:
Code: AlarmLocal
action: Start
- platform: event
event_type: amcrest
id: stop
event_data:
camera: "Front Door Bell"
event: AlarmLocal
payload:
Code: AlarmLocal
action: Stop
binary_sensor:
- name: Front Door Bell Ring
icon: mdi:doorbell-video
state: >-
{{ 'on' if trigger.id == 'start' else 'off' }}
- trigger:
- platform: event
event_type: amcrest
id: start
event_data:
camera: "Front Door Bell"
event: VideoMotion
payload:
Code: VideoMotion
action: Start
- platform: event
event_type: amcrest
id: stop
event_data:
camera: "Front Door Bell"
event: VideoMotion
payload:
Code: VideoMotion
action: Stop
binary_sensor:
- name: Front Door Bell Motion
icon: mdi:motion
state: >-
{{ 'on' if trigger.id == 'start' else 'off' }}