# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.intecular.com/invisoutlet-pro/device-management/invisdeco/occupancy-sensor-calibration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
