Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New device: Moes (Tuya?) ZigBee Thermostat Programmable Temp Controller BHT-002-GCLZBW #4185

Closed
insipiens opened this issue Aug 26, 2020 · 162 comments

Comments

@insipiens
Copy link
Contributor

What happened: Device is not supported

What did you expect to happen: Expected to follow the procedure to add the device and review debug level logs - logs are empty. wireshark output included but outside my experience level to resolve

How to reproduce it (minimal and precise): pair this new device?

Debug Info

Zigbee2MQTT version: 1.14.3
Adapter hardware: CC2531
Adapter firmware version: current (last month)

Moes ZigBee Smart Thermostat Programmable Temperature Controller for Water/Gas Boiler BHT-002-GCLZBW

Device website: https://www.moeshouse.com/collections/smart-thermostat/products/white-zigbee-smart-thermostat-programmable-temperature-controller-zigbee-hub-required-for-water-gas-boiler

User manual: https://support.gw-ec.com/upload/qa/2018/11/19/3019d10504894c7327d18fc07389bbe6.pdf

I've attached the work[?] I did in the attached text file: proforma device.js and resulting outputs etc.

Moes Zigbee Thermostat.txt

Any advice on progressing from here appreciated

@ginkage
Copy link
Contributor

ginkage commented Aug 26, 2020

Try editing your devices.js like so:

    {
        fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_aoclfnxz'}],
        model: 'TS0601_thermostat',
        vendor: 'Moes',
        description: 'Room thermostat Water/Gas Boiler',
        supports: 'thermostat, temperature',
        meta: {tuyaThermostatSystemMode: common.TuyaThermostatSystemModes},
        fromZigbee: [fz.tuya_thermostat, fz.tuya_thermostat_on_set_data, fz.ignore_basic_report],
        toZigbee: [
            tz.tuya_thermostat_child_lock, tz.tuya_thermostat_window_detection, tz.tuya_thermostat_valve_detection,
            tz.tuya_thermostat_current_heating_setpoint, tz.tuya_thermostat_system_mode, tz.tuya_thermostat_auto_lock,
            tz.tuya_thermostat_calibration, tz.tuya_thermostat_min_temp, tz.tuya_thermostat_max_temp,
            tz.tuya_thermostat_boost_time, tz.tuya_thermostat_comfort_temp, tz.tuya_thermostat_eco_temp,
            tz.tuya_thermostat_force,
        ],
    },

then re-pair your device.

@ghost
Copy link

ghost commented Aug 26, 2020

Try editing your devices.js like so:

    {
        fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_aoclfnxz'}],
        model: 'BHT-002-GCLZB',
        vendor: 'Moes',
        description: 'Room thermostat Water/Gas Boiler',
        supports: 'thermostat, temperature',
        meta: {tuyaThermostatSystemMode: common.TuyaThermostatSystemModes},
        fromZigbee: [fz.tuya_thermostat, fz.tuya_thermostat_on_set_data, fz.ignore_basic_report],
        toZigbee: [
            tz.tuya_thermostat_child_lock, tz.tuya_thermostat_window_detection, tz.tuya_thermostat_valve_detection,
            tz.tuya_thermostat_current_heating_setpoint, tz.tuya_thermostat_system_mode, tz.tuya_thermostat_auto_lock,
            tz.tuya_thermostat_calibration, tz.tuya_thermostat_min_temp, tz.tuya_thermostat_max_temp,
            tz.tuya_thermostat_boost_time, tz.tuya_thermostat_comfort_temp, tz.tuya_thermostat_eco_temp,
            tz.tuya_thermostat_force,
        ],
    },

then re-pair your device.
=============================================
Zigbee2MQTT:info 2020-08-26 21:35:58: Successfully interviewed '0xbc33acfffe62f313', device has successfully been paired
Zigbee2MQTT:info 2020-08-26 21:35:58: Device '0xbc33acfffe62f313' is supported, identified as: Moes Room thermostat Water/Gas Boiler (BHT-002-GCLZB_thermostat)
Zigbee2MQTT:info 2020-08-26 21:35:58: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"interview_successful","meta":{"friendly_name":"0xbc33acfffe62f313","model":"BHT-002-GCLZB_thermostat","vendor":"Moes","description":"Room thermostat Water/Gas Boiler","supported":true}}'

Results in Z2M, how to test?

@insipiens
Copy link
Contributor Author

Thanks @ginkage That certainly produced some results in the log

