Yeah I’ll have to mess around with them again… I must have had something else going on because I didn’t get a listener for either integration on the events page… maybe I needed to force refresh or something.
Yes
The Amcrest integration passing events capability was added in the 2021.5 release. There is an outstanding issue that the subscription to “All” events is failing on some Amcrest cameras. See https://github.com/home-assistant/core/issues/50264 Check your logs to see if this is occurring for you, otherwise I have no idea why you aren’t seeing events if you have an updated HASS version.
A PR was submitted to include a new config to disable events, but it was rejected due to it requiring a YAML config update. Ironically, a later PR to include a new “crossline_detected” binary sensor was added which did require a YAML update and it was APPROVED! Different reviewer, different understanding of HASS dev rules. Sheesh.
EDIT: just now reviewed other Amcrest PR’s that were closed and rejected due to this YAML config show-stopper rule. Back in Feb 2021, there was a PR to add NVR support to the Amcrest integration! That would have been very useful. (BTW - RRoller’s does support Dahua NVR’s which should work for Amcrest NVR’s)
Could you please explain this beginner how exactly I can implement the call button of my AD410?
I have an integration for this doorbell using ONVIF, but it doesn’t expose the call button.
So I have manually added this to my configuration.yaml:
amcrest:
- host: IP_ADDRESS_CAMERA
username: YOUR_USERNAME
password: YOUR_PASSWORD
It doesn’t show in the list of integrations, but I have a new entity: camera.amcrest_camera
So now I have to create an automation with a trigger like this?
@nikotine - You won’t need both Amcrest and Onvif integrations for camera streaming, recording, PTZ support, etc. But you do need the Amcrest integration (or Amcrest2MQTT or Dahua Integtration) to trigger on doorbell press events or any camera event, so may as well just use it alone.
You also should specify these amcrest settings in the YAML config:
resolution: high
stream_source: rtsp
Note that the amcrest integration has not yet been updated to use the configuration UI so that is why it doesn’t show up in the integrations list.
The automation code above is all you need for triggering upon a doorbell button press. You will need to add your desired actions. There are other events possible - such as for human detection.
Thanks for your answer. I just tried that trigger above and it worked!
I’ll keep the ONVIF integration for the moment, as it seems to work well, next to the Amcrest integration.
Using this trigger, I can now get a very elaborate doorbell system:
The automation triggers an mp3 file on an RPi, then some Google TTS, all while flashing my Hue lights.
Good for when I’m jamming in my studio
Anyone have feedback on reliability of using events from the amcrest integration vs using Amcrest2MQTT
IE does it recover gracefully if the Doorbell loses wifi and reconnects or reboots?
I am currently using Amcrest2MQTT and would like to simplify down to a native integration if it is reliable… I have had some issues with Amcrest2MQTT that have now mostly been resolved…
I’ve used both and find the core amcrest integration event passing to be very reliable, even after reconnecting. I switched to it from amcrest2mqtt for the very reason you mentioned - to simplify things.
I’m also testing the custom dahua integration which also handles events nicely, and even provides the option to create binary sensors (which are nice to have, but not essential). It too works for the AD110/AD410.
I installed an AD410 over the weekend and I’m using the Dahua integration. The camera and motion detection works, but the doorbell button press duration is inconsistent. I left the entity names as created, and so I expected to see button presses reflected in binary_sensor.front_doorbell_call_no_answered
. However… it only works sometimes. The last time I pressed the doorbell button, it remained in a detected
state for over an hour, and subsequent presses don’t change the state. I can set the state in HA and it’ll remain. Maybe I’ll have to fudge it after a timeout; has anyone else encountered this?
EDIT: I should say that I have no Dahua or Amcrest event listeners listed here: https://<ha-ip>/developer-tools/event
.
You should post issues with the custom Dahua integration to RRoller’s Dahua github site.
The auto-generated binary_sensor seems to be missing the “stop” event in your case. I don’t use those sensors and instead trigger only on the button press “start” event, as so:
trigger:
- platform: event
event_type: dahua_event_received # Note: for the core Amcrest integration, specify "Amcrest" here instead
id: doorbell press
event_data:
event: CallNoAnswered
payload:
action: Start
Ah yes–thank you, I’ll do that.
Moved over to the [Dahua] custom via HACS… So nice to have GUI setup…
Call button on my AD110 seems to work great AND it can be configured as a DEVICE with event instead of having to use entities and services directly.
At least so far…
Great post. I was tracing constant “phantom” bandwidth use (approx 35 MB/minute) on the 2.4 ghz spectrum and discovered it was my AD110. Without digging too much deeper, it seems the dchesterton/amcrest2mqtt integration needs to always be looking at the stream to determine state? Anyhow, after a period of turning off that docker container and disabling mqtt (this is the only thing I’m using it for) and then directly calling the motion (binary) sensor state & discovering the CallNoAnswered event to solve all of my problems. It’s great to pull parts of the Rube Goldberg machine out!
I just added an issue to the Git. I had some problems with my Amcrest account and had to re-add my AD410 to the integration. When I did, it was no longer recognized as an AD410 and instead as a generic RTSP camera, so it’s missing the doorbell press sensor.
EDIT: No dahua_event_received
event is fired when the doorbell button is pressed. Also, I noticed another issue on the Git is that another user’s camera was recognized by the integration as a doorbell. So apparently there are some issues here. I’m trying to find a workaround in the meantime, since the reported issues are piling up over there and there doesn’t seem to be a whole lot of support for it.
Try the core Amcrest integration. The event it exposes is “Amcrest” replacing dahua_event_received. Unfortunately this integration is still all Yaml configurations, but it’s pretty straightforward.
I know I’ve tried it before… because I see old commented-out entries in my YAML. I don’t remember why, but I think I stopped using it because the Dahua integration offered the call_no_answered
sensor. Well… now I don’t have that sensor. So maybe the Amcrest integration is the answer in the meantime.
The Amcrest integration continues to reliably return events, including doorbell presses and motion. Currently it has a limited number of auto-generated binary sensors. You will need to trigger on ‘CallNoAnswered’ event for doorbell press. For motion, you should be able to use the ‘crossline_detected’ Binary sensor for human detection, but I haven’t tested it and just trigger on the event instead. Avoid the motion_detected sensor.
Hmm. So far… I’m unable to see a button press on the event bus. I can see the integration created a listener “amcrest.” However, by listening myself to amcrest events and pressing the button… nothing.
I also set up a quick Node-RED flow to check for a CallNoAnswered event_type, and didn’t see that:
[{"id":"143412a240111f99","type":"server-events","z":"b199f89f.aefe08","name":"Amcrest Event","server":"296c0678.b5f9ca","version":2,"eventType":"amcrest","exposeToHomeAssistant":false,"eventData":"","haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"event_type":"","x":500,"y":2820,"wires":[["4c19161c762f6221"]]},{"id":"4c19161c762f6221","type":"switch","z":"b199f89f.aefe08","name":"Doorbell Button Pressed","property":"payload.event.actionName","propertyType":"msg","rules":[{"t":"eq","v":"CallNoAnswered","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":710,"y":2820,"wires":[["2067ae5323a1233e"]]},{"id":"2067ae5323a1233e","type":"debug","z":"b199f89f.aefe08","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":920,"y":2820,"wires":[]},{"id":"296c0678.b5f9ca","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
I think I’ll continue to use the Dahua integration for video & motion detection. That seems to work well. I just need my button presses back.
I assume you have the AD110 model. Did you install the latest new firmware?
If so - that broke events! You need to contact Amcrest Support to have them send you a link to download the previous version.