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

AD410 Smart Human Detection no longer working #129

Closed
davidbrenner1 opened this issue Dec 30, 2021 · 16 comments
Closed

AD410 Smart Human Detection no longer working #129

davidbrenner1 opened this issue Dec 30, 2021 · 16 comments

Comments

@davidbrenner1
Copy link

Prior to the latest release Smart Human Detection worked. After the update to 0.9.30 this sensor seems to have been broken. The Amcrest app is still reporting Human Detected. At the same timestamp in the HA 2 errors are present in the logs.

Version of the custom_component

0.9.30
-->

Add your logs here.

This error originated from a custom integration.

Logger: custom_components.dahua
Source: custom_components/dahua/vto.py:393
Integration: Dahua (documentation, issues)
First occurred: 3:48:58 PM (6 occurrences)
Last logged: 3:56:43 PM

Failed to read data: b' \x00\x00\x00DHIP\xb2\\xf1H\x08\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[3102,2891],[0,1644],[0,8191],[4581,8191],[5428,4061],[4744,3334]],"EventID":10257,"EventSeq":60,"FrameSequence":8740172,"GroupID":60,"LocaleTime":"2021-12-30 15:48:58","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[1336,1608,4280,8072],"CarrierBag":0,"Center":[2808,4840],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":8740172,"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":422,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"Source":0.0,"Speed":0,"SpeedTypeInternal":0,"Umbrella":0,"UpClothes":0,"UpperBodyColor":[0,0,0,0],"UpperPattern":0},"PTS":44351293340.0,"Priority":0,"RuleID":1,"RuleId":1,"Source":-1.0,"Track":[],"UTC":1640879337,"UTCMS":156},"Index":0}]},"session":1223777458}\n', error: substring not found, Line: 385
Failed to read data: b' \x00\x00\x00DHIP\x900[Y\x08\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[3102,2891],[0,1644],[0,8191],[4581,8191],[5428,4061],[4744,3334]],"EventID":10259,"EventSeq":62,"FrameSequence":8741658,"GroupID":62,"LocaleTime":"2021-12-30 15:53:29","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[4416,3784,4928,5800],"CarrierBag":0,"Center":[4672,4792],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":8741658,"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":424,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"Source":0.0,"Speed":0,"SpeedTypeInternal":0,"Umbrella":0,"UpClothes":0,"UpperBodyColor":[0,0,0,0],"UpperPattern":0},"PTS":44351564250.0,"Priority":0,"RuleID":1,"RuleId":1,"Source":-1.0,"Track":[],"UTC":1640879607,"UTCMS":276},"Index":0}]},"session":1499148432}\n', error: substring not found, Line: 385
Failed to read data: b' \x00\x00\x00DHIP\xb2\\xf1H\x08\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[3102,2891],[0,1644],[0,8191],[4581,8191],[5428,4061],[4744,3334]],"EventID":10259,"EventSeq":62,"FrameSequence":8741658,"GroupID":62,"LocaleTime":"2021-12-30 15:53:29","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[4416,3784,4928,5800],"CarrierBag":0,"Center":[4672,4792],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":8741658,"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":424,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"Source":0.0,"Speed":0,"SpeedTypeInternal":0,"Umbrella":0,"UpClothes":0,"UpperBodyColor":[0,0,0,0],"UpperPattern":0},"PTS":44351564250.0,"Priority":0,"RuleID":1,"RuleId":1,"Source":-1.0,"Track":[],"UTC":1640879607,"UTCMS":276},"Index":0}]},"session":1223777458}\n', error: substring not found, Line: 385
Failed to read data: b' \x00\x00\x00DHIP\x900[Y\x08\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[3102,2891],[0,1644],[0,8191],[4581,8191],[5428,4061],[4744,3334]],"EventID":10263,"EventSeq":66,"FrameSequence":8742602,"GroupID":66,"LocaleTime":"2021-12-30 15:56:43","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[4496,3784,5088,5784],"CarrierBag":0,"Center":[4792,4784],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":8742602,"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":434,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"Source":0.0,"Speed":0,"SpeedTypeInternal":0,"Umbrella":0,"UpClothes":0,"UpperBodyColor":[0,0,0,0],"UpperPattern":0},"PTS":44351752040.0,"Priority":0,"RuleID":1,"RuleId":1,"Source":-1.0,"Track":[],"UTC":1640879795,"UTCMS":461},"Index":0}]},"session":1499148432}\n', error: substring not found, Line: 385
Failed to read data: b' \x00\x00\x00DHIP\xb2\\xf1H\x08\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[3102,2891],[0,1644],[0,8191],[4581,8191],[5428,4061],[4744,3334]],"EventID":10263,"EventSeq":66,"FrameSequence":8742602,"GroupID":66,"LocaleTime":"2021-12-30 15:56:43","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[4496,3784,5088,5784],"CarrierBag":0,"Center":[4792,4784],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":8742602,"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":434,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"Source":0.0,"Speed":0,"SpeedTypeInternal":0,"Umbrella":0,"UpClothes":0,"UpperBodyColor":[0,0,0,0],"UpperPattern":0},"PTS":44351752040.0,"Priority":0,"RuleID":1,"RuleId":1,"Source":-1.0,"Track":[],"UTC":1640879795,"UTCMS":461},"Index":0}]},"session":1223777458}\n', error: substring not found, Line: 385

