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).
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' }}
One nice note for people who have this camera and use the camera.snapshot functionality in HA or even the picture glance (which uses the snapshot too). The Amcrest is set to terrible snapshot resolution. THis will change it. DIdn’t brick mine but i’m not responsible for any issues.
@flyinglow.
Would you care to share how you discovered which entities/triggers were even available for the AD410? The Amcrest Integration page doesn’t show entities/triggers like the human motion detection or doorbell ring.
I’m interested in this discovery process as I have other devices in my HA which don’t show all the entities/triggers that I expected.
I find it’s really helpful to go to Developer Tools in Home Assistant. Then go to Events and where it says “Listen to events” enter state_changed and then “Start Listening”
You’ll see a bunch of events go by, but in that set of events are the ones you care about from your other devices. That should help you find out about what events are triggered. I used that plus some trial-and-error with my AD410 doorbell to figure out the right events and data.
does it still work for you ?
I did exactly what you shared above. However, when I check event change node in node-red, I don’t get any human detection or bell ringing state changes.
I think you’re choosing the wrong Entity in Node Red. It looks like you’ve selected the doorbell camera, which is the actual camera stream (which explains why the only event you see is ‘streaming’).
But there are 3 other entities that you should have if you followed what I shared above that correspond to the binary_sensor entries. In my example they are Front Door Bell Human, Front Door Bell Ring, and Front Door Bell Motion.
Expand the “entity” drop-down in Node Red and you should see the options to choose the other sensors. Here’s what I see:
First of all many thanks for this! It’s got my up and running with the AD410 nicely.
For me the human detection was not working. It looks like the ‘Action’ in the ‘data’ part should be under ‘Object’. An API change perhaps? So this works for me:
template:
- trigger:
- platform: event
event_type: amcrest
id: start
event_data:
camera: "Front Door Bell"
event: CrossRegionDetection
payload:
Code: CrossRegionDetection
action: Start
data:
Object:
Action: Appear
ObjectType: Human
- platform: event
event_type: amcrest
id: stop
event_data:
camera: "Front Door Bell"
event: CrossRegionDetection
payload:
Code: CrossRegionDetection
action: Stop
data:
Object:
Action: Appear
ObjectType: Human
binary_sensor:
- name: Front Door Bell Human
icon: mdi:motion-sensor
state: >-
{{ 'on' if trigger.id == 'start' else 'off' }}
Interesting. I wonder why mine is different. I just confirmed that my human detection is working with the original template I posted.
Maybe different firmware on our doorbells? From the “Firmware update” screen on the Amcrest App, mine is version 1.000.000000007.R.210220 (I may not have counted all the zeros correctly) and it says there are no updates available.
Thanks for figuring out how to make it work for you and posting the solution that’s working for you.
How odd, I am on the same fimrware version of the doorbell, and if I understand correctly this info is coming straight from the doorbell so strictly local. Only other thing I can think of is some different settings could be causing it.
I had to use Ian’s as well, and I’m getting human notifications now as well, same firmware.
Is it possible to switch the doorbell to H264? I’m not seeing a setting inside of the amcrest app for that. I changed my other amcrest cameras from H265 to H264 and it fixed the issue I’m having with the doorbell. Basically when I open it in homeassistant/chrome browser… I get the error that keeps popping up/disappearing in about 0.1 seconds that says “Error with media stream contents”
I setup a human detection automation that attempts to stream the camera to a google hub, but it never works. Really I just want to get it to stream somehow to an android tablet, how did you all go about some sort of automation for that?
@silentjon - the AD410’s factory default encoding is H.264 - at least it was with the original 20210220 firmware.
Yes, it can be changed in several ways. Via the HTTP API, Amcrest/Dahua NVR UI, or Amcrest Surveillance Pro & related s/w.
You can confirm what your primary stream encoding is via this API command entered into a browser: <ip_address>/cgi-bin/configManager.cgi?action=getConfig&name=Encode[0].MainFormat[0]
Edit: Be advised that changing video settings using software other than SmartHome app can sometimes introduce undesirable artifacts. It may change just the encoding and all is well, or it can add additional crap the AD410 doesn’t like. May be safest to just use the API.
Here’s the API command to change the main stream encoding: <ip_address>/cgi-bin/configManager.cgi?action=setConfig&Encode[0].MainFormat[0].Video.Compression=H.264
Awesome, it was at H.265 for some reason, I used that API link and it’s working now for me. A little buffery, but probably due to the wifi connection. The error isn’t popping anymore now.
I’ve went through locking up my doorbell many times from using Amcrest Windows tools and having to reset it, so I’m glad these API links work successfully.
Just wanted to drop a note saying thanks for this! I tried using the Dahua integration which was super unreliable. This is working great and my wife is now happy .
Stopped by to say thank you for your work! I had been trying to make this doorbell to work consistently and the Dahua integration I had been using wasn’t reliable at all.
Thank you for helping me set up the AD410 in Home Assistant. How would I then use this in an automation through HA’s UI when a human is detected by the doorbell camera? I see that I can select event triggers when I build an automation through HA’s UI, but don’t know what to do from there.
Thanks for any assistance.
Ari
Thank you - I’ve previously used that guide and felt it was indeed a good intro.
I’m not seeing the “Front Door Bell Human” event in Home Assistant. The Amcrest app notices humans and sends me notifications, but HA doesn’t pick up the event from the config above.
Note I’ve tried both @flyinglow the OP’s code and that from @ian_bush
As Iook back through the logs from the Amcrest integration, I don’t see any events getting logged except that the “online” binary sensor is constantly cycling off to on and back again.
I’d like to find out how to get the human event working and then find out how to enter it properly into the automations GUI to use as a trigger.