Aug 26 21:14:26 raspberrypi bash[17181]: Zigbee2MQTT:info 2020-08-26 21:14:26: Device '0xbc33acfffe62f32a' joined Aug 26 21:14:26 raspberrypi bash[17181]: Zigbee2MQTT:info 2020-08-26 21:14:26: Starting interview of '0xbc33acfffe62f32a' Aug 26 21:14:26 raspberrypi bash[17181]: Zigbee2MQTT:info 2020-08-26 21:14:26: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_connected","message":{"friendly_name":"0xbc33acfffe62f32a"}}' Aug 26 21:14:26 raspberrypi bash[17181]: Zigbee2MQTT:info 2020-08-26 21:14:26: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"interview_started","meta":{"friendly_name":"0xbc33acfffe62f32a"}}' Aug 26 21:14:26 raspberrypi bash[17181]: Zigbee2MQTT:info 2020-08-26 21:14:26: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_announced","message":"announce","meta":{"friendly_name":"0xbc33acfffe62f32a"}}' Aug 26 21:14:41 raspberrypi bash[17181]: Zigbee2MQTT:info 2020-08-26 21:14:41: Successfully interviewed '0xbc33acfffe62f32a', device has successfully been paired Aug 26 21:14:41 raspberrypi bash[17181]: Zigbee2MQTT:info 2020-08-26 21:14:41: Device '0xbc33acfffe62f32a' is supported, identified as: Moes Room thermostat Water/Gas Boiler (BHT-002-GCLZB) Aug 26 21:14:41 raspberrypi bash[17181]: Zigbee2MQTT:info 2020-08-26 21:14:41: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"interview_successful","meta":{"friendly_name":"0xbc33acfffe62f32a","model":"BHT-002-GCLZB","vendor":"Moes","description":"Room thermostat Water/Gas Boiler","supported":true}}' Aug 26 21:15:15 raspberrypi bash[17181]: zigbee-herdsman-converters:siterwell_gs361: NOT RECOGNIZED DP #536 with data {"type":"Buffer","data":[0,0,0,225]} Aug 26 21:16:15 raspberrypi bash[17181]: zigbee-herdsman-converters:siterwell_gs361: NOT RECOGNIZED DP #536 with data {"type":"Buffer","data":[0,0,0,225]} Aug 26 21:16:20 raspberrypi bash[17181]: zigbee-herdsman-converters:siterwell_gs361: NOT RECOGNIZED DP #528 with data {"type":"Buffer","data":[0,0,0,30]} Aug 26 21:16:20 raspberrypi bash[17181]: zigbee-herdsman-converters:siterwell_gs361: NOT RECOGNIZED DP #528 with d.............................................. Aug 26 21:16:26 raspberrypi bash[17181]: zigbee-herdsman-converters:siterwell_gs361: NOT RECOGNIZED DP #1060 with data {"type":"Buffer","data":[1]} *edited for brevity*

So that is the default (unrecognised) for TuYa convertors, so maybe not Tuya at all.

I got my hands on a Moes zigbee gateway this morning, so also linked it there. Despite getting the transport (network) key It's very,very chatty and its difficult to gather the codes [without experience?]

Appreciate the help

@ginkage
Copy link
Contributor

ginkage commented Aug 26, 2020

Hm... Judging by the modelID, it should've been TuYa, but then again, maybe it does need a special converter to implement. Oh well, at least we tried.

@Utyff
Copy link
Contributor

Utyff commented Aug 27, 2020

Hi @ginkage, I tried your devices.js update.
Device successfully joined and interviewed but converters are not working and no one parameters added to device.
Could you help with converters?

Here short log after join device
debug 2020-08-27 03:19:13: Received Zigbee message from '0xbc33acfffe5ec839', type 'commandGetData', cluster 'manuSpecificTuyaDimmer', data '{"status":0,"transid":22,"dp":101,"fn":0,"data":{"type":"Buffer","data":[6,0,40,11,30,42,13,30,44,17,30,46,6,0,48,12,0,46,14,30,44,17,30,42,6,0,38,12,30,40,14,30,42,18,30,40]}}' from endpoint 1 with groupID 0
debug 2020-08-27 03:19:19: Received Zigbee message from '0xbc33acfffe5ec839', type 'read', cluster 'genTime', data '["localTime"]' from endpoint 1 with groupID 0
debug 2020-08-27 03:19:22: Received Zigbee message from '0xbc33acfffe5ec839', type 'raw', cluster 'manuSpecificTuyaDimmer', data '{"type":"Buffer","data":[25,14,36,0,10]}' from endpoint 1 with groupID 0
debug 2020-08-27 03:19:22: No converter available for 'TS0601_thermostat' with cluster 'manuSpecificTuyaDimmer' and type 'raw' and data '{"type":"Buffer","data":[25,14,36,0,10]}'

Full log here:
https://cloud.mail.ru/public/Ajwb/4SvBqiXFK

@insipiens
Copy link
Contributor Author

@Utyff I've done some further testing, the default log (on failed conversion has been really useful) and have found the following message (DP/data). These are all messages from the Thermostat in response to pressing buttons.

Green shaded entries I am certain of, the others I need to confirm further.

MoesRoomThermostatMessages

@insipiens
Copy link
Contributor Author

Zigbee2MQTT:info 2020-08-30 00:03:19: MQTT publish: topic 'zigbee2mqtt/0xbc33acfffe62f32a', payload '{"standby":"YES","linkquality":31,"local_temperature":"18.5","activated":"ON","set_temperature":"17.0","target_temperature":"15.0","Manual_set_temperature":"10.0","child_lock":"UNLOCKED"}'
Progress, of sorts - just amending my local installation. The codes are all different to Tuya codes currently provided. I've added them to the Tuya converter as extra codes for now.

Will look at the toZigbee.js converter next.

attached the analysis of tozigbee message content
Moes_thermostat toZigbee commands

@Illivion
Copy link

Illivion commented Sep 4, 2020

Hi, @insipiens. I am trying to make some protocol analysis too, but it's my first experience and i have some troubles. I can't catch transport key for decrypting payloads. I've tried many times to pair device with hub, but 'transport key' frame doesn't occur. I ask for advice

@insipiens
Copy link
Contributor Author

@Illivion

You want to search for the "Transport key" identifier in the Info column in wireshark, you can reorder it by clicking the info column header.

Attached a screenshot of the process , locating the Transport key in the Info column and then locate the data for the key in the Zigbee security header.

