Tuya ZWT198 wall thermostat, state missing from devices

Xiaomi, Ikea TRÅDFRI, Philips Hue and more.

Moderator: leecollings

Post Reply
clumpton
Posts: 31
Joined: Saturday 18 January 2020 13:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France
Contact:

Tuya ZWT198 wall thermostat, state missing from devices

Post by clumpton »

Hi,
I have just purchased a Tuya ZWT198 wall thermostat.
This appears to be well supported by zigbee2MQTT, however one state value does not get picked up in Domoticz.
Here are the states as seen in Zigbee2MQTT:

Code: Select all

{
    "backlight_mode": "high",
    "child_lock": "UNLOCK",
    "current_heating_setpoint": 22.5,
    "deadzone_temperature": 0.5,
    "factory_reset": "OFF",
    "frost_protection": "ON",
    "linkquality": 90,
    "local_temperature": 22.5,
    "local_temperature_calibration": 0.1,
    "max_temperature_limit": 29.5,
    "preset": "auto",
    "running_state": "heat",
    "schedule_holiday": "07:00/22.0°C 23:00/18.5°C",
    "schedule_weekday": "06:00/21.5°C 08:00/22.5°C 11:30/21.0°C 12:30/22.0°C 17:00/22.0°C 22:00/18.5°C",
    "sensor": "internal",
    "system_mode": "heat",
    "working_day": "7"
}
From the above I would like to have access to "running_state" which swaps between "idle" and "heat" according to whether the boiler has been turned off or on by the thermostat. However this does not appear in the available devices in Domoticz. It definitely appears in the published data, viz:

Code: Select all

info 2025-04-15 09:27:45z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/New Lounge Thermostat', payload '{"backlight_mode":"high","child_lock":"UNLOCK","current_heating_setpoint":22.5,"deadzone_temperature":0.5,"factory_reset":"OFF","frost_protection":"ON","linkquality":93,"local_temperature":22.5,"local_temperature_calibration":0.1,"max_temperature_limit":29.5,"preset":"auto","running_state":"heat","schedule_holiday":"07:00/22.0°C 23:00/18.5°C","schedule_weekday":"06:00/21.5°C 08:00/22.5°C 11:30/21.0°C 12:30/22.0°C 17:00/22.0°C 22:00/18.5°C","sensor":"internal","system_mode":"heat","working_day":"7"}'
I can't see any errors in any of the logs, has anyone any idea where to look?

Domoticz Version: 2025.1 (build 16626)
Zigbee2MQTT Version 2.1.1
Thanks in advance
clumpton
Posts: 31
Joined: Saturday 18 January 2020 13:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France
Contact:

Re: Tuya ZWT198 wall thermostat, state missing from devices

Post by clumpton »

Addendum:
I have updated Zigbee2MQTT to 2.2.1 with the associated herdsman updates. (Much fussing about getting pnpm to work due to missing version 10.4.1).
This has made no difference at all, as shown by the Domoticz log where running_state is not found by MQTT Auto Discovery after a restart:

Code: Select all

2025-04-15 18:11:28.587 Status: MQTT Auto: Discovered: New Lounge Thermostat (Factory reset)/New Lounge Thermostat (Factory reset) (unique_id: 0xa4c138948f5233eb_switch_factory_reset_zigbee2mqtt)
2025-04-15 18:11:28.691 Status: MQTT Auto: Discovered: New Lounge Thermostat (Child lock)/New Lounge Thermostat (Child lock) (unique_id: 0xa4c138948f5233eb_switch_child_lock_zigbee2mqtt)
2025-04-15 18:11:28.794 Status: MQTT Auto: Discovered: New Lounge Thermostat (Sensor)/New Lounge Thermostat (Sensor) (unique_id: 0xa4c138948f5233eb_sensor_zigbee2mqtt)
2025-04-15 18:11:28.898 Status: MQTT Auto: Discovered: New Lounge Thermostat/New Lounge Thermostat (unique_id: 0xa4c138948f5233eb_local_temperature_calibration_zigbee2mqtt)
2025-04-15 18:11:29.001 Status: MQTT Auto: Discovered: New Lounge Thermostat/New Lounge Thermostat (unique_id: 0xa4c138948f5233eb_climate_zigbee2mqtt)
2025-04-15 18:11:29.106 Status: MQTT Auto: Discovered: New Lounge Thermostat (Frost protection)/New Lounge Thermostat (Frost protection) (unique_id: 0xa4c138948f5233eb_switch_frost_protection_zigbee2mqtt)
2025-04-15 18:11:29.210 Status: MQTT Auto: Discovered: New Lounge Thermostat (Max temperature limit)/New Lounge Thermostat (Max temperature limit) (unique_id: 0xa4c138948f5233eb_max_temperature_limit_zigbee2mqtt)
2025-04-15 18:11:29.312 Status: MQTT Auto: Discovered: New Lounge Thermostat (Deadzone temperature)/New Lounge Thermostat (Deadzone temperature) (unique_id: 0xa4c138948f5233eb_deadzone_temperature_zigbee2mqtt)
2025-04-15 18:11:29.415 Status: MQTT Auto: Discovered: New Lounge Thermostat (Backlight mode)/New Lounge Thermostat (Backlight mode) (unique_id: 0xa4c138948f5233eb_backlight_mode_zigbee2mqtt)
2025-04-15 18:11:29.519 Status: MQTT Auto: Discovered: New Lounge Thermostat (Working day)/New Lounge Thermostat (Working day) (unique_id: 0xa4c138948f5233eb_working_day_zigbee2mqtt)
2025-04-15 18:11:29.622 Status: MQTT Auto: Discovered: New Lounge Thermostat (Schedule weekday)/New Lounge Thermostat (Schedule weekday) (unique_id: 0xa4c138948f5233eb_schedule_weekday_zigbee2mqtt)
2025-04-15 18:11:29.724 Status: MQTT Auto: Discovered: New Lounge Thermostat (Schedule holiday)/New Lounge Thermostat (Schedule holiday) (unique_id: 0xa4c138948f5233eb_schedule_holiday_zigbee2mqtt) 
Still confused....
User avatar
waltervl
Posts: 5852
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Tuya ZWT198 wall thermostat, state missing from devices

