Open dbs179 opened 2 years ago
I am having the same problem with my AD410. Smart motion detection works, but human detection does not. I do get human detection notifications from the Amcrest Smart Home app.
I am having a similar problem with my AD410 although I'm not receiving any motion detection notifications, smart or human. I am receiving these on the Amcrest app (android phone).
I'm also having this issue with the AD410 - I receive human detection notifications in the Amcrest app but not through the Dahua integration. Regular motion detection is working fine, as are some of the other functions (e.g. security light on/off).
I'm not sure if it is helpful to know but the amcrest2mqtt integration also has the same issue - i.e. no human detection notifications are sent over MQTT. Please let me know if any other info would be helpful.
I had to add crossregion detection and it worked.
Thank you calisro. I deleted, then re-added the integration with crossregion detection selected and human detection is working fine now.
Since this is unstable for AD410, I switched for now to the HA native integration and setup events for button, human, motion and this is now working pretty well for those having trouble. I prefer this integration because it has more features but stability is THE concern. I can't have people ringing the bell with the integration not detecting it and requiring me to restart HA.
Config:
amcrest:
- host: 10.100.1.143
username: admin
password: xxxxxx
name: Front Door Bell
resolution: high
stream_source: rtsp
scan_interval: 15
binary_sensors:
- online
switches:
- privacy_mode
- host: 10.100.1.143
username: admin
password: xxxxxxx
name: Front Door Bell Sub
resolution: low
stream_source: rtsp
scan_interval: 305
Template Triggers:
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: CallNoAnswered
payload:
code: CallNoAnswered
action: Start
- platform: event
event_type: amcrest
id: stop
event_data:
camera: "Front Door Bell"
event: CallNoAnswered
payload:
code: CallNoAnswered
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
data:
Action: Appear
object:
- platform: event
event_type: amcrest
id: stop
event_data:
camera: "Front Door Bell"
event: VideoMotion
payload:
code: VideoMotion
action: Stop
data:
Action: Appear
binary_sensor:
- name: Front Door Bell Motion
icon: mdi:motion
state: >-
{{ 'on' if trigger.id == 'start' else 'off' }}
It has been working very stably for me, since re-integrating. This may be solved?
This may be. But I constantly see a disconnect and then none of hte features work. THis issue:
https://github.com/rroller/dahua/issues/148
Its been rock solid since I moved to the above standard config with events.
Hmm. I wonder what the difference is. That it works for the Amcrest integration seems to rule out a network problem. Are there any clues in the logs about what happens for disconnect? A restart on HA fixing the problem, suggests that something there is crashing.
Theres way too much errors in teh logs. All kinds of parse errors. I think the problem with the integration is really it was built for Dahua and then extended to Amcrest. The json can be slightly different. Now I just use events to decipher my own. It isn't a network issue as the app works fine all the time. and now the inbuilt integration works flawless.
Theres way too much errors in teh logs. All kinds of parse errors. I think the problem with the integration is really it was built for Dahua and then extended to Amcrest. The json can be slightly different. Now I just use events to decipher my own. It isn't a network issue as the app works fine all the time. and now the inbuilt integration works flawless.
Calisro, I was having the same issues as you were. It seemed as if the doorbell would work for the first button press and then crash. I moved to the Home Assistant integration you have, but noticed that the binary sensor status comes back as "unavailable" after an HA restart, unless something triggers them, i.e. the button rings, motion is detected, or a human is detected. I think you can use "is_state" for the binary sensor to prevent it from coming back as unavailable on a restart. I've given it a shot, but can't sort it out. Any chance you might know how to do that?
Are you asking about this sensor in the amcrest integration?
binary_sensors:
- online
Are you asking about this sensor in the amcrest integration?
binary_sensors: - online
Nope, those come back fine, it is the template sensors, Doorbell Motion, Doorbell Human, Doorbell Ring. I have two AD410's. My basement door doesn't get used much, but i put one there for video. Since it doesn't get used much after an HA restart I get unavailable on the template sensors until I go push it and create motion in front of it.
Here is a quote from the HA Template Sensor section about start up, but I don't quit know how to use this with the template sensors you've built out.
Startup
If you are using the state of a platform that might not be available during startup, the Template Sensor may get an unknown state. To avoid this, use is_state() function in your template. For example, you would replace {{ states.switch.source.state == 'on' }} with this equivalent that returns true/false and never gives an unknown result:
{{ is_state('switch.source', 'on') }}
My sensors never come back unavailable. The states are restored on a restart as I am using template event triggers and not the inbuilt sensors that the amcrest integration provides. Are you using the inbuilt sensors? or the ones I pasted above? I had trouble with the inbuilt sensors and really only use the integration to provide the camera feeds and the events.
I am only using these as part of the integration:
binary_sensors:
- online
switches:
- privacy_mode
My sensors never come back unavailable. The states are restored on a restart as I am using template event triggers and not the inbuilt sensors that the amcrest integration provides. Are you using the inbuilt sensors? or the ones I pasted above? I had trouble with the inbuilt sensors and really only use the integration to provide the camera feeds and the events.
I am only using these as part of the integration:
binary_sensors: - online switches: - privacy_mode
Interesting, yes I'm using your code from above. I'll have to mess around with it and see what I can find out. I found it weird they are coming back unavailable as well, as your template looks to set the state to off, but that is what I'm getting. I'll post back if I figure anything out.
EDIT: Seems like I have to trigger each event one time first (I hadn't for the basement) and then they work just fine, even after a restart.
I don't have to do that. It sounds like your sensors aren't restoring their state.
Look at this:
https://community.home-assistant.io/t/template-binary-sensor-unknown-state/420008/21
I think you put the trigger sensors in the legacy config rather than under 'template'? Or you're on an older version of HA.
Regardless, it really shouldn't impact your automations. You can just use 'is_state' and write the automation correctly. If you need help, feel free.
I don't have to do that. It sounds like your sensors aren't restoring their state.
Look at this: https://community.home-assistant.io/t/template-binary-sensor-unknown-state/420008/21
I think you put the trigger sensors in the legacy config rather than under 'template'? Or you're on an older version of HA.
Regardless, it really shouldn't impact your automations. You can just use 'is_state' and write the automation correctly. If you need help, feel free.
I'm using Node Red for automations as much as I can, and you are right it works just fine. I also removed the Motion and Human alarms. I'm using Blue Iris and Deep Stack for those alerts/automations. Thanks for the code!!! I appreciate it.
@calisro This is great, any way to use the amcrest integration to bring in the lights. Both the button ring light, camera light, and infrared light? The Dahua integration brings them in, but for example the status of them are broken - when the schedule in the app turns the lights on it Does Not update the status in the Dahua integration for Both the infrared light and camera light.
The reason this is useful is because the night reflection from the infrared causes a reflection and is annoying. I keep a light on outside to cover the yard, Turn off night vision, and turn on the camera light to provide Night coverage that is acceptable.
The problem I run into. If you simply turn on the camera light with the Dahua integration. It will automatically Turn off and the status will stay on no matter what. If you use the amcrest app to set the schedule it will turn on but not show its on in Dahua and if you turn it on it will then turn off...
Is this still a problem? I started using the amcrest integration too fix the human detention but I have been debating to try this integration again for the extra switches and stuff.
Yea, I'm using the amcrest integration also. I still use Dahua to bring in the light and disable everything else. You get the infrared light control, the light that shines down. The rest I would just say use the amcrest integration for.
@mschingel
The reason this is useful is because the night reflection from the infrared causes a reflection and is annoying.
That NightVision IR glare was due to a manufacturing defect in AD410's sold from about September on. Amcrest has just received a new batch with this defect corrected. You can contact Amcrest to submit a warranty/RMA case to get a new one.
Yeah I had mine replaced in September last year.
On Mon, Feb 6, 2023 at 11:58 AM GaryOkie @.***> wrote:
@mschingel https://github.com/mschingel
The reason this is useful is because the night reflection from the infrared causes a reflection and is annoying.
That NightVision IR glare was due to a manufacturing defect in AD410's sold from about September on. Amcrest has just received a new batch with this defect corrected. You can contact Amcrest to file a warranty/RMA claim to get a new one.
— Reply to this email directly, view it on GitHub https://github.com/rroller/dahua/issues/184#issuecomment-1419410392, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2CAJZZ22ABRRNDYWP2OUZDWWEUSXANCNFSM5S5T3EIA . You are receiving this because you were mentioned.Message ID: @.***>
You were lucky they still had older/good ones in their inventory. The last several weeks they had none and could not replace any AD410's under RMA and could only offer a refund.
I know, I discovered the issue originally. I worked with Eli from level 2 in Housten. We tried like 3 cameras before I actually got a good one.
On Mon, Feb 6, 2023 at 12:45 PM GaryOkie @.***> wrote:
You were lucky they still had older/good ones in their inventory. The last several weeks they had none and could not replace any AD410's under RMA and could only offer a refund.
— Reply to this email directly, view it on GitHub https://github.com/rroller/dahua/issues/184#issuecomment-1419493670, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2CAJZ24LQOGYJSN7MONRLTWWE2ENANCNFSM5S5T3EIA . You are receiving this because you were mentioned.Message ID: @.***>
I have an Amcrest AD410 I'm trying to get alerts on human detection. I've had it working in the past with the docker mqtt2amcrest, but for one reason or another that stopped working for human detection, so I switched to this integration using HACS. I've got motion alerts and button presses working just fine, but for whatever reason, I can't get human detection working. The human detection notifications come in on my phone through the Amcrest Smart Home app, but it never updates in Home Assistant.
I've tried completely resetting the Door Bell and setting up from scratch, removing both the Dahua and mqtt2amcrest integrations from Home Assistant and setting those up fresh as well. No matter what I've tried I can't get the human detection to work. Regular motion detection works just as it should though.
Any help would be greatly appreciated.