diff --git a/frigate/camera/state.py b/frigate/camera/state.py index 181532fa8..eccdc41e8 100644 --- a/frigate/camera/state.py +++ b/frigate/camera/state.py @@ -197,6 +197,10 @@ class CameraState: if draw_options.get("zones"): for name, zone in self.camera_config.zones.items(): + # skip disabled zones + if not zone.enabled: + continue + thickness = ( 8 if any( diff --git a/frigate/config/camera/zone.py b/frigate/config/camera/zone.py index 1ee25d4b6..fdcac76af 100644 --- a/frigate/config/camera/zone.py +++ b/frigate/config/camera/zone.py @@ -18,6 +18,10 @@ class ZoneConfig(BaseModel): title="Zone name", description="A user-friendly name for the zone, displayed in the Frigate UI. If not set, a formatted version of the zone name will be used.", ) + enabled: bool = Field( + default=True, + title="Whether this zone is active. Disabled zones are ignored at runtime.", + ) filters: dict[str, FilterConfig] = Field( default_factory=dict, title="Zone filters", diff --git a/frigate/track/tracked_object.py b/frigate/track/tracked_object.py index f435de7b6..c4398dec6 100644 --- a/frigate/track/tracked_object.py +++ b/frigate/track/tracked_object.py @@ -188,6 +188,10 @@ class TrackedObject: # check each zone for name, zone in self.camera_config.zones.items(): + # skip disabled zones + if not zone.enabled: + continue + # if the zone is not for this object type, skip if len(zone.objects) > 0 and obj_data["label"] not in zone.objects: continue