Skip to main content

Command Palette

Search for a command to run...

Calibrating temperature sensors using the deCONZ service

Published
4 min read
B

Expert generalist • Independent Contractor • Microsoft MVP • Home Assistant enthusiast Hi there! I'm Bogdan Bujdea, a software developer from Romania. I'm currently a .NET independent contractor, and in my free time I get involved in the local .NET community or I'm co-organizing the @dotnetdays conference. I consider myself an expert generalist, mostly because I enjoy trying out new stuff whenever I get the chance and I get bored pretty easily, so on this blog you'll see me posting content from programming tutorials to playing with my smart gadgets.

I have a few temperature sensors from Hue and Xiaomi, but they all show different temperatures. Sure, the variations are not that big, around 1 degree Celsius, but I would like to calibrate them before placing them in various rooms. To do that I first placed them all in the same room, then I left them there for a few hours along with a thermostat from my underfloor heating, and then I planned to set them all to the temperature of the thermostat.

If you use their hubs you probably have a way to calibrate the sensors using their native apps, but I'm using a Conbee II with deCONZ, so I have two methods, the REST API or the deconz.configure service from Home Assistant. The easiest method is the deconz.configure service, I know because I used both of them. If you're interested in the REST method, I can follow up with that, but in this article, I'll show you how you can use only the deconz.configure service.

The first thing you have to do is open Home Assistant and navigate to Developer Tools -> SERVICES. In the Service input use "deconz.configure", and click on "Fill example data". Once you did that you just have to replace the values with real ones.

First, find the entity id of the sensor you want to modify. I used "sensor.office_temperature" for my example.

Then you have to specify the field you want to modify. Here, use the value '/config'. This is an object that has the 'offset' field which we need to modify. By default, the 'offset' is set to 0, but we will change it according to our needs. For example, if you want your sensor to report a temperature higher with 1 degree, then you will set the offset to 100, or to -100 if you want a temperature lower with 1 degree. If you want to increase it by 0.1, then you set the offset to 10. I think you understand how it works by now. In my example, I found out that my sensor is reporting a temperature that is 0.3 degrees Celsius higher than my thermostat, so I used -30 to bring it down to the same value as the thermostat.

The last value is the bridge ID, which you can find in the integration name from Home Assistant.

image.png

In the end, our request looks like this.

entity: sensor.office_temperature
field: '/config'
data:
  'offset': -30
bridgeid: 01212E03D36B

Just hit on "Call service" and the temperature of your sensor will be adjusted immediately.

I have a video with all the steps in case you prefer video over reading.

N

Hi few days ago I used your method to adjust 2 of my aqara sensors. One of them though is draining my battery super fast. for example in the last half hour drained my new battery from 100% to 30%. I tried to delete it from HA and factory reset it but still have the same problem. Do you have any idea how I could repair it?

B

Hi! Are you sure the battery level is accurate? Calibrating the temperature shouldn't have an impact on battery, certainly not draining the battery from 100% to 30% in half an hour. If the sensor is still alive after one hour then I think you shouldn't trust the battery level, that's all.

N

Bogdan Bujdea Yes, I have measured the batteries from 3.2 are going to 1.9-2. I can see this sensor is reporting to often in HA but again from 100 to 30 is huge I know. I think I just have to throw away the sensor.

1