Post by waltervl »

Is zigbee2mqtt publishing a config topic for the missing device? Domoticz is creating devices based on the config topic. When you look with for example program mqtt explorer you should see config topics in the homeassistant folder in a switch or sensor subfolder/topic. See also wiki page for an example https://wiki.domoticz.com/MQTT_AD_Report_Problems
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
clumpton
Posts: 31
Joined: Saturday 18 January 2020 13:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France
Contact:

Re: Tuya ZWT198 wall thermostat, state missing from devices

Post by clumpton »

Is zigbee2mqtt publishing a config topic for the missing device?
Thanks for the hint.

Here's what I see :

Code: Select all

homeassistant/climate/0xa4c138948f5233eb/climate/config

Code: Select all

{
  "action_template": "{% set values = {None:None,'idle':'idle','heat':'heating','cool':'cooling','fan_only':'fan'} %}{{ values[value_json.running_state] }}",
  "action_topic": "zigbee2mqtt/New Lounge Thermostat",
  "availability": [
    {
      "topic": "zigbee2mqtt/bridge/state",
      "value_template": "{{ value_json.state }}"
    }
  ],
  "current_temperature_template": "{{ value_json.local_temperature }}",
  "current_temperature_topic": "zigbee2mqtt/New Lounge Thermostat",
  "device": {
    "hw_version": 1,
    "identifiers": [
      "zigbee2mqtt_0xa4c138948f5233eb"
    ],
    "manufacturer": "Tuya",
    "model": "Wall thermostat",
    "model_id": "ZWT198/ZWT100-BH",
    "name": "New Lounge Thermostat",
    "via_device": "zigbee2mqtt_bridge_0x00124b001cde54dc"
  },
  "max_temp": "35",
  "min_temp": "5",
  "mode_command_topic": "zigbee2mqtt/New Lounge Thermostat/set/system_mode",
  "mode_state_template": "{{ value_json.system_mode }}",
  "mode_state_topic": "zigbee2mqtt/New Lounge Thermostat",
  "modes": [
    "off",
    "heat"
  ],
  "name": null,
  "object_id": "new_lounge_thermostat",
  "origin": {
    "name": "Zigbee2MQTT",
    "sw": "2.2.1-dev",
    "url": "https://www.zigbee2mqtt.io"
  },
  "preset_mode_command_topic": "zigbee2mqtt/New Lounge Thermostat/set/preset",
  "preset_mode_state_topic": "zigbee2mqtt/New Lounge Thermostat",
  "preset_mode_value_template": "{{ value_json.preset }}",
  "preset_modes": [
    "manual",
    "auto",
    "temporary_manual"
  ],
  "temp_step": 0.5,
  "temperature_command_topic": "zigbee2mqtt/New Lounge Thermostat/set/current_heating_setpoint",
  "temperature_state_template": "{{ value_json.current_heating_setpoint }}",
  "temperature_state_topic": "zigbee2mqtt/New Lounge Thermostat",
  "temperature_unit": "C",
  "unique_id": "0xa4c138948f5233eb_climate_zigbee2mqtt"
}
It looks like there could be a missing topic for "running_state"?
Many thanks for any help.
Should I be posting this on Github, rather than here?
User avatar
waltervl
Posts: 5852
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Tuya ZWT198 wall thermostat, state missing from devices

Post by waltervl »

If it is missing in the config topic it is a Zigbee2MQTT issue, not a Domoticz issue.

You could perhaps try to update to latest beta as some things have changed in Zigbee2MQTT from 1,x to 2.x regarding device automation. And you need to be on latest Domoticz beta to use this new functionality.
Perhaps this is related (I am not an expert on this subject).
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
clumpton
Posts: 31
Joined: Saturday 18 January 2020 13:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France
Contact:

Re: Tuya ZWT198 wall thermostat, state missing from devices

Post by clumpton »

I have just created an issue on Github.
https://github.com/domoticz/domoticz/issues/6309
User avatar
waltervl
Posts: 5852
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Tuya ZWT198 wall thermostat, state missing from devices

Post by waltervl »

clumpton wrote: Wednesday 16 April 2025 10:39 I have just created an issue on Github.
https://github.com/domoticz/domoticz/issues/6309
If the topic is missing nothing Domoticz can do about this. You have to create an issue on the Zigbee2MQTT repository. Or search for similar issue there
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
clumpton
Posts: 31
Joined: Saturday 18 January 2020 13:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France
Contact:

Re: Tuya ZWT198 wall thermostat, state missing from devices

Post by clumpton »

According to Koenkk (the zigbee2mqtt guy) this part of the "climate" value should be picked up by Domoticz.

Code: Select all

"action_template": "{% set values = {None:None,'idle':'idle','heat':'heating','cool':'cooling','fan_only':'fan'} %}{{ values[value_json.running_state] }}"
See https://github.com/Koenkk/zigbee2mqtt/issues/27131
User avatar
waltervl
Posts: 5852
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Tuya ZWT198 wall thermostat, state missing from devices

Post by waltervl »

Then you should try to update to latest beta of Domoticz as some MQTT AD improvements are implemented there.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest