@tomw, and anyone else who hit this:
After a recent platform update, saving the UniFi Protect Controller driver fails here with:
Error: Expression [MethodPointerExpression] is not allowed: this.delegate.&httpPatch at line number 598
Cause: The sandbox now blocks Groovy's method-pointer operator (.&). httpExec() in the controller used it for httpGet, httpPost and httpPatch. Every call to the UniFi controller goes through that function, so the driver can't be saved or installed, and the child drivers can't talk to it.
Fix: Call httpGet, httpPost and httpPatch directly in the switch instead of going through a pointer. It's a 4-line change in one function, and behavior is otherwise identical.
Status: I tested it on platform 2.5.2.127. The controller now saves without the error and works for me. [Add anything else you've confirmed, e.g. motion events, light control.]
Where to get it:
I also opened a separate PR with three small, optional cleanups in the Camera, Chime and Light drivers: tomwpublic/hubitat_unifiProtect#30 · Small cleanups in Camera, Chime…. The controller fix doesn't depend on them. They're also in my fork's main if you want them.
If you run this driver, please say how it goes on your firmware.
Thanks, tomw, for the driver. It's been great to have.
Update, with a second fix for the Camera driver
Two updates since the first post.
1. The controller save error should go away on its own.
tomw checked with Hubitat staff. The blocked method was intentional, but they plan to allow it again, and the change is expected in an upcoming beta and then in a release for everyone. tomw isn't merging the controller change for that reason. Until your hub gets that update, the fix in this thread still works, and I'm leaving the PR open for anyone who needs it:
tomwpublic/hubitat_unifiProtect#29
2. Person and face detections can stop updating (Camera driver).
If smartDetectType stopped changing to person or face on your cameras while motion still works, this may be why. Newer Protect versions can send metadata.detectedAreas on every smart-detect event, including as an empty list. The stock 1.4.8 Camera driver ignores any event that has that field, so every person and face event gets dropped. Motion and other events aren't affected, which makes it easy to miss.
I changed the Camera driver to keep track of which detection types it has already reported for each event id, instead of dropping anything with detectedAreas. It gives one smartDetectType event per detection, and person and face detections work again on my hub (platform 2.5.2.127).
How to tell if you're affected: if you have the Camera driver and person or face never show in smartDetectType (check the Events tab on a camera device), you likely are. If it already works for you, you don't need this.
Caveats: I tested on one setup, and I haven't confirmed every duplicate-event case that 1.4.8 was written for. If you try it, tell me how it goes on your hardware and Protect version.
My fork's main also includes the controller fix and a few small cleanups. If you only want one driver, import just that one. Don't mix drivers from different branches.