and

This error originated from a custom integration.

Logger: custom_components.dahua
Source: custom_components/dahua/vto.py:105
Integration: Dahua (documentation, issues)
First occurred: 3:48:58 PM (6 occurrences)
Last logged: 3:56:43 PM

Failed to handle message, error: 'NoneType' object has no attribute 'get', Line: 97

Describe the bug

Smart Human Detection no longer works on the AD410 while it is still working in the Amcrest Smartphone App. At the same timestamp that a human is present the errors above are generated.

@davidbrenner1
Copy link
Author

davidbrenner1 commented Dec 30, 2021

I did remove the integration and re-added it, restarted the system multiple times, etc. Tried 4 releases back and it worked again.

@rroller
Copy link
Owner

rroller commented Dec 31, 2021

Thanks for reporting. I'll dig into this.

@rroller
Copy link
Owner

rroller commented Dec 31, 2021

According to the log you posted I assume message is null. I'll try to guard against that. But so far I can't reproduce this :/

message = self.parse_response(data)
message_id = message.get("id")

@davidbrenner1
Copy link
Author

davidbrenner1 commented Dec 31, 2021 via email

@rroller
Copy link
Owner

rroller commented Dec 31, 2021

I can't repro the error message but I am getting delayed human motion detection. I'll keep digging...

@davidbrenner1
Copy link
Author

davidbrenner1 commented Dec 31, 2021 via email

@rroller
Copy link
Owner

rroller commented Dec 31, 2021

So far what I've noticed is that I'm not getting the smart human start event. But I do get the smart human stop event. Still digging...

@davidbrenner1
Copy link
Author

davidbrenner1 commented Dec 31, 2021 via email

@rroller
Copy link
Owner

rroller commented Dec 31, 2021

what's the exact version that works for you? I'll go through the commits to see if there's a bug in one of them

@davidbrenner1
Copy link
Author

davidbrenner1 commented Dec 31, 2021 via email

@rroller
Copy link
Owner

rroller commented Dec 31, 2021

I don't think it's working on 0.9.26 either. It works after you first start up HA, but after 1 or 2 detections it'll stop detecting humans (I don't see the events coming from the doorbell even though the app itself gets the notification).

@rroller
Copy link
Owner

rroller commented Jan 1, 2022

Update: I'm getting close to solving this... I hope to having something tonight.

@rroller
Copy link
Owner

rroller commented Jan 1, 2022

Fix is released in https://github.com/rroller/dahua/releases/tag/0.9.31

@davidbrenner1
Copy link
Author

davidbrenner1 commented Jan 1, 2022 via email

@davidbrenner1
Copy link
Author

davidbrenner1 commented Jan 1, 2022 via email

@rroller
Copy link
Owner

rroller commented Jan 1, 2022

2d3807c

In short, multiple events were returned from the camera and only one was being processed, causing some events to be skipped. Now it handles them all :)

@rroller rroller closed this as completed Jan 1, 2022
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

2 participants