Calibration of aqara temperature sensors

I don’t understand, what do you mean with “source out the calibration”?

I mean I don’t want to have this calibration in the configuration.yaml instead in sensors.yaml but it did not work like I wrote it in my post in the beginning.

So I have no clue how to include the sensors.yaml into configuration.yaml, because template: !include sensors.yaml did not work properly.

You have marked your own post as the solution.
It is customary to mark the post who gave you answer as the solution (either Tom or Burning) to follow your example EVERY thread would be solved by the OP.

You may also find that your ‘offset’ is not linear and an mx+c suits better or even a polynomial, these can also be done. But the last thread I participated in on this subject. The error was merely perception and just the way the sensor updated - correction was not needed.

If you want the sensor in your sensor.yaml file then just put the include (as burningstone suggested) in there.

1 Like

Now I got it :slight_smile:

When I enter the code directly into configuration.yaml there must be a sensor: followed by the code, when indirectly, the sensor has still to be there, but followed by include! sensors.yaml and the code is in this data.

THX

1 Like

Take a look here for more information about this:

2 Likes

Yeah, this is called ‘splitting your configuration’ (otherwise you end up with a 10MB configuration.yaml (exaggeration)) but splitting makes managing changes easier and more logical AND tracking down where you put the customisation for ‘this’ widget a LOT quicker.
You can split individual areas as you are doing now, so input_number, binary_sensor, automation etc or you can use packages. My configuration.yaml has 27 lines in it, 3 of them comments.

2 Likes

It would be nice if there was something like this:

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

I’ve created a feature request to have something in the UI to do this for us, vote on it if you’re still interested in a simpler method than what’s currently avaliable:

1 Like
1 Like

I am trying to calibrate the humidity from an Aqara Temprature sensor.

I use the following script:


And get:

Any idea what I could be doing wrong?

Please post code not pictures of code!

Your issue is that sensor: at the beginning has to be all lowercase.

1 Like

Which Zigbee integration do you use for your Aqara sensors ?

You can probably configure your temperature offset directly in Zigbee integration which would be much more cleaner.

1 Like

I have a Conbee and I think the only integration used is Phoscon, right?

It appears all my sensors are significantly low on humidity, the output is low and I compared them with sensors already in place in the Aqara app. Would be great with a smoother option since the sensors can become quite many.

The most common ‘universal’ Zigbee integrations in Home Assistant are probably : ZHA, Zigbee2MQTT and Deconz.

I don’t about about ZHA or Deconz, but I know that you can configure temperature/humidity offsets in Zigbee2MQTT plugin configuration. It’s probably also available in ZHA and Deconz.

1 Like

Aha, then it must be DeConz I am using. I will look up the other option, thanks!

I love you! Thanks! It works!

You are using deconz then, deconz doesn’t have this feature to offset sensors as far as I know.

1 Like

Hey everyone! I am trying to add 1 tenth of one degree +.1 to my bedroom temperature. when I put it into configuration.yamal it confirms the coding is correct. When I go to validate the configuration all I get is a throbber that never returns a valid or invalid configuration. So what am I doing wrong? Newbie here when it comes to coding! Thanks for any help.


sensor:
  - platform: template
    sensors:
      corrected_temperature:
      friendly_name: "Bedroom Temp"
      value_template: "{{ states('sensor.bedroom_temperature')|float + .1)|round(1) }}"

I use following code for this an works perfectly:

template:
  - sensor:
      - name: Temperature Library # calibrated
        state: >
          {{ states.sensor.multi_sensor_library.state | float(default=20) - 0.5 }}
        unit_of_measurement: "°C"
1 Like