Ability for Sensor Calibration

Very often, sensors for temperature and humidity and so on are not very exact and people have a exact reference. It would be nice if we could calibrate a sensor in an easy way without creating a second template sensor.

homeassistant:
  customize:
    sensor.aqara123:
      calibrate: -2

or like in ESPhome:

calibrate_linear:
      - 0.0 -> 0.0
      - 40.0 -> 45.0
      - 100.0 -> 102.5

Edit: there is already another feature request for the same thing: Calibrate Sensor

Possible solution: in customize.yaml add the attribute “calibrate” with the required offset.
Then in https://github.com/home-assistant/core/blob/435f278053677b5dd82926cd6863316a34282836/homeassistant/components/sensor/init.py the calibrate attribute could be checked and the value added to the sensor value.

2 Likes