# Temperature and humidity compensation

## Measured temperature compensation

This command is used to set/get the measured temperature compensation in °C.

*The actual keepalive payload is omitted for clarity.*

{% hint style="warning" %}
This command/functionality is supported only for devices with Firmware version ≥2.2
{% endhint %}

{% tabs %}
{% tab title="SET" %}

| **Byte index** | **Hex value - Meaning**                                        |
| -------------- | -------------------------------------------------------------- |
| 0              | 31 - command code                                              |
| 1              | <p>00: Positive compensation<br>01: Negative compensation</p>  |
| 2              | <p>XX - Tcomp\[°C] \* 10<br><strong>Default: 0x00</strong></p> |

**Example command**: 0x31000F – When we separate the value of the temperature from the command code we get 0x**000F,** which means positive compensation of 1.5°C. Thus, if the real measured temperature is 25, the device will report 26.5.
{% endtab %}

{% tab title="GET" %}

| **Byte index** | **Hex value - Meaning**                                       |
| -------------- | ------------------------------------------------------------- |
| 0              | 32 - command code                                             |
| 1              | <p>00: Positive compensation<br>01: Negative compensation</p> |
| 2              | XX - Tcomp\[°C] \* 10                                         |

**Example command**: 0x32

**Example command**: 0x320103 – When we separate the value of the temperature from the command code we get 0x**000F,** which means negative compensation of 0.5°C. Thus, if the real measured temperature is 25, the device will report 24.7.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
The allowed range is -25.5... 25.5°C (0.1°C resolution).
{% endhint %}

## Measured humidity compensation

This command is used to set/get the measured humidity compensation in %.

{% hint style="warning" %}
This command/functionality is supported only for devices with Firmware version ≥2.2
{% endhint %}

*The actual keepalive payload is omitted for clarity.*

{% tabs %}
{% tab title="SET" %}

| **Byte index** | **Hex value - Meaning**                                       |
| -------------- | ------------------------------------------------------------- |
| 0              | 33 - command code                                             |
| 1              | <p>00: Positive compensation<br>01: Negative compensation</p> |
| 2              | <p>XX - Hcomp\[%] \* 10<br><strong>Default: 0x00</strong></p> |

**Example command**: 0x310005 – When we separate the value of the humidity from the command code we get 0x**0005,** which means positive compensation of 5%. Thus, if the real measured humidity is 55, the device will report 60.
{% endtab %}

{% tab title="GET" %}

| **Byte index** | **Hex value - Meaning**                                       |
| -------------- | ------------------------------------------------------------- |
| 0              | 34 - command code                                             |
| 1              | <p>00: Positive compensation<br>01: Negative compensation</p> |
| 2              | XX - Hcomp\[%] \* 10                                          |

**Example command**: 0x32

**Example command**: 0x320103 – When we separate the value of the humidity from the command code we get 0x**0003,** which means negative compensation of  3%. Thus, if the real measured humidity is 50, the device will report 47.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
The allowed range is -99... 99% (1% resolution).
{% 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://docs.mclimate.eu/mclimate-lorawan-devices/devices/mclimate-ht-sensor-lorawan/ht-sensor-lorawan-device-communication-protocol/temperature-and-humidity-compensation.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.
