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

Adding support for SMART_DETECT_LINE events #162

Merged
merged 4 commits into from
Oct 26, 2024

Conversation

jimmydoh
Copy link
Contributor

@jimmydoh jimmydoh commented Sep 13, 2024

Adjusting the types to include support for SMART_DETECT_LINE.

Closes #69

Could similarly add support for Audio detections, Smart Detect animals, etc. in the future but the DETECTION_TYPES parameter could become unwieldly.

Tested with:
Python 3.12.6
UnifiOS 4.0.6
Protect 4.1.53

NOTE: This will often result in duplicate or very similar events being uploaded as Protect can trigger as both a Smart Detect Zone and Smart Detect Line event at the same time, depending on your settings.

e.g. a Person crosses a Line and there is also an active Smart Detect Zone setup at the same location.

@jimmydoh jimmydoh closed this Sep 13, 2024
@jimmydoh
Copy link
Contributor Author

jimmydoh commented Sep 13, 2024

Requires patching of the uiprotect library first - currently does not get returned as a Device event (event.type.value in EventType.device_events_set()).

Confirmed a patch to uiprotect will result in LINE detections working with this adjustment. Will reopen the pull request if I can get the change done on uiprotect.

@ep1cman
Copy link
Owner

ep1cman commented Sep 13, 2024

Thanks for this! Its been a long lingering to do so it will be great to get that closed off

@JonLaliberte
Copy link
Contributor

Looks like this was added in v6.1.0 of the uiprotect library. Can this be merged into unifi-protect-backup now?

@ep1cman ep1cman reopened this Oct 11, 2024
@ep1cman
Copy link
Owner

ep1cman commented Oct 11, 2024

I've reopened this pull request. Are you able to also bump the version of ui protect used as part of this or?

Unifi Protect has started to return events that have not ended. These are now explicitly filtered out
@ep1cman ep1cman merged commit c067dbd into ep1cman:main Oct 26, 2024
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

Successfully merging this pull request may close these issues.

Add support for line crossing events
3 participants