ZHA Thermostat (Moes BHT-002GCLZB alias TS0601 _TZE200_aoclfnxz) local_temp_calibration

What I did for the current heating period:

  • dig out an old Rasperry collecting dust in the cupboard
  • plug in a cheap ZigBee stick lying next to it
  • install HA and Z2M on it
  • bind the thermostat to Z2M
  • set the calibration temperature to -3 °C (after getting annoyed that only a few values are working)
  • delete the thermostat from Z2M
  • bind it to ZHA on my production system
  • be surprised it kept the calibration

I really should learn how to write quirks one day…

When you are using ZHA, you can also set the local temperature calibration.
Go to the device and then select “Manage zigbee device” (click the three dots next to “Reconfigure device”).

The value is 10x the offset you want. The zigbee specification says an 8-bit int and the valid range is 0xE7 - 0x19 so -2.5 to +2.5 .

However, the quirk for Moes thermostats says it’s attribute 0x022C and defines it as a 32 bit int and the quirk maps the local_temperature_calibration attribute to the moes attribute.
Therefore, you should still be able to set thel local_temperature_calibration in the UI and possibly use an extended range for the offset.
You should also be able to select “temperature_calibration” in the UI.

1 Like

Have you actually tried that? For me, there is no “Thermostat” cluster. It only has “MoesBHTThermostat” and as described in this thread, the calibration is not working as expected.

I do not have this TRV specifically, I have also another one which has a modified Thermostat cluster.
I guess that your MoesBHTThermostat is cluster 0x0201, which means that it is the “Moes quirk” for this cluster .

So the manufacturer cluster quirk is different: and does not propose a local_temperature_calibration either.

It could be that the attribute 0x022C exists, but then it has to be added to the quirk similar to several lines in https://github.com/zigpy/zha-device-handlers/blob/c2b2893d027fdcd3a225996fdf382d2ac72ff799/zhaquirks/tuya/ts0601_trv.py#L203 .

Assuming that this converter file of Z2M is applicable to this valve, then tuya attribute 104 seems interesting info regarding the temperature calibration, but it needs to be “mapped” to the ZHA quirk.

1 Like

Yeah, so this is bollocks. I am by no means a novice, but the whole thing about clusters, quirks and whatnot completely goes over my head and I don’t have the time to educate myself about all this.

So I’ll be switching to zigbee2mqtt - there it is really easy to configure the thermostats - also activating the external temp sensor:

I don’t understand why home assistant started to implement and promote the ZHA component. Are there any benefits to use ZHA over Z2M?

So it seems to me that you can only set values without any decimal places (so only full integers) in zigbee2mqtt: When I try to set a value like -0.2 or -0,2 the UI goes nuts. Did you experience the same?
2023-01-02_19-51-13

1 Like

Also switched to z2m because of the lack of trv support of zha. Don’t know why but its should be focused because of current energy crisis. z2m is more responsive but entities stay in last state when there is an connection timeout. because its an addon a home assistant restart doesnt restart z2m so there is no additional loading time. The main downside of z2m is it has problems with newer dongles like skyConnect or sonoff dongle-e.

Where do you set the external temperature sensor? Can’t find it even not in your screenshot.

Yes, only a few whole numbers were working for me, even though the implementation looks like fractions should be fine as well.

I feel the same for the first part: it’s a very complicated topic, especially when manufacturers are not adhering to Zigbee standards. In a community-driven approach though, there is nothing else left for us other than investing the time to get smart enough and fix the errors, or finding workarounds.

Hi,

i have several TZE200. (_TZE200_c88teujp and _TZE200_yw7cahqs) i downloaded the updatet quirk (Add temperature calibration for Tuya TZE200 c88teujp) and enabled custom quirks.

( GitHub - zigpy/zha-device-handlers: ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.

Now i can set the offset in the DevicePage
image

Check your quirks in the device page mine uses the ts0601_trv_sas.py

I know your device is different but the code was added recently

[Device Support Request] Support temperature offset for Tuya Saswell TRV _TZE200_c88teujp · Issue #2025 · zigpy/zha-device-handlers · GitHub

so it works on ZHA!

Temperatures are dropping again, so I gave this another go. Still no success though. With ZHA toolkit I confirmed this is how you can set the target temperature to 22°C:

service: zha.set_zigbee_cluster_attribute
data:
  ieee: 50:32:5f:ff:fe:00:00:00
  endpoint_id: 1
  cluster_id: 0xef00
  cluster_type: in
  attribute: 0x0210
  value: 22

Browsing through the source code you see moesHeatingSetpoint: 16, which is 0x10 and found at the last two hex-digits in the attribute.
The calibration parameter is found to be moesTempCalibration: 27 which translates to 0x1b. Same for x5hTempCorrection: 27 which was refered to by @benpr in the zigbee-herdman-converter code.
So my best guess was sending

  attribute: 0x021b
  value: 2

No luck… So again I ended up running through the house with my old dusty Raspberry, kicking out all devices from ZHA, connecting them to Z2M, tuning the calibration to -4 (must have been a sensor drift during the summer), removing from Z2M and reconnecting to ZHA. Enjoy the winter!

Came across this thread searching for solution to same problem with a Moes BHT thermostat.
For anyone coming after or those in thread still looking for a fix, I found a solution on github that works for me:
Enable custom quirks in ZHA by adding the following to config.yaml

zha:
  enable_quirks: true
  custom_quirks_path: /config/zha_quirks

And then download ts0601_thermostat_avatto.py and place it in the custom quirks directory, then restart home assistant or reload zha integration.
Confirm it is working by checking the quirk listed under zigbee info for device. You should also see new device controls.
Using this I was able to set the temperature calibration. I only seem to be able to set it by whole degrees and not fractions but better than nothing.
It also exposes the min & max heat setpoints although I have not tested those.
Added bonus it fixes the clock on the thermostat which previously for me constantly drifted out of sync.

edit: min & max setpoints do not work for me with this quirk. but temperature calibration is working well. a switch is also exposed which I believe sets the lock on the thermostat controls.

2 Likes

Huge thanks for that link - the quirk works like a charm! The synced clock is the icing on the cake :cupcake:
Min & max setpoint is not important for me, so I am very happy with the solution.

1 Like