You'll need to enter this in the preferences for the zigbee protocol - AES-128 encryption.

I would recommend putting "zbee_aps" in the display filter once set up so you see relevant messages for Zigbee Home automation.

NWkey

@Koenkk
Copy link
Owner

Koenkk commented Sep 7, 2020

Assuming this can be closed now because changes have been added.

Changes will be available in the latest dev branch in a few hours (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html)

@Koenkk Koenkk closed this as completed Sep 7, 2020
@way2many
Copy link
Contributor

way2many commented Sep 8, 2020

Is this Opentherm? I couldn't find the information on the website.

@insipiens
Copy link
Contributor Author

Not opentherm, uses just Tuya or Smart life app.

Zigbee2mqtt support has been added to the Dev branch and should be in the master at next update

@poisondima
Copy link

@Koenkk, I have a thermostat for a warm floor BHT-002-GBLZB, in the dev version it was defined as "Moes Room thermostat water / gas boiler (BHT-002-GCLZB)". The difference is that it has 2 temperature sensors: internal and external.

info  2020-09-23 15:37:05: Successfully interviewed '0xbc33acfffe62f395', device has successfully been paired
info  2020-09-23 15:37:05: Device '0xbc33acfffe62f395' is supported, identified as: Moes Room thermostat water/gas boiler (BHT-002-GCLZB)
info  2020-09-23 15:37:05: MQTT publish: topic 'homeassistant/lock/0xbc33acfffe62f395/child_lock/config', payload '{"availability_topic":"zigbee2mqtt/bridge/state","command_topic":"zigbee2mqtt/0xbc33acfffe62f395/set/child_lock","device":{"identifiers":["zigbee2mqtt_0xbc33acfffe62f395"],"manufacturer":"Moes","model":"Room thermostat water/gas boiler (BHT-002-GCLZB)","name":"0xbc33acfffe62f395","sw_version":"Zigbee2MQTT 1.14.4-dev"},"json_attributes_topic":"zigbee2mqtt/0xbc33acfffe62f395","name":"0xbc33acfffe62f395_child_lock","payload_lock":"LOCK","payload_unlock":"UNLOCK","state_locked":"LOCKED","state_topic":"zigbee2mqtt/0xbc33acfffe62f395","state_unlocked":"UNLOCKED","unique_id":"0xbc33acfffe62f395_child_lock_zigbee2mqtt","value_template":"{{ value_json.child_lock }}"}'
info  2020-09-23 15:37:05: MQTT publish: topic 'homeassistant/climate/0xbc33acfffe62f395/climate/config', payload '{"action_template":"{% set values = {'idle':'off','heat':'heating','cool':'cooling','fan only':'fan'} %}{{ values[value_json.running_state] }}","action_topic":"zigbee2mqtt/0xbc33acfffe62f395","availability_topic":"zigbee2mqtt/bridge/state","current_temperature_template":"{{ value_json.local_temperature }}","current_temperature_topic":"zigbee2mqtt/0xbc33acfffe62f395","device":{"identifiers":["zigbee2mqtt_0xbc33acfffe62f395"],"manufacturer":"Moes","model":"Room thermostat water/gas boiler (BHT-002-GCLZB)","name":"0xbc33acfffe62f395","sw_version":"Zigbee2MQTT 1.14.4-dev"},"json_attributes_topic":"zigbee2mqtt/0xbc33acfffe62f395","max_temp":"30","min_temp":"5","mode_command_topic":"zigbee2mqtt/0xbc33acfffe62f395/set/system_mode","mode_state_template":"{{ value_json.system_mode }}","mode_state_topic":"zigbee2mqtt/0xbc33acfffe62f395","modes":["off","auto","heat"],"name":"0xbc33acfffe62f395_climate","temp_step":1,"temperature_command_topic":"zigbee2mqtt/0xbc33acfffe62f395/set/current_heating_setpoint","temperature_state_template":"{{ value_json.current_heating_setpoint }}","temperature_state_topic":"zigbee2mqtt/0xbc33acfffe62f395","temperature_unit":"C","unique_id":"0xbc33acfffe62f395_climate_zigbee2mqtt"}'
info  2020-09-23 15:37:05: MQTT publish: topic 'homeassistant/sensor/0xbc33acfffe62f395/linkquality/config', payload '{"availability_topic":"zigbee2mqtt/bridge/state","device":{"identifiers":["zigbee2mqtt_0xbc33acfffe62f395"],"manufacturer":"Moes","model":"Room thermostat water/gas boiler (BHT-002-GCLZB)","name":"0xbc33acfffe62f395","sw_version":"Zigbee2MQTT 1.14.4-dev"},"icon":"mdi:signal","json_attributes_topic":"zigbee2mqtt/0xbc33acfffe62f395","name":"0xbc33acfffe62f395_linkquality","state_topic":"zigbee2mqtt/0xbc33acfffe62f395","unique_id":"0xbc33acfffe62f395_linkquality_zigbee2mqtt","unit_of_measurement":"lqi","value_template":"{{ value_json.linkquality }}"}'
info  2020-09-23 15:37:05: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Room thermostat water/gas boiler","friendly_name":"0xbc33acfffe62f395","model":"BHT-002-GCLZB","supported":true,"vendor":"Moes"},"type":"pairing"}'

@insipiens
Copy link
Contributor Author

