Detections are identified as generic "Motion" rather than "Person"/"Vehicle" in unifi-protect #375
zzzbatmand
started this conversation in
Show and tell
Replies: 1 comment
-
This solution also works for uifi-protect v4.0.33, but the code has changed so the following needs to be updated. Find this code: if(i.recordingMode===d.RECORDING_MODES.NEVER)return void v.verbose(`${i.logId} current recording mode is "never", skip to save this smartDetect event`);i.updateAndSave({isSmartDetected:!0});const S={type:o,cameraId:i.pk,start:g,smartDetectTypes:[] And replace it with this: (Only the start and end is changed) const detectTypes=Array.isArray(s.objectTypes)?s.objectTypes:[];if(i.recordingMode===d.RECORDING_MODES.NEVER)return void v.verbose(`${i.logId} current recording mode is "never", skip to save this smartDetect event`);i.updateAndSave({isSmartDetected:!0});const S={type:o,cameraId:i.pk,start:g,smartDetectTypes:detectTypes |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
I have made a few discoveries these past couple of days, and have decided to share them with the community.
I will be splitting them up in different discussions, please tell me if I should merge them.
Problem
There are currently some issues with unifi-protect v4 and u-c-p #372 so I use v3.0.26 instead.
But apparently events in v3.0.26 show up as generic "Motion" instead of what actually is sent from u-c-p.
I have tested with older versions and found that even back to v2.11.21 also has this issue.
I have these few days read through a lot of logs, as well as the source code for unifi-protect and have found the issue.
It appears that the "objectTypes" is never read by unifi-protect.
This is the detection event in both v2 and v3 of unifi-protect:
As show "smartDetectTypes" is ALWAYS an empty array, and therefore never updated correctly.
Solution
This can be fixed, by manually patching the unifi-protect source at "/usr/share/unifi-protect/app/service.js"
The file is minified so a steady hand is needed for this.
Find the following code:
And replace it with the following:
Save and close the file, then restart the unifi-protect from the web interface. (Just stop and start unifi-protect)
Beta Was this translation helpful? Give feedback.
All reactions