rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
396 stars 80 forks source link

With Amcrest AD410 human detection not tripping entity but event appears to be received #137

Closed calisro closed 2 years ago

calisro commented 2 years ago

Version of the custom_component

0.9.32

Configuration

I'm not sure what to add here since this was a HACS install and the config was auto-generated. Where can I capture this?

Describe the bug

I have Human detection enabled and motion detection off (doesn't seem to matter if this is on as well). In the Amcrest app, I see the 'human detected' notification. When I listen for the event on the HA bus, I see the event came in, but the binary_entity "binary_sensor.front_doorbell_smart_motion_human" does not trip with that event data. Below is the event received. If I look at the history of that binary sensor, I have 'never' seen it tripped through all the human detected notifications. REgular motion events seem to work just fine its only the human detection.

Debug log

{
    "event_type": "dahua_event_received",
    "data": {
        "Action": "Stop",
        "Code": "CrossRegionDetection",
        "Data": {
            "Action": "Appear",
            "CfgRuleId": 1,
            "Class": "Normal",
            "CountInGroup": 0,
            "DetectRegion": [
                [
                    0,
                    0
                ],
                [
                    0,
                    4093
                ],
                [
                    0,
                    8191
                ],
                [
                    8191,
                    8191
                ],
                [
                    8191,
                    4093
                ],
                [
                    8191,
                    0
                ]
            ],
            "EventID": 10033,
            "EventSeq": 12,
            "FrameSequence": 493916,
            "GroupID": 12,
            "LocaleTime": "2022-01-07 07:28:06",
            "Mark": 0,
            "Name": "IVS-1",
            "Object": {
                "Action": "Appear",
                "Age": 0,
                "Angle": 0,
                "Bag": 0,
                "BagType": 0,
                "BoundingBox": [
                    2848,
                    2480,
                    4144,
                    7824
                ],
                "CarrierBag": 0,
                "Center": [
                    3496,
                    5152
                ],
                "Confidence": 0,
                "DownClothes": 0,
                "Express": 0,
                "FaceFlag": 0,
                "FaceRect": [
                    0,
                    0,
                    0,
                    0
                ],
                "FrameSequence": 493916,
                "Gender": 0,
                "Glass": 0,
                "HairStyle": 0,
                "HasHat": 0,
                "Helmet": 0,
                "HumanRect": [
                    0,
                    0,
                    0,
                    0
                ],
                "LowerBodyColor": [
                    0,
                    0,
                    0,
                    0
                ],
                "MainColor": [
                    0,
                    0,
                    0,
                    0
                ],
                "MessengerBag": 0,
                "ObjectID": 204,
                "ObjectType": "Human",
                "Phone": 0,
                "RelativeID": 0,
                "SerialUUID": "",
                "ShoulderBag": 0,
                "Source": 0,
                "Speed": 0,
                "SpeedTypeInternal": 0,
                "Umbrella": 0,
                "UpClothes": 0,
                "UpperBodyColor": [
                    0,
                    0,
                    0,
                    0
                ],
                "UpperPattern": 0
            },
            "PTS": 43016564750,
            "Priority": 0,
            "RuleID": 1,
            "RuleId": 1,
            "Source": -1,
            "Track": [],
            "UTC": 1641540454,
            "UTCMS": 295
        },
        "Index": 0,
        "deviceType": "AD410",
        "serialNumber": "Z177F78A1BBFC",
        "DeviceName": "Front Doorbell"
    },
    "origin": "LOCAL",
    "time_fired": "2022-01-07T12:28:06.664128+00:00",
    "context": {
        "id": "a2e9f59040006836087b9a8fd34fb3a1",
        "parent_id": null,
        "user_id": null
    }
}
calisro commented 2 years ago

I figured it out. I needed to enable the 'CrossRegionDetection' event when I set it up and not the human motion is firing. Hope this helps someone else out.

calisro commented 2 years ago

I sent a note to this guy as hewas the video I followed and his setup is wrong. Thanks for the integration!!

https://www.youtube.com/watch?v=Hz2kKYjhC8I