@Koenkk, I have a thermostat for a warm floor BHT-002-GBLZB, in the dev version it was defined as "Moes Room thermostat water / gas boiler (BHT-002-GCLZB)". The difference is that it has 2 temperature sensors: internal and external.

info  2020-09-23 15:37:05: Successfully interviewed '0xbc33acfffe62f395', device has successfully been paired
info  2020-09-23 15:37:05: Device '0xbc33acfffe62f395' is supported, identified as: Moes Room thermostat water/gas boiler (BHT-002-GCLZB)
info  2020-09-23 15:37:05: MQTT publish: topic 'homeassistant/lock/0xbc33acfffe62f395/child_lock/config', payload '{"availability_topic":"zigbee2mqtt/bridge/state","command_topic":"zigbee2mqtt/0xbc33acfffe62f395/set/child_lock","device":{"identifiers":["zigbee2mqtt_0xbc33acfffe62f395"],"manufacturer":"Moes","model":"Room thermostat water/gas boiler (BHT-002-GCLZB)","name":"0xbc33acfffe62f395","sw_version":"Zigbee2MQTT 1.14.4-dev"},"json_attributes_topic":"zigbee2mqtt/0xbc33acfffe62f395","name":"0xbc33acfffe62f395_child_lock","payload_lock":"LOCK","payload_unlock":"UNLOCK","state_locked":"LOCKED","state_topic":"zigbee2mqtt/0xbc33acfffe62f395","state_unlocked":"UNLOCKED","unique_id":"0xbc33acfffe62f395_child_lock_zigbee2mqtt","value_template":"{{ value_json.child_lock }}"}'
info  2020-09-23 15:37:05: MQTT publish: topic 'homeassistant/climate/0xbc33acfffe62f395/climate/config', payload '{"action_template":"{% set values = {'idle':'off','heat':'heating','cool':'cooling','fan only':'fan'} %}{{ values[value_json.running_state] }}","action_topic":"zigbee2mqtt/0xbc33acfffe62f395","availability_topic":"zigbee2mqtt/bridge/state","current_temperature_template":"{{ value_json.local_temperature }}","current_temperature_topic":"zigbee2mqtt/0xbc33acfffe62f395","device":{"identifiers":["zigbee2mqtt_0xbc33acfffe62f395"],"manufacturer":"Moes","model":"Room thermostat water/gas boiler (BHT-002-GCLZB)","name":"0xbc33acfffe62f395","sw_version":"Zigbee2MQTT 1.14.4-dev"},"json_attributes_topic":"zigbee2mqtt/0xbc33acfffe62f395","max_temp":"30","min_temp":"5","mode_command_topic":"zigbee2mqtt/0xbc33acfffe62f395/set/system_mode","mode_state_template":"{{ value_json.system_mode }}","mode_state_topic":"zigbee2mqtt/0xbc33acfffe62f395","modes":["off","auto","heat"],"name":"0xbc33acfffe62f395_climate","temp_step":1,"temperature_command_topic":"zigbee2mqtt/0xbc33acfffe62f395/set/current_heating_setpoint","temperature_state_template":"{{ value_json.current_heating_setpoint }}","temperature_state_topic":"zigbee2mqtt/0xbc33acfffe62f395","temperature_unit":"C","unique_id":"0xbc33acfffe62f395_climate_zigbee2mqtt"}'
info  2020-09-23 15:37:05: MQTT publish: topic 'homeassistant/sensor/0xbc33acfffe62f395/linkquality/config', payload '{"availability_topic":"zigbee2mqtt/bridge/state","device":{"identifiers":["zigbee2mqtt_0xbc33acfffe62f395"],"manufacturer":"Moes","model":"Room thermostat water/gas boiler (BHT-002-GCLZB)","name":"0xbc33acfffe62f395","sw_version":"Zigbee2MQTT 1.14.4-dev"},"icon":"mdi:signal","json_attributes_topic":"zigbee2mqtt/0xbc33acfffe62f395","name":"0xbc33acfffe62f395_linkquality","state_topic":"zigbee2mqtt/0xbc33acfffe62f395","unique_id":"0xbc33acfffe62f395_linkquality_zigbee2mqtt","unit_of_measurement":"lqi","value_template":"{{ value_json.linkquality }}"}'
info  2020-09-23 15:37:05: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Room thermostat water/gas boiler","friendly_name":"0xbc33acfffe62f395","model":"BHT-002-GCLZB","supported":true,"vendor":"Moes"},"type":"pairing"}'

@poisondima Do you know the DP of the second temperature sensor? I'm sure we can add it and amend the naming to indicate the family instead of a specific model.

Not sure how the HA configuration should be amended for a second temperature, if that is a concern...

@poisondima
Copy link

poisondima commented Sep 23, 2020

@insipiens I have only CC2531, I don't have "Moes zigbee gateway". Of course there are no DP codes. Floor temperature is more important than room temperature, since the room already has xiaomi temperature sensors.
And the buttons in HA do not work for me, I can only set the temperature, I can’t turn the thermostat on or off.
изображение
Thermostat status is always unknown
изображение

@insipiens
Copy link
Contributor Author

There’s an error clause which should show any unknown dp codes, such as a second temperature when the log is set to debug....that should give the code.

@poisondima
Copy link

@insipiens I got such a log, but there are no errors.
Tell me how to turn the thermostat on and off through HA? When I press a physical button on the device, the "running" ON / OFF attribute changes. Also, when the heating relay is turned on, the "heating" ON / OFF attribute changes.
log.zip

