Calibrating the temperature offset on a Sonoff TRVZB

Hello everyone, I am using the Sonoff TRVZB for my home heating setup. Generally, it works well for my purposes - however temperature was relatively far off. Therefore, I looked into calibrating it.

There are two methods for doing this:

Calibration using ZHA Toolkit (independent of integration within Home Assistant UI). The main benefit of this method is that offsets >2.5°C can be defined.

Problem is, that I am using the ZHA integration, which at the moment does not include calibration features for most TRVs in general. See this github issue for more on this topic. But, calibration is definitely possible. It is possible in the official Sonoff app as well as through the Zigbee cluster “local_temperature_calibration”.

Well, here’s how to do that:

  • I assume, you already have the TRV connected
  • Install zha_toolkit from HACS
  • Enable zha_toolkit by putting a line into your configuration.yaml:
  • Restart Home Assistant
  • Go to your developer tools → services page
  • Select the zha_toolkit.execute service, and for easier input switch to YAML mode
  • Enter this code:
service: zha_toolkit.execute
  command: attr_write
  ieee: climate.your_sonoff_trv_device_name_here
  attribute: 0x0010
  cluster: 0x0201
  endpoint: 1
  attr_val: -20
  • The last value is the important one. It is the calibration amount. Be aware that it’s 10 times the amount you want. Therefore, my example -20 is equal to a calibration of -2.0 °C.
  • Check the answer by the device is the output what you expect. You should see your value under result_read:
  - "Read does not match expected: -20 <> '-20'"
  - "16": -20
  - {}
  • Done. As you can see, the reported answer matches the input. We can ignore the warning, since apparently it checks text against an integer.

Looking into the specific device information and looking for local_temperature_calibration, you might be able to find the attribute and cluster IDs which can be used on other TRVs as well. As far as my knowledge goes, this value seems to be standardized. However, I can only confirm these specific to the Sonoff TRVZB.

If you have success with other devices, let everyone know and I’ll update the title.

Using the UI, see the post marked as solution. Defnitely the easier variant, if you do not have any special requirements:

Hi there, great workaround. thx. but for a programmer noob, how do i do this for 2 or 3 sonoff TRVZB?

It seems like in the meantime, either an update was made to ZHA or to the Sonoff integration into ZHA so that this was made much easier. You can now adjust the offset directly in the device settings as a separate number slider:

For that you just need to open device information:

And then adjust the number entity called “local temperature offset”:

Unfortunately I can’t track down which update is responsible for the entity now showing up, but it was around the 2024.01 update of Home Assistant.

great! is was the core update that added the offset.


Hmm but it’s in the range +/- 2.5

Does anyone know where this limit comes from, maybe a quirk could be used to increase it ? I read somewhere the valve might support +/- 7 degrees but unverified

I am using Better Thermostat, and these valves tend to shoot up by 5 degrees so -2.5 doesn’t help much.

Edit: I manually discovered the valve supports much larger offsets than 2.5. Does anyone know where I can fix this limitation in ZHA because Better Thermostat is adhering to it as well.

Edit: HA core 2024.3.0 has a fix for +/- 7 degrees on TRVZB