> For the complete documentation index, see [llms.txt](https://api.intecular.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.intecular.com/invisoutlet-pro/device-management/invisdeco/occupancy-sensor-calibration.md).

# Occupancy Sensor Calibration

> This request performs the background noise detection of the occupancy sensor.

{% hint style="info" %}
If you believe your occupancy sensor is not accurate for your area, please perform this API request.

Before you start, please make sure no one is in the area that InvisOutlet and InvisDeco are installed at. Once the request is sent, the occupancy sensor will start doing background noise detection in 10 seconds, and perform the calibration based on the time you provided in  the request.

*Note: We recommend the detection time to be at least 30 seconds and maximum 60 seconds.*
{% endhint %}

**Request**

* <mark style="color:red;">`packetID`</mark>: Represents the ID of the packet. This can be any six digit number, no leading zeros.
* <mark style="color:red;">`payload`</mark>:&#x20;
  * <mark style="color:red;">`callbackName`</mark>: 26
  * <mark style="color:red;">`callbackArgs`</mark>:&#x20;
    * `0`: Specifies the calibration duration, 30 seconds is recommended

```json
{
    "packetID": 221056,
    "payload":
    {
        "callbackName": 26,
        "callbackArgs": [30]
    }
}
```

**Response**

* <mark style="color:red;">`sn`</mark>: The serial number of the InvisOutlet.
* <mark style="color:red;">`packetID`</mark>: Represents the ID of the packet based on request <mark style="color:red;">`packetID`</mark>.
* <mark style="color:red;">`PUBACK`</mark> : 1 - The request is received and calibration will begin in 10 seconds. 0 - Timeout to request occupancy sensor to perform calibration. Please try to restart InvisDeco and try again.

```json
{
    "sn": "0003C44076",
    "packetID": 221056,
    "PUBACK": 1
}
```

{% hint style="info" %}
The status of the occupancy calibration can be checked by the [Synchronous Updates - Sensors](/invisoutlet-pro/synchronous-updates/sensors.md) response, <mark style="color:red;">`occupancy_state`</mark> is 4/5/6.&#x20;
{% endhint %}