@insipiens
Copy link
Contributor Author

insipiens commented Sep 24, 2020

@poisondima , I can make some changes which you can copy. Just a little concerned if your thermostat has different behaviour than mine - without the hub how do you know what functions it has that can be controlled through Zigbee?

On mine it seems to have two ontrollable behaviours:

  • turn (RUNNING = OFF/ON)
  • Turn Program: ON/OFF

Which of those do you want as the buttons? and which button does what out of the permitted system modes in HS [“auto”, “off”, “cool”, “heat”, “dry”, “fan_only”]

The only other function mine has is programming the thermostat but I don't know HA has an interface to do that plus I am sure Z2M cannot handle lengths of hex required.

If you're a github guru you could then handle the PR (I'm new to Github)

Let me know.....

I have changed mine this afternoon so the buttons turn on/off RUNNING, and a preset for PROGRAM Off/ON

@poisondima
Copy link

Need a switch that will turn the device on and off.
If "RUNNING = OFF" then "state" and hvac_modes = off
If "RUNNING = ON" then "state" and hvac_modes = heat, and the attribute "heating: ON / OFF" changes itself depending on the set temperature.
"State" and hvac_modes = auto, should include the schedule set on the device itself, but I see no reason to programming the thermostat there, it is much more convenient to use automations in the Home Assistant.
изображение
hvac_modes: auto, heat, off
I am as new to github as you are. I don't know what "PR" is. I thought maybe you posted it to your repository https://github.com/insipiens/zigbee-herdsman-converters, but the last change there was 22 days ago.

@insipiens
Copy link
Contributor Author

So here is how mine now looks, It's the thermostat when you click the elipse in the top right corner.

  • Operation: turn Off/On [off, heat] (on the normal thermostat view - these are the visible mode buttons) however they seem to just turn the thermostat itself off/on

  • Preset: Hold/Program (equivalent to use manual/use program )

I'll do a little more analysis tonight, if you think it looks acceptable I'll share the code changes with you so you can test it.

on your second temperature issue I don't know how to proceed without access to your model of thermostat.
IMG_1516
IMG_1517

@poisondima
Copy link

@insipiens Where do I get this fix and try it? :)

@insipiens
Copy link
Contributor Author

I'll post it here for you to try later

@insipiens
Copy link
Contributor Author

I have included the surrounding coding for the device as well as the change made, make backups of each file before changing...

3 files need changing, I've arranged the coding sections below as follows.
description of change
Format....filelocation/filename
code snippet

Hope its clear........YAML is very particular about the indentation used. Best of luck :)

changed the parameters of the climate configuration section for device BHT-002-GCLZB that generates the HA thermostat

file location: opt/zigbee2mqtt/lib/extension/homeassisant.js

    'BHT-002-GCLZB': [cfg.lock_child_lock, climate(5, 30, 'current_heating_setpoint', 1, ['off', 'heat'], [], ['hold', 'program']),
    ],

Added 2 converters to the device.js file - tz.moes_thermostat_mode, tz.moes_thermostat_standby
/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/devices.js

    {
        fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_aoclfnxz'}],
        model: 'BHT-002-GCLZB',
        vendor: 'Moes',
        description: 'Moes BHT series Thermostat',
        supports: 'thermostat, temperature',
        fromZigbee: [fz.moes_thermostat],
        toZigbee: [tz.moes_thermostat_child_lock, tz.moes_thermostat_current_heating_setpoint, tz.moes_thermostat_mode, tz.moes_thermostat_standby],
    },

Added the two converters >> moes_thermostat_mode & moes_thermostat_standby
/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/converters/toZigbee.js

    moes_thermostat_child_lock: {
        key: ['child_lock'],
        convertSet: async (entity, key, value, meta) => {
            sendTuyaCommand(entity, 296, 0, [1, value==='LOCK' ? 1 : 0]);
        },
    },
    moes_thermostat_current_heating_setpoint: {
        key: ['current_heating_setpoint'],
        convertSet: async (entity, key, value, meta) => {
            const temp = value;
            const payloadValue = utils.convertDecimalValueTo2ByteHexArray(temp);
            sendTuyaCommand(entity, 528, 0, [4, 0, 0, ...payloadValue]);
        },
    },
    moes_thermostat_mode: {
        key: ['preset'],
        convertSet: async (entity, key, value, meta) => {
            sendTuyaCommand(entity, 1026, 0, [1, value === 'hold' ? 0 : 1]);
            sendTuyaCommand(entity, 1027, 0, [1, value === 'program' ? 0 : 1]);
        },
    },
    moes_thermostat_standby: {
        key: ['system_mode'],
        convertSet: async (entity, key, value, meta) => {
            sendTuyaCommand(entity, 257, 0, [1, value === 'off' ? 0 : 1]);
        },
    },

@insipiens
Copy link
Contributor Author

Ah, also....on reading the instructions for mine, but they cover all models, it mentions that the floor temperature can be displayed by holding the temperature down button for 5 seconds. I wonder if that would create the missing DP code in the log?

@poisondima
Copy link

Thank! Now at least I can turn the thermostat on and off!
The thermostat state still does not change to "off / heat" shows "unknown", so it does not display the operating mode.
Changing presets works: if I choose hold, the manual mode is turned on, if I choose program, the schedule mode is turned on. But, like the state, it does not remember and when opening these values are always empty.
изображение
Probably does not save values due to the same attributes: "preset_mode" and "preset_modes".
изображение
I know and tried to hold the button for 5 seconds to display the floor temperature, it shows the temperature on the screen, but does not send new DP codes.
In any case, thanks again for the help and the work done!

