Moes BHT series Thermostat BHT-002-GCLZB (_TZE200_aoclfnxz) exceptions in zigbee2mqtt v1.31.0 and newer

I am sharing my finding, maybe someone find it useful.
After upgrading to z2m v 1.31.0 my home assistant log started to log following error:

Exception in message_received when handling msg on 'zigbee2mqtt/0x5c0272fffedd2137': '{"child_lock":null,"current_heating_setpoint":21,"deadzone_temperature":null,"heat":"OFF","last_seen":"2023-06-07T17:42:17+02:00","linkquality":163,"local_temperature":23,"local_temperature_calibration":null,"max_temperature_limit":null,"min_temperature_limit":null,"preset":"hold","preset_mode":"hold","program":null,"running_state":"idle","sensor":null,"system_mode":"off"}' Traceback (most recent call last): File "/srv/hass311/lib/python3.11/site-packages/homeassistant/components/mqtt/debug_info.py", line 44, in wrapper msg_callback(msg) File "/srv/hass311/lib/python3.11/site-packages/homeassistant/components/mqtt/sensor.py", line 321, in message_received _update_state(msg) File "/srv/hass311/lib/python3.11/site-packages/homeassistant/components/mqtt/sensor.py", line 272, in _update_state payload = self._template(msg.payload, PayloadSentinel.DEFAULT) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/hass311/lib/python3.11/site-packages/homeassistant/components/mqtt/models.py", line 251, in async_render_with_possible_json_value rendered_payload = self._value_template.async_render_with_possible_json_value( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/hass311/lib/python3.11/site-packages/homeassistant/helpers/template.py", line 716, in async_render_with_possible_json_value return _render_with_context(self.template, compiled, **variables).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/hass311/lib/python3.11/site-packages/homeassistant/helpers/template.py", line 2164, in _render_with_context return template.render(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/hass311/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render self.environment.handle_exception() File "/srv/hass311/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception raise rewrite_traceback_stack(source=source) File "<template>", line 1, in top-level template code File "/srv/hass311/lib/python3.11/site-packages/jinja2/filters.py", line 870, in do_truncate if len(s) <= length + leeway: ^^^^^^ TypeError: object of type 'NoneType' has no len()

Upgrading to 1.31.1 didn’t help.
Then I find out that program sensor in home assistant config device is unknown. Previously this sensor showed thermostat’s program choosed.
I disabled this sensor and entries in log stopped comming.
Obviously, in 1.31.0 structure of message is changed and this somehow results with this problem.

1 Like

Might be a good idea to open an issue on the zigbee2mqtt GitHub repo

I did week ago.


There is screenshot which explains what I disabled.

1 Like

@IgorZg The same here - all was fine until update and after that a lot of errors from all thermostats around the house. Disabling program sensors helped right away, thank you for the hint!!

How to turn off the software sensor?

Take look on the picture above. Find it, click on it and choose disable.

BHT-002-GCLZB stopped working.
in z2m it works fine.
and in home the assistant is not detected as needed
Has anyone encountered this?