Skip to content

provision_camera

Configure a camera end-to-end: recording mode + sensitivity + privacy.

Side effects:

  • Step 1: PATCHes recordingSettings.mode and recordingSettings.retentionDurationMs (computed from retention_days * 86400000).
  • Step 2: PATCHes motionSettings.sensitivity.
  • Step 3: PATCHes privacyMask.enabled.
  • Mutates controller state. Use dry_run=True to preview the change without applying.
  • Rollback: if step 2 or step 3 fails, the camera’s original recording, sensitivity, and privacy settings are restored from the pre-call snapshot. The response includes rolled_back and partial keys describing what was applied and what was reverted.
provision_camera(camera_id="65f...", recording_mode="motion", sensitivity=60, retention_days=14)
ParameterTypeRequiredDefaultDescription
camera_idstringyesProtect camera id.
recording_modestringno”motion”One of "always", "motion", "never". Defaults to "motion".
sensitivityintegerno50Motion sensitivity 0-100. Defaults to 50.
retention_daysintegerno7Clip retention in days. Multiplied by 86,400,000 to derive retentionDurationMs. Defaults to 7.
privacy_enabledbooleannofalseTrue engages the privacy mask after the recording / sensitivity steps. Defaults to False.
controllerstringno”default”Name of the UniFi controller to target. Defaults to "default".
dry_runbooleannofalsePreview the change without applying it. Returns the predicted change set.