@insipiens
Copy link
Contributor Author

I’ll check the preset memory issue, would be a shame for leaving a little left not done.

Cheers

@Minims
Copy link

Minims commented Mar 7, 2021

What about adding a 10K numeric resistor as External Sensor ?
Then you can update via WIFI ou something else the resistor value to define the current temperature of an other room.

@juan11perez
Copy link

@insipiens
Good day. I've effectively copied the work in here and made a minor variation to get this coil unit cooling thermostat paired and it works as expected. So thank you.

In the device notes I saw the debounce: 1 recommendation to stop spamming. I've implemented it, but it doesn't seem to work.
Any action is followed by 20 or 30 messages similar to below:

Received Zigbee message from 'thermostat_05', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[0,0,0,24],"type":"Buffer"},"datatype":2,"dp":16,"fn":0,"status":0,"transid":115}' from endpoint 1 with groupID 0

Any advice is much appreciated.

@insipiens
Copy link
Contributor Author

@insipiens
Good day. I've effectively copied the work in here and made a minor variation to get this coil unit cooling thermostat paired and it works as expected. So thank you.

In the device notes I saw the debounce: 1 recommendation to stop spamming. I've implemented it, but it doesn't seem to work.
Any action is followed by 20 or 30 messages similar to below:

Received Zigbee message from 'thermostat_05', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[0,0,0,24],"type":"Buffer"},"datatype":2,"dp":16,"fn":0,"status":0,"transid":115}' from endpoint 1 with groupID 0

Any advice is much appreciated.

Well, a few things to unpack here.

  1. Firstly this is the programming of the firmware by Tuya/Moes that causes the multiple messages, and is likely by design. The relay that switches on/off the heating is triggered some time after the zigbee command is received - presumably it was easier (or in a way more lazy programming) to just spam the status of the relay long enough that it will capture the changed status. If you check the messages you will see the status changes at some point mid-spam.

  2. by using debounce I sometimes found it didn't always report the status change - but that was a few versions of Z2M ago and probably doesn't happen now

  3. I didn't add the debounce info to the devices page - in fact I am so lazy I didn't add any of that info :)

  4. All my radiators have smart TRVs now, the thermostat is a necessary evil for me being wired into my central heating. As such I have written an automation that effectively makes it a dumb switch controlled by the radiators' as a "call for heat" . Because of this I have applied a debounce like the following, so when checking logs I don't have the messages to look through....if you're using it more critically then check the status message is still seen.


  '0x00000000000':
    friendly_name: Moes_Room_Thermostat
    debounce: 0.5

And I get only two messages in the log.



Zigbee2MQTT:info  2021-03-28 20:58:54: MQTT publish: topic 'zigbee2mqtt/Moes_Room_Thermostat', payload '{"current_heating_setpoint":16,"heat":"OFF","last_seen":"2021-03-28T20:58:53+01:00","linkquality":81,"local_temperature":15.5,"preset":"hold","preset_mode":"hold","sensor":"IN","system_mode":"heat"}',
Zigbee2MQTT:info  2021-03-28 20:59:01: MQTT publish: topic 'zigbee2mqtt/Moes_Room_Thermostat', payload '{"current_heating_setpoint":16,"heat":"ON","last_seen":"2021-03-28T20:59:00+01:00","linkquality":81,"local_temperature":15.5,"preset":"hold","preset_mode":"hold","sensor":"IN","system_mode":"heat"}'

@juan11perez
Copy link

@insipiens thank you very much for your time and feedback.

@aegjoyce
Copy link

Has anyone else had the issue of these thermostats crashing? Mine are doing it about once every week or two, when it happens it's always exactly when a temperature change command has been issued. The thermostat then 'reports' a temperature of 6550 degrees C (!) whilst the screen goes blank and the backlight turns on. It goes completely unresponsive after this and requires mains power off-on to fix.

I'm pretty convinced it's a communications issue, going to work through resetting them and re-adding to the network, trying them without being connected to zigbee, etc - just interested if anyone else has had this problem?

@insipiens
Copy link
Contributor Author

Has anyone else had the issue of these thermostats crashing? Mine are doing it about once every week or two, when it happens it's always exactly when a temperature change command has been issued. The thermostat then 'reports' a temperature of 6550 degrees C (!) whilst the screen goes blank and the backlight turns on. It goes completely unresponsive after this and requires mains power off-on to fix.

Occasionally I had this but not recently and certainly not as frequent as weekly. It was, in my case, some mis-reading of the temp and was easily resolved by setting a new temp.

What Z2M version you currently using?

@aegjoyce
Copy link

Has anyone else had the issue of these thermostats crashing? Mine are doing it about once every week or two, when it happens it's always exactly when a temperature change command has been issued. The thermostat then 'reports' a temperature of 6550 degrees C (!) whilst the screen goes blank and the backlight turns on. It goes completely unresponsive after this and requires mains power off-on to fix.

Occasionally I had this but not recently and certainly not as frequent as weekly. It was, in my case, some mis-reading of the temp and was easily resolved by setting a new temp.

What Z2M version you currently using?

1.18.1

Unfortunately when they become unresponsive that's it - can't set a new temp or interact with them in any way. Power off-on is the only fix.

I have unpaired, deleted all reference to them in states.json, database.db etc. and re-paired. Have also turned off debounce in case that was causing issues. Will see how we get on.

