Calibrate the environmental sensors on Home Assistant

3 minutes of reading
  • Calibrate the environmental sensors of the profirst home automation
  • Difficulty level: bass
  • Cost: variable according to the technique used
  • The device in which it is running Home Assistant
  • The sensor (s) to be calibrated
  • a possible reference sensor

All environments

Notes and disclaimer
  • qualsiasi modifica all'impianto elettrico dev'essere progettata ed effettuata da personale qualificato;
  • any changes implemented in probefore is a propersonal responsibility as well as a profirst risk and danger (the contents of the present page are purely educational);
  • any changes implemented in proprior to a device it voids the guarantee, quality approvals and certifications.
revision projet: 1.0


Home automation environmental sensors they are not all the same. Two units can be atappARENCY identical, same model, same age, same lot even, but in nine out of ten cases, if placed in the same environment, they do not detect the same readings. The why are the most disparate: micro-diversity in materials, consumption, more simply calibrations done wrong and / or other.

Aeotec Multisensor Gen6

It therefore happens to have twin sensors, put them next to each other and get different readings. A classic example is that of thermal sensors: these are usually differences of a few tenths of a degree, and here a watershed is created: on the one hand those who don't care, on the other those who hell, no, don't existand have reading differences.

If you are in the first circle, you can also skip the reading of the present procast, which is appanointed dedicated to those who claim, in the profirst home automation, a correct calibration of propri environmental sensors.

Specifically, we will see how to obtain the result at the profirst home automation based on Home Assistant.


As sappe are, integration of sensors at Home Assistant generates entity of type "Sensor"Which provide the operating environment with readings provided by the sensor (single or even multiple, as in the case of multi-sensors, eg. Aoetec Multisensor).

To correct the reading of a sensor it is necessary to act adding them or subtracting them offset value, calculated on the basis of the comparison of the sensor detection and a "standard" reference reading.

Let's say we have three temperature sensors (regardless of brand and data transmission technology) integrated into our home automation and placed next to each other. It is not uncommon to detect "staggered" trends of this type:

Sensorthe out-of-phase thermals

Maybe that one of the three tells the truth, or that all three are staggered with respect to the objective temperature of the environment. As mentioned, it is necessary to have a reference reading to understand how to adjust the offset of the three sensors.

To do this, it is possible to pursue two paths:

  • have a standard reading through a precision measuring instrument;
  • choose one of the sensors as an arbitrary reference.

The first case is, da va se the most effective one purpose.
Remaining in the wake of the example of thermal sensors (but the logic described in this projet is applicense to any other type of reading, in principle), sensors exist professional that can help in the timely detection of the reference measure. The game to calculate the offset it will then be extremely simple: if the probe will measure, for example, 18,0% and our sensor to be calibrated will mark 18,2%, it's clear that the offset will be -0.2 degrees, or the difference between the value detected by the sensor and the reference measurement.

In the absence of a sensor professional, the options are reduced: at this point we will go "feeling", choosing one of the profirst sensors as a standard reference, so as to align them all with it; clearly the absolute values ​​will not be potentially correct, but at least the sensors they will all be aligned on the same "error".

Nb Remember, when comparing values ​​and then defining the offset, to leave the sensors close for a few hours, to allow the materials to "acclimatize" and thus provide readings as precise as possible.


To adjust an offset (once calculated) the approthere are basically two.

If the sensor, in fact, provides for the setting upstream of this correction, the game is done: just enter it in the configuration. This varies from component to component; for example, i smart thermostats Tado° they are equipped, at theapp management mobile, of this possibility:

App Tado° - Offset
'sapp Tado°.

Since the thermostat is then integrated on Home Assistant via cloud, the reading data arrives atHUB already corrected via offset adjustment, and there's no need to do anything else.

Otherwise, for example when there are sensors rappresented by them entity presso Home Assistant (regardless of their technology), then it is necessary to use a ploy, or define a "template Sensor”Which takes the place of the original entity and which carries as a dowry the reading of the original sensor correct of previously calculated offset.

Definition of the sensor

At this point it is sufficient to define in configuration our sensor equipped with offset adjustment.
Let us assume, by way of example, that we have in our configuration a sensor entity called sensor.temperatura_sala which must be adjusted with an offset of + 0,2 degrees.

The configuration is really trivial:

  - platform: template
        friendly_name: "Temperatura SALA offset"
        value_template: '{{ states("sensor.sala_temperatura")|float + 0.2)  }}'
        unit_of_measurement: "°C"
        icon_template: mdi:thermometer

This configuration will directly generate a named entity sensor.sala_temperatura_offset which, in the proFirst, it will report in real time the value of the "father" sensor added with 0,2 degrees, as required.

Home Assistant - sensor with offset

It goes without saying that once the sensors with offset adjustment are defined, the original ones they should no longer be used for automations, script as well as on Lovelace UI: will remain in the background to provide the data to be corrected to the correct sensors, and nothing more.

Home Assistant Official LogoATTENZIONE: remember that there is on our FORUM community an ad hoc section dedicated to Home Assistant, for any doubt, question, information on the specific merit of these components.

Please comment below