provision_camera
provision_camera
Section titled “provision_camera”Configure a camera end-to-end: recording mode + sensitivity + privacy.
Side effects:
- Step 1: PATCHes
recordingSettings.modeandrecordingSettings.retentionDurationMs(computed fromretention_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_backandpartialkeys describing what was applied and what was reverted.
Example
Section titled “Example”provision_camera(camera_id="65f...", recording_mode="motion", sensitivity=60, retention_days=14)Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
camera_id | string | yes | — | Protect camera id. |
recording_mode | string | no | ”motion” | One of "always", "motion", "never". Defaults to "motion". |
sensitivity | integer | no | 50 | Motion sensitivity 0-100. Defaults to 50. |
retention_days | integer | no | 7 | Clip retention in days. Multiplied by 86,400,000 to derive retentionDurationMs. Defaults to 7. |
privacy_enabled | boolean | no | false | True engages the privacy mask after the recording / sensitivity steps. Defaults to False. |
controller | string | no | ”default” | Name of the UniFi controller to target. Defaults to "default". |
dry_run | boolean | no | false | Preview the change without applying it. Returns the predicted change set. |