@insipiens
Copy link
Contributor Author

I guess if this has been happening for over a month then it probably won’t be version related.

would be interesting to know your findings ....👍

@Minims
Copy link

Minims commented Mar 31, 2021

don't you try to set wrong temp such as .5, 19.5 for ie ?

@aegjoyce
Copy link

don't you try to set wrong temp such as .5, 19.5 for ie ?

Nope. Only integers.

@Minims
Copy link

Minims commented Mar 31, 2021

Nope. Only integers.

And between 5-35 °C I suppose.

I can only reproduce while setting a wrong temp on my side.

@insipiens
Copy link
Contributor Author

@aegjoyce

Alasdair, I completely forgot but a PR was submitted in February

Koenkk/zigbee-herdsman-converters#2268

I don't know if that is related to your issue, either solves it or otherwise?

Insipiens

@aegjoyce
Copy link

aegjoyce commented Apr 1, 2021

@aegjoyce

Alasdair, I completely forgot but a PR was submitted in February

Koenkk/zigbee-herdsman-converters#2268

I don't know if that is related to your issue, either solves it or otherwise?

Insipiens

I mean, that sounds like exactly the problem! And I wouldn’t have had it fixed until now because I was using custom converters to fix the clock problem.

Since recent updates, moving away from custom converters, and re-pairing my thermostats all has been ok (but still less than 48hrs!)

EDIT: it crashed again, but that's fine - I'm on Z2M 1.18.1 which uses herdsman-converters 14.0.72. The fix is in 14.0.78, hence why I'm still getting crashes. Z2M 1.18.2 uses herdsman-converters 14.0.102 which includes all fixes plus a load of other nice features so I will be patient for the next release :)

@zinserjan
Copy link

