---
title: "Patch sensor settings"
method: PATCH
path: "/v1/sensors/{id}"
tags: ["Sensor information & management"]
---

# Patch sensor settings

`PATCH /v1/sensors/{id}`

## Request

- Base URL: `https://api.ui.com/v1/connector/consoles/942A6FF664C0000000000964970E0000000009E710560000000068A9873F:9999999999/proxy/protect/integration`
- URL: `https://api.ui.com/v1/connector/consoles/942A6FF664C0000000000964970E0000000009E710560000000068A9873F:9999999999/proxy/protect/integration/v1/sensors/{id}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/ubiquiti/apis/unifi-protect-api/docs/v1/sensors/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Patch the settings for a specific sensor

## Path parameters

- `id` string, required: The primary key of sensor

## Request body

- object
  - `name` string: The name of the device.
  - `lightSettings` LightSettings: Ambient light sensor settings.
    - `isEnabled` boolean: Enable ambient light sensor.
    - `margin` number: Ambient light threshold detection hysteresis margin (Lux). Read-only value decided by sensor implementation.
    - `lowThreshold` number, nullable: Ambient light interrupt threshold low level from 1 to 503192 (Lux).
    - `highThreshold` number, nullable: Ambient light interrupt threshold high level from 1 to 503192 (Lux).
  - `humiditySettings` HumiditySettings: Relative humidity sensor settings.
    - `isEnabled` boolean: Enable relative humidity sensor.
    - `margin` number: Humidity threshold detection hysteresis margin (%). Read-only value decided by sensor implementation.
    - `lowThreshold` number, nullable: Humidity low level threshold from 1 to 99 (%).
    - `highThreshold` number, nullable: Humidity high level threshold from 1 to 99 (%).
  - `temperatureSettings` TemperatureSettings: Temperature sensor settings.
    - `isEnabled` boolean: Enable temperature sensor.
    - `margin` number: Temperature threshold detection hysteresis margin (C). Read-only value decided by sensor implementation.
    - `lowThreshold` number, nullable: Temperature low level threshold from -39 to 124 (C).
    - `highThreshold` number, nullable: Temperature high level threshold from -39 to 124 (C).
  - `motionSettings` MotionSettings: Motion sensor settings.
    - `isEnabled` boolean: Enable motion sensor.
    - `sensitivity` number: Motion sensitivity (0-100) used when system is not armed or when no armed override is set.
    - `sensitivityWhenArmed` number: Motion sensitivity (0-100) used when the system is armed and `hasCustomSensitivityWhenArmed` is true on the sensor.
  - `glassBreakSettings` GlassBreakSettings: Glass break sensor settings.
    - `isEnabled` boolean: Enable glass break sensor.
    - `sensitivity` number: Glass break sensitivity (0-100) used when system is not armed or when no armed override is set.
    - `sensitivityWhenArmed` number: Glass break sensitivity (0-100) used when the system is armed and `hasCustomSensitivityWhenArmed` is true on the sensor.
  - `scheduleMode` 'always' | 'when_armed'
  - `armProfileIds` string[], nullable
  - `hasCustomSensitivityWhenArmed` boolean
  - `alarmSettings` AlarmSettings: Smoke and carbon monoxide alarm sensor settings.
    - `isEnabled` boolean: Enable smoke and carbon monoxide alarm sensor.

## Response `200`

Success response

- Sensor
  - `id` string, required: The primary key of sensor
  - `modelKey` 'sensor', required: The model key of the sensor
  - `state` 'CONNECTED' | 'CONNECTING' | 'DISCONNECTED', required: Connection state of the device.
  - `name` string, required: The name of the device.
  - `mac` string, required: The primary MAC address of the device.
  - `mountType` 'door' | 'window' | 'garage' | 'leak' | 'none', required: Mounting type of the sensor.
  - `batteryStatus` BatteryStatus, required: [DEPRECATED] Use wirelessConnectionState.batteryStatus instead. Battery status.
    - `percentage` number, nullable: Battery charge level from 0 to 100 (%).
    - `isLow` boolean: Low battery charge level flag.
  - `stats` SensorStats, required: Sensor statistics.
    - `light` object: Ambient light value (Lux).
      - `value` number: Decimal value of the metric measured by the sensor
      - `status` 'neutral' | 'low' | 'safe' | 'high' | 'unknown': What range does the measured metric fall into
    - `humidity` object: Ambient light value (Lux).
      - `value` number: Decimal value of the metric measured by the sensor
      - `status` 'neutral' | 'low' | 'safe' | 'high' | 'unknown': What range does the measured metric fall into
    - `temperature` object: Ambient light value (Lux).
      - `value` number: Decimal value of the metric measured by the sensor
      - `status` 'neutral' | 'low' | 'safe' | 'high' | 'unknown': What range does the measured metric fall into
  - `lightSettings` LightSettings, required: Ambient light sensor settings.
    - `isEnabled` boolean: Enable ambient light sensor.
    - `margin` number: Ambient light threshold detection hysteresis margin (Lux). Read-only value decided by sensor implementation.
    - `lowThreshold` number, nullable: Ambient light interrupt threshold low level from 1 to 503192 (Lux).
    - `highThreshold` number, nullable: Ambient light interrupt threshold high level from 1 to 503192 (Lux).
  - `humiditySettings` HumiditySettings, required: Relative humidity sensor settings.
    - `isEnabled` boolean: Enable relative humidity sensor.
    - `margin` number: Humidity threshold detection hysteresis margin (%). Read-only value decided by sensor implementation.
    - `lowThreshold` number, nullable: Humidity low level threshold from 1 to 99 (%).
    - `highThreshold` number, nullable: Humidity high level threshold from 1 to 99 (%).
  - `temperatureSettings` TemperatureSettings, required: Temperature sensor settings.
    - `isEnabled` boolean: Enable temperature sensor.
    - `margin` number: Temperature threshold detection hysteresis margin (C). Read-only value decided by sensor implementation.
    - `lowThreshold` number, nullable: Temperature low level threshold from -39 to 124 (C).
    - `highThreshold` number, nullable: Temperature high level threshold from -39 to 124 (C).
  - `isOpened` boolean, nullable, required: Whether the door/window/garage is opened.
  - `openStatusChangedAt` number, nullable, required: Unix timestamp when the door/window/garage was last opened or closed, nullable.
  - `isMotionDetected` boolean, required: Whether sensor is currently detecting the motion.
  - `motionDetectedAt` number, nullable, required: Unix timestamp when the last motion was detected.
  - `motionSettings` MotionSettings, required: Motion sensor settings.
    - `isEnabled` boolean: Enable motion sensor.
    - `sensitivity` number: Motion sensitivity (0-100) used when system is not armed or when no armed override is set.
    - `sensitivityWhenArmed` number: Motion sensitivity (0-100) used when the system is armed and `hasCustomSensitivityWhenArmed` is true on the sensor.
  - `glassBreakSettings` GlassBreakSettings, required: Glass break sensor settings.
    - `isEnabled` boolean: Enable glass break sensor.
    - `sensitivity` number: Glass break sensitivity (0-100) used when system is not armed or when no armed override is set.
    - `sensitivityWhenArmed` number: Glass break sensitivity (0-100) used when the system is armed and `hasCustomSensitivityWhenArmed` is true on the sensor.
  - `scheduleMode` 'always' | 'when_armed', required: When armed-mode detection runs: `always` or only `when_armed`. Applies to both glass break and motion together.
  - `armProfileIds` string[], nullable, required: When `scheduleMode` is `when_armed`, restricts armed-mode detection to these arm profile ids. Empty or null = all profiles.
  - `hasCustomSensitivityWhenArmed` boolean, required: When true, glass break and motion both use their respective `sensitivityWhenArmed` value while the system is armed.
  - `alarmTriggeredAt` number, nullable, required: Unix timestamp when the smoke or carbon monoxide alarm was triggered, nullable.
  - `alarmSettings` AlarmSettings, required: Smoke and carbon monoxide alarm sensor settings.
    - `isEnabled` boolean: Enable smoke and carbon monoxide alarm sensor.
  - `leakDetectedAt` number, nullable, required: Unix timestamp when the sensor detected a water leak, nullable.
  - `externalLeakDetectedAt` number, nullable, required: Unix timestamp when the sensor detected an external water leak, nullable.
  - `leakSettings` LeakSettings, required: Leak sensor settings.
    - `isInternalEnabled` boolean: Enable internal water leak detection.
    - `isExternalEnabled` boolean: Enable external water leak detection.
  - `tamperingDetectedAt` number, nullable, required: Unix timestamp when the sensor detected tampering, nullable.
  - `wirelessConnectionState` WirelessConnectionState, required: Wireless connection state including signal quality, battery status, and bridge connection.
    - `signalState` SignalState, required: Signal state.
      - `signalQuality` number, nullable, required: Percent representation of Bluetooth signal strength.
      - `signalStrength` number, nullable, required: dBm value of Bluetooth signal strength.
    - `batteryStatus` WirelessBatteryStatus, required: Battery status.
      - `percentage` number, nullable, required: Battery charge level from 0 to 100 (%).
      - `isLow` boolean, required: Low battery charge level flag.
    - `bridge` string, required: The primary key of bridge

## Other responses

- `409`: This operation is not supported for this sensor
- `default`: Error response

---

[API](https://skmtc.dev/ubiquiti/apis/unifi-protect-api.md) - [All operations](https://skmtc.dev/ubiquiti/apis/unifi-protect-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ubiquiti/apis/unifi-protect-api/revisions/e341e1381db1?raw)
