-
Notifications
You must be signed in to change notification settings - Fork 89
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: Failed to read data and goes goes offline #148
Comments
I am experiencing the same error(?). Started after lasted upgrade of Home Assistant. Occurs once per hour. Thanks. 2022-01-24 18:43:26 ERROR (Thread-4) [custom_components.dahua] Failed to read data: b' \x00\x00\x00DHIPl]\xbdi\x08\x00\x00\x00\xe3\x04\x00\x00\x00\x00\x00\x00\xe3\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Stop","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[2338.351948699059,3869.337464522073],[66.66072136059142,3994.116611940465],[73.66132867824264,8189.818548146599],[8191,8191],[8191,4000],[7438.281406045658,3705.564706311552]],"EventID":10001,"EventSeq":0,"FrameSequence":265275,"GroupID":0,"LocaleTime":"2022-01-24 18:43:26","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[6696,3800,7176,4824],"CarrierBag":0,"Center":[6936,4312],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":265275,"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":20,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"So', error: substring not found, Line: 348 |
I'm actually also seeing others whichI don't know if I should include in this issue or not but i'll add them here and if you want a new issue, I can move them. This seems like a timeout. I would think this just retries?
After the above timeout, I see this which is most likely related but again I hope this retries.
Then I received the 'failed to read data' at some point after but it may be a completely different issue and likely unrelated:
I setup a ping monitor in HA to understand if the device is having connection issues but in the past 24 hours, there were zero issues. Signal is strong. After some time, I find my bell and motion is no longer alerting HA and I have a job to restart the integration to get it fixed up again. |
Another comment. When the errors appear above, the integration motion detection and doorbell presses are non-functional. I need to restart the integration to get it working again.
|
For others experiencing this, this is now what I've added to an automation to restart it. configuration.yaml:
automation:
|
Are you on the latest version of the integration? |
Sorry, I see that you are. 0.9.34 I'm going to see if I can reproduce this. Thanks for the report. |
I was able to reproduce this and found the bug with the parsing of the AD410 events. It's fixed in |
That didn't seem to fully fix this issue. I'm still digging in. |
I've made some better handling of the event data in https://github.com/rroller/dahua/releases/tag/0.9.37 I thought I could reproduce this issue, but I can't. I let mine run for days :/ |
I'll install the latest, stop by auto-restarting automation and see if I can capture something. |
This is still happening to me. At some point motion detection stops, the ringing of the bell stops alerting and functioning and I see these errors in the logs.
All seems well for like hours.
Note the 'keep alives' still function. But on events like human detection or dellbell, it spits the errors. Once this happens, I can simply restart the integration and it works perfectly again until it stops. Note the camera itself is always accessible.
|
I actually wonder if part of the issue here is that we're not enabling all the events the AD410 requires. I can see in the list of events that most are available not no one knows what to select for a particular device. Such as 'BackKeyLight, IntelliFrame, CallNoAnswered are called out above. I deleted the integration today and selected ALL events. Yes that leaves quite a bit of useless entities but I'm going to see what errors I receive now. I assume quite a bit of the noise above will go away but more importantly, I wonder if it will stabilize the integration. I see no way to actually 'know' which ones are important. |
I'm seeing far less errors in the logs. Today it stopped detecting motion and these are the events in my logs:
The doorbell button is still functioning just fine but person motion isn't. |
I'm experiencing the same. It seems the second message it receives is not correct json. It seems to be missing the last '}' ? |
I am getting this 2022-04-18 17:26:03 DEBUG (Thread-336) [custom_components.dahua] Event data 192.168.1.110: 'b' \x00\x00\x00DHIP\xe2\xfe\xff\x7f\x08\x00\x00\x00\x0f\x01\x00\x00\x00\x00\x00\x00\x0f\x01\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Stop","Code":"APConnect","Data":{"Error":"SSIDNotValid","LocaleTime":"2022-04-18 17:26:03","Result":false,"Type":"Timerconnect","UTC":1650291963.0},"Index":0}]},"session":2147483362}\n'' |
This continues to be an issue and makes it VERY unreliable. There is no way to tell that the doorbell push and human detection is no longer working without pushing it. I am finding even re-loading the integtation doesn't fix it. Rebooting HA does though which is interesting. |
Posted this to the wrong issue before. Incase you need it here: 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:
Template Triggers:
|
I'm also getting this:
and:
|
Can you please try the latest version 0.9.43? I added a better JSON extractor that will handle extracting multiple JSON elements from a string and handle multi line elements |
Version of the custom_component
Dahua version 0.9.34 on HACS 1.18.0
Configuration
I do not have a configuration as it was done through the integration. It should be noted that I did enable the 'cross region detection' because without it enabled, motion detection didn't work until it was enabled. When I was listening for events, I did noticed that it seemed required.
Describe the bug
I am seeing errors appear in my home assistant log related to teh following:
Logger: custom_components.dahua
Source: custom_components/dahua/vto.py:355
Integration: Dahua (documentation, issues)
First occurred: 4:39:16 PM (1 occurrences)
Last logged: 4:39:16 PM
Debug log
The text was updated successfully, but these errors were encountered: