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
Smart Motion events not arriving with Dahua IP cam #166
Comments
Wow, thank you for the very details logs/examples! I'm going to look into this now... |
I might have an idea of what's going on, maybe, but it's hard to confirm. It's possible that the event parsing isn't that great and if more than 1 event arrives in a single message, only the first one is processed. I have some better event handling code I've just written that I've tested and verified works when it receives more than 1 event. I'll let you know when I release the code... should be today. |
I released https://github.com/rroller/dahua/releases/tag/0.9.39 Can you give it a try? |
I'll try it first thing tomorrow morning (in about 7 hours or so). Thank you for your fast response! |
I updated to I recorded a little over a minute of a camera where there is some movement and near the end a cars enters and leaves the frame. It is picked up by the stream directly from the camera, but not present as a HA core log:
HA event listener recorded 7 events (in reverse order):
Direct camera stream:
|
Thanks. When you run the command locally with curl, you are using |
BTW, you can try this locally.. Change |
Your code change won't work...
Needs to be like this...
|
Ah, I completely read over that. :| |
Hmm.
# codes = "[All]"
url = "{0}/cgi-bin/eventManager.cgi?action=attach&codes=[All]&heartbeat=5".format(self._base) I'm getting better results in HA: HA core log:
Camera stream:
HA event log!:
I'm going to try and see whether I can reproduce it with another camera. |
I could reproduce it with: # Use codes=[All] for all codes
# codes = ",".join(events)
url = "{0}/cgi-bin/eventManager.cgi?action=attach&codes=[All]&heartbeat=5".format(self._base)
Camera stream:
Going to revert to |
Could also reproduce the intended behavior on
|
Sorry, what was the thing you did to get it working? |
The HA event listener is outputting |
Great! But did you have to change anything to get it working? Or does it just work with 0.9.39 without any changes? |
This looks like it worked normally, event with my error:
|
Sorry, I'm not following. Do you need any changes from me? Or is it jus working now? |
It just works...
No, it looks like |
Nice, so maybe the better event parsing in 0.9.39 worked. |
Thanks for your work. I'll open a new linked issue if anything new arises. |
Hi Ronnie, thanks for your work on the integration!
I'm having some issues receiving SMD events from my Dahua cameras.
I'm using a Dahua
IPC-HDW5442TP-ZE-2712
, firmware:2.820.15OG001.0.R,build:2021-05-25
. Integration version0.9.38
. HA2022.2.9
.Enabled entities in HA:
When I query a camera's API directly, I see smart motion events:
Using the event listener in HA, I only get generic
VideoMotion
events (instead of codeSmartMotionVehicle
, see DAHUA_HTTP_API_V2.76 page 83):Debug logs:
So the
binary_sensor.front_yard_smart_motion_human
andbinary_sensor.front_yard_smart_motion_vehicle
sensors remain quiet, while the genericbinary_sensor.front_yard_motion_alarm_2
does respond to generic motion events.The text was updated successfully, but these errors were encountered: