Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amcrest AD410 Human Detection Not Working #184

Open
dbs179 opened this issue Apr 8, 2022 · 24 comments
Open

Amcrest AD410 Human Detection Not Working #184

dbs179 opened this issue Apr 8, 2022 · 24 comments

Comments

@dbs179
Copy link

dbs179 commented Apr 8, 2022

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.

@creeve4
Copy link

creeve4 commented Apr 9, 2022

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.

@ingrove
Copy link

ingrove commented Apr 10, 2022

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).

@ChrisParsons
Copy link

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.

@calisro
Copy link

calisro commented May 8, 2022

I had to add crossregion detection and it worked.

@ingrove
Copy link

ingrove commented May 9, 2022

Thank you calisro. I deleted, then re-added the integration with crossregion detection selected and human detection is working fine now.

@calisro
Copy link

calisro commented May 12, 2022

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' }}

@jds11111
Copy link

jds11111 commented Jun 5, 2022

It has been working very stably for me, since re-integrating. This may be solved?

@calisro
Copy link

calisro commented Jun 5, 2022

This may be. But I constantly see a disconnect and then none of hte features work. THis issue:

#148

Its been rock solid since I moved to the above standard config with events.

@jds11111
Copy link

jds11111 commented Jun 6, 2022

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.

@calisro
Copy link

calisro commented Jun 6, 2022

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.

@dbs179
Copy link
Author

dbs179 commented Jun 16, 2022

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?

@calisro
Copy link

calisro commented Jun 16, 2022

Are you asking about this sensor in the amcrest integration?

    binary_sensors:
      - online

@dbs179
Copy link
Author

dbs179 commented Jun 16, 2022

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') }}

@calisro
Copy link

calisro commented Jun 16, 2022

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

@dbs179
Copy link
Author

dbs179 commented Jun 16, 2022

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.

@calisro
Copy link

calisro commented Jun 16, 2022

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.

@dbs179
Copy link
Author

dbs179 commented Jun 16, 2022

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.

@mschingel
Copy link

@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...

@towerhand
Copy link

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.

@mschingel
Copy link

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.

@GaryOkie
Copy link

GaryOkie commented Feb 6, 2023

@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.

@mschingel
Copy link

mschingel commented Feb 6, 2023 via email

@GaryOkie
Copy link

GaryOkie commented Feb 6, 2023

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.

@mschingel
Copy link

mschingel commented Feb 6, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants