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

Hi,
has anyone an idea how to set the local_temp_calibration via zha?
Problem: The temperatur from my Moes BHT-002GCLZB alias TS0601 _TZE200_aoclfnxz is about 2.5 C° to high. With other sensors (like esphome sensors) I have the same problem. But there I set an offset from -2.5 and then it is okay.
The zha quirks “electric_heating.MoesBHT” shows under MoesBHTThermostat (Endpoint id:1, Id: 0x0201) cluster management the attribute local_temp_calibration (id: 0x0010).
But I can’t set the attribute. Try to write -2.5 (or -250) it shows an error that the value must higher than 0 (“Error calling service zha/set_zigbee_cluster_attribute. value must be at least 0 for dictionary value @ data[‘manufacturer’]”) and try to write 2.5 or 2 or 250 (for tests) I get “ERROR (MainThread) [zigpy.zcl] [0x650f:1:0x0201] invalid literal for int() with base 10: 'None'” in the log.

Has anyone an idea howto set this attribute over zha?

Thanks Ben

1 Like

I am facing the same issue. My thermostats also show temperatures ~2.5 °C too high.

Scrolling down the ZHA code on Github, it looks like calibration has not been implemented yet. Not sure if I found all the relevant code though.

I would need to understand more how the ZHA code works in order to come up with a fix.

1 Like

I do have the same issue. My thermostats are from Moes having the model BHT-002-GALZ(Zigbee).

I have a second temperaturemeter, which shows current temperature as 24,9 Celcius Degrees. But the Moes thermostat shows as current temperature 26,5 Celcius Degrees.

Does anyone have a solution to this using ZHA?

Some new Infos?
it doesn’t seems to take effect when I set a value in clusters for zha.
I want to set the offset temperature.

Not on my end. I browsed through the code a bit more, but didn’t quite get what is missing. If anyone with more experience in the code can point to the right direction I am happy to help out with reviews and tests.

I use z2m parallel to zha with a second zigbee stick, now. So the thermostats run on z2m where is easy to setup the temperature calibration.
This is my “solution”.

I can confirm, I also cannot setup the local temperature calibration with ZHA. :frowning:

I can successfully read the local_temperature:

However, when I try to write the local_temperature_calibration, nothing happens.

So do I understand correctly, that this is only implemented to Zigbee2Mqtt? Does this mean I would need to migrate my whole Zigbee network from ZHA to Z2M?

I otten recommend using [zha-toolkit][GitHub - mdeweerd/zha-toolkit: 🧰 Zigbee Home Assistant Toolkit - service for "rare" Zigbee operations using ZHA on Home Assistant) which has an attribute write function.

However you can do this from the device page as well.

Click on the 3 dots next to Reconfigure, then “Manage zigbee device”:

From there you can select the appropriate Thermostat cluster and then the attribute.

The value is in tenths of degrees, so enter -25 to lower the measured temperature by 2.5°C…

Then do “Write attribute”, the button should turn green. After that, empty the value field and do a “Read attribute” to confirm that the device has the expected value.

1 Like

2022-10-18_16-57-37 (2)
Unfortunately, this isn’t working for me.

Just installed and looked at the ZHA_toolkit, but all the options are a bit overwhelming for me. :sweat_smile:

Also, I am trying to change the sensor type to use the external sensor. I suppose I need to set the attribute sensor to “EX”.

Apparently you can’t set the local_temperature_calibration because when you read the value it indicates “None”. When it’s supported it should return a number.

zha_toolkit provides “low level” acces to zigbee commands, so it’s perfectly fine to have difficulties with that … . Anyway, in this case it can not do more for the localtemperaturecalibration value.

I was happy to see some activity on this thread as the heating season is about to start here. Too bad there are no good news (yet).
Conclusion is that the calibration is not available by a Zigbee command and there is nothing we can do about it as long as there is no firmware update provided by the manufacturer?

Conclusion is that the calibration is not available by a Zigbee command and there is nothing we can do about it as long as there is no firmware update provided by the manufacturer?

@moes No. The calibration is possible with the original ZB Gateway and App or with Z2M. See the comment from zipp0kms 11. Apr..

The calibration is not realized in zha. Code line in Zigbee2MQTT:

1 Like

That code shows that in Z2M the attribute is translated to zigbee-herdsman-converters/tuya.js at d41ae3d2b3fca4823a6cce6d80d538ebf4b3b8de · Koenkk/zigbee-herdsman-converters · GitHub .

So it’s possible to do so under ZHA as well, at least with the zha-toolkit but you need to write it to the correst cluster/attribute (and set the correct value).

On a closer look in the code, it seems there is a specific method for writing “TUYA” attributes, but the method is not very obvious from the zhaquirks code.

zha-device-handlers/zhaquirks/tuya at f2822031a464bfdf766dfccebf667a502622ebbb · zigpy/zha-device-handlers · GitHubinit.py#L1338-L1346

I’m trying to convert it to zha:

x5hTempCorrection: 27, --> attribute
    if (value >= -9.9 && value <= 9.9) {
        value = Math.round(value * 10);
        if (value < 0) {
            value = 0xFFFFFFFF + value + 1;
        }
        await tuya.sendDataPointValue(entity, tuya.dataPoints.x5hTempCorrection, value);

value: -9.9
-99 = value= -9.9 * 10
4294967197 = 0xFFFFFFFF + value + 1 = 4294967295 + -99 + 1
value to write: 4294967197

service: zha.set_zigbee_cluster_attribute
data:
  ieee: 5c:02:72:ff:fe:d2:41:c2
  endpoint_id: 1
  cluster_id: 0xef00
  cluster_type: in
  attribute: 27
  value: 4294967197

Results in: error 27 is not a valid attribute id.
I think I have to create a quirks with attribute id 27.

I think setting Tuya attributes is not done in the regular Zigbee way, there seems to be a specific set_data command for Tuya.
So it seems easiest to adapt the quirk by extending (subclassing) it in a local quirk.

I am going to avoid Tuya/Moes products - I am checking out a 3 button remote and it’s not even possible to bind the buttons to targets in the regular way…

Did you try to set the calibration temperature directly at the theromstat?
There is a system menu where this can be done. The manual states this:

My proble is, that ZHA only sets whole degrees to the thermostat. No way to set 21,5°. It will set the thermostat to 22°. Anyone else with this issue?
And the other issue is the clock: it is off by at least 5mins in a single day. That’s ridiculous.

Yes, I have tried this, but I have no success. Using the config menu at the device is only possible with the wifi version.
The Zigbee version doesn’t have this menu:
https://www.expert4house.com/it/index.php?controller=attachment&id_attachment=270
I have solved the problem for me with temporarily using the tuya app.

2 Likes

you are right. I can’t access it, too. :frowning:

1 Like