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

Events not triggered if too many are selected #171

Open
dcro opened this issue Mar 2, 2022 · 2 comments
Open

Events not triggered if too many are selected #171

dcro opened this issue Mar 2, 2022 · 2 comments

Comments

@dcro
Copy link

dcro commented Mar 2, 2022

I have a IPC-5442T-ZE camera and I noticed that some events are never triggered in home assistant (listening for dahua_event_received), for example the ParkingDetection event. The camera is running the latest available firmware.

After a bit of testing with my camera's event stream in /cgi-bin/eventManager.cgi what I noticed is that when the list of events specified in codes[] is too long, the camera's firmware will simply trim it and only trigger some of the events (it seems to trim at around 100 chars).

For example this works to trigger ParkingDetection:

/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,CrossLineDetection,VideoBlind,CrossRegionDetection,SmartMotionHuman,ParkingDetection,SmartMotionVehicle]&heartbeat=5

while this doesn't work:

/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,CrossLineDetection,VideoBlind,CrossRegionDetection,SmartMotionHuman,SmartMotionVehicle,ParkingDetection]&heartbeat=5

I think it would be better to always listen for codes=[All] in client.py instead of using a specified list of events or at least give users the option to select All as one of the options when defining the list of events for the plug-in.

@mooton85
Copy link

mooton85 commented Mar 8, 2022

You could try what is suggested in this thread by tweaking the client.py file. I have done it and although it has not fixed my issues, it doesn't appear to of broken anything either so may well work in normal circumstances.

@dcro
Copy link
Author

dcro commented Apr 4, 2022

@mooton85 Thank you for the suggestion, I applied the same change to client.py and it works great for me as well.

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