Custom Privacy Zones Handling in Unifi Protect Integration

Feature request for UniFi Protect integration. Currently the integration sets a privacy zone named ‘pyufp_privacy_zone’ with 100% custom zone coverage and disables a few camera features like volume, recording, and detentions. I propose a new function that collects and stores the privacy zones in the list of zones associated with the specific camera being called and creates a toggle for the custom zone in Home Assistant so it can be activated by an automation. Only custom privacy zone toggle would be needed; no other parts associated with the ‘privacy mode’ function such as motion detection, volume, recording mode, etc., would be required and because it grabs the current zones from the list you wouldn’t need to build a UI to make zones in home assistant (Just use the one in Unifi Protect web interface). This feature would help out in situations were you don’t want to disable the whole camera from being recorded.
Concept Image:

I understand that the lack of a native “disable” function for privacy zones in UniFi Protect is problematic. The lowest effort way of handling this would be to use the UniFi web interface to configure the zones, then use a button in Home Assistant to “update” the camera zone configuration in a YAML file via your pyunifiprotect library. This file would serve as the hardcoded coordinates to remove and re-add the associated privacy zones in UniFi when toggling the privacy switch on and off. It’s a bit crude, I know but for my use case it would work. I have reached the stage where I can fetch the privacy zone configurations using your library, but I noticed that your “set_privacy” call seems to lack an argument for custom coordinate values. From what I can see in your “create_privacy_zone” function, the points are currently hardcoded.

Yeah, I’d be interested in this as well. Don’t want it recording when I am home.