@aegjoyce I have exactly the same problem since a few weeks with my 002GBLZB ... Unresponsive white screen until full reboot via power off :(

I'm using the thermostat since #5154 was fixed. The thermostat was stable for about one month and then the crashing has begun. Sometimes daily, sometimes every week...

I noticed that the internal temperature local_temperature was always negative (e.g. -2.9) before the device crashed. I initially thought that this may be the reason for crashing. To workaround this negative tempeature issue I used the external temperature sensor. Since then the negative temperature readings are gone, but the device is still crashing..,

Next step was to verify that my heating control script isn't the cause for this. That's why installed another version of this thermostat (002GALZB) next to the other and both thermostats are receiving the same commands.

The funny thing is, that the original device never crashed again since the 2nd device was installed. Instead the 2nd device crashes every week...

@insipiens
Copy link
Contributor Author

I’m still on 1.17.1 and it’s fine for me, but is there some specific scenario which seems common to this...such as the temperature sensor reading values outside the normal range?

@insipiens
Copy link
Contributor Author

Btw its always useful to read the release notes for versions - often there can be multiple PRs for a device and if you’re experiencing problems you’re often the best person to try solving it by backing out to a previous working version and experimenting with scenarios that might cause the error this is just a comment and not meant as chiding at all 🙏🏼

@odelma
Copy link

odelma commented Jan 1, 2023

Thanks all for help. Thinks it dead end for me whis underfloor heating. WiFi version whis side firmware is more comfortable and have all sensors and settings.

Hi, is it really so that in the zigbee version of this device the floow temperature is not readable in any way? Does the device still follow it in some way?

edit: seems changing the sensor type (IN, AU, OU) will affect which sensor is reported. I was surprised of this as the wifi version reports both. Is it so that not even the Tuya zigbee hub can show both temps for these?

@insipiens
Copy link
Contributor Author

insipiens commented Jan 1, 2023

edited
#4185 (comment)

I noticed this happening on mine now, oddly it was fine last winter but a few things have changed - newer version of z2m, changed heating automation I created.

Happens when the heating timer (a Honeywell programmable timer) switches on the central heating. the thermostat shows -1.9 degrees and is unresponsive. I have to bounce the heating power and then it starts normally.

Weird thing is it's inconsistent, some mornings its fine......my initial assumption is the thermostat might be faulty. Z2M wouldn't be at fault and switching the power shouldn't cause an issue unless the device can't handle it....

@asdfghjkai
Copy link

I’ve been watching this issue for a while @insipiens and have the same with mine. Tempted to go for a replacement or flash the Wi-Fi model.

Like you say there’s no rhyme or reason to the cause of the failure mode except the same symptoms. -2.9°C reported. Backlight on. Screen blank. I’ve got an automation set to trigger a notification in HA on failure so I can power cycle the heating circuit. Not so useful when I’m asleep though.

Sometimes it fails multiple times a day, other times it’s weeks or months between. I think there is an increase in failures following increased interaction though. Might be a misnomer though.

I’ve got two thermostats, and both have the same issue albeit at separate times.

@alienatedsec
Copy link

The crashing issue has not occurred to me yet, but I am slightly annoyed with the temperature changes when those are 'hold/manually' set. It keeps adjusting itself as per the screenshot. The spikes are when I change it manually, and it keeps knocking it down systematically. Does anyone experience the same issue?

image

Also, I noticed that I cannot get into System Function Settings as per the below:
image

@asdfghjkai
Copy link

Not had that issue myself. Mine looks like the attached (30° spikes are caused by an automation when heat is detected as required elsewhere in the house)

Is it in manual mode, again, I’ve got an automation to keep it there.

alias: "Heating - Thermostats: If Thermostats are Set To Program, Revert to Hold"
description: ""
trigger:
  - platform: state
    entity_id: climate.livingroomthermostat
    attribute: preset
    to: program
  - platform: state
    entity_id: climate.homethermostat
    to: program
    attribute: preset
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: climate.livingroomthermostat
            state: program
            attribute: preset
        sequence:
          - service: climate.set_preset_mode
            target:
              device_id: 22569e368040e8f86549840cfb6027e7
            data:
              preset_mode: hold
          - service: homeassistant.update_entity
            target:
              device_id: 22569e368040e8f86549840cfb6027e7
            data: {}
      - conditions:
          - condition: state
            entity_id: climate.homethermostat
            state: program
            attribute: preset
        sequence:
          - service: climate.set_preset_mode
            data:
              preset_mode: hold
            target:
              device_id: 81957df46e8d0f5ae5636feb8d3941cc
          - service: homeassistant.update_entity
            target:
              device_id: 81957df46e8d0f5ae5636feb8d3941cc
            data: {}
    default: []
mode: queued
max: 5

5B688024-9CB4-4859-9128-4611AF19C5DA
5AB871E3-7A0D-473A-A4D5-7638C973D115

@odelma
Copy link

odelma commented Jan 24, 2023

The spikes are when I change it manually, and it keeps knocking it down systematically. Does anyone experience the same issue?

Sounds like device does not send update to controller and controller reverts it back to last temp it still holds on the next update 🤔

This coupled with the settings problem makes it sound like a faulty unit?

@alienatedsec
Copy link

alienatedsec commented Jan 24, 2023

@odelma

Sounds like device does not send update to controller and controller reverts it back to last temp it still holds on the next update 🤔

I think I figured it out after several hours of testing. There are some issues with the capacitive button as it activates itself randomly. It works perfectly when I turn the 'child lock' ON. The capacitive button in question is the 'arrows down' that activates randomly and for no reason, and it drops the set temperature if it activates too many times at short intervals - 1st to show the set temp and then shortly after to drop it down. As you can see on my graphs, it activates several times in the space of several hours.

This coupled with the settings problem makes it sound like a faulty unit?

This one could be related to something intentionally done by MOES. I noticed I have the latest hardware iteration where the touch buttons controller is on-chip rather than the old version where it was a separate IC. I found the reference in this video https://youtu.be/JPWpryQ2m6I?t=810

The board from 2021 found in the video
image

and my v4 board below:
image

I reckon they disabled access to this function (to enforce buying a hub) or the unit is faulty as you suggested.

@brettcollis2212
Copy link

@odelma

Sounds like device does not send update to controller and controller reverts it back to last temp it still holds on the next update 🤔

I think I figured it out after several hours of testing. There are some issues with the capacitive button as it activates itself randomly. It works perfectly when I turn the 'child lock' ON. The capacitive button in question is the 'arrows down' that activates randomly and for no reason, and it drops the set temperature if it activates too many times at short intervals - 1st to show the set temp and then shortly after to drop it down. As you can see on my graphs, it activates several times in the space of several hours.

This coupled with the settings problem makes it sound like a faulty unit?

This one could be related to something intentionally done by MOES. I noticed I have the latest hardware iteration where the touch buttons controller is on-chip rather than the old version where it was a separate IC. I found the reference in this video https://youtu.be/JPWpryQ2m6I?t=810

The board from 2021 found in the video image

and my v4 board below: image

I reckon they disabled access to this function (to enforce buying a hub) or the unit is faulty as you suggested.

I've also had this exact same issue with my Thermostat, I've been wondering for weeks why it would change modes and temperature all by itself.

@alienatedsec
Copy link

@brettcollis2212 I checked Amazon UK and some recent comments are the same. It looks like the latest batch is faulty and should be avoided at all costs.

@odelma
Copy link

odelma commented Jan 26, 2023

So the symptom of a faulty unit is that it changes setpoint by itself? Luckily haven’t seen this yet on my devices bought in 10/2022. Is there some serial number or something to identify the faulty batches?

@alienatedsec
Copy link

Is there some serial number or something to identify the faulty batches?

image

@odelma So far, I only identified this board and its version written at the top 002_WIFI_20220426_V4

I have one more thermostat to be delivered shortly, and I will check its version and report back.

@insipiens
Copy link
Contributor Author

I’ve been watching this issue for a while @insipiens and have the same with mine. Tempted to go for a replacement or flash the Wi-Fi model.

Like you say there’s no rhyme or reason to the cause of the failure mode except the same symptoms. -2.9°C reported. Backlight on. Screen blank. I’ve got an automation set to trigger a notification in HA on failure so I can power cycle the heating circuit. Not so useful when I’m asleep though.

Sometimes it fails multiple times a day, other times it’s weeks or months between. I think there is an increase in failures following increased interaction though. Might be a misnomer though.

I’ve got two thermostats, and both have the same issue albeit at separate times.

I have a small update based on observation:

  1. The device hangs if the power is cut to the heating system the previous night i.e the heating timer/programmer turns off the heating circuit
  2. If I turn the Moes thermostat off before the timer turns off then it always starts
  3. the "-1.9" degrees is coincidental - probably the internal sensor default when no power

So, imo poor Moes/Tuya programming, but turning the thermostat off before the heating each night has resolved the problem for me.

One gets what one pays for - ha....

image of -1.9 every morning when heating circuit is powered up:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests