zha-device-handlers
zha-device-handlers copied to clipboard
Avatto_me167 / TZE200_bvu2wnxz TS0601
Is your feature request related to a problem? Please describe. I bought 5 ZigBee Thermostatic Radiator Valves but they are not recognized properly in ZHA. Running ZHA with conbee II stick
Describe the solution you'd like ZHA support for TZE200_bvu2wnxz TS0601
Device signature
{
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": 260,
"device_type": "0x0051",
"in_clusters": [
"0x0000",
"0x0004",
"0x0005",
"0xef00"
],
"out_clusters": [
"0x000a",
"0x0019"
]
}
},
"manufacturer": "_TZE200_bvu2wnxz",
"model": "TS0601",
"class": "zigpy.device.Device"
}
Diagnostic information
{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2022.10.2",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.10.5",
"docker": true,
"arch": "x86_64",
"timezone": "Europe/Oslo",
"os_name": "Linux",
"os_version": "5.15.67",
"supervisor": "2022.10.0",
"host_os": "Home Assistant OS 9.0",
"docker_version": "20.10.17",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"fullykiosk": {
"version": "1.1.0",
"requirements": [
"python-fullykiosk==0.0.11"
]
},
"scheduler": {
"version": "v0.0.0",
"requirements": []
},
"hacs": {
"version": "1.28.0",
"requirements": [
"aiogithubapi>=22.2.4"
]
},
"localtuya": {
"version": "4.1.0",
"requirements": []
},
"smartthinq_sensors": {
"version": "0.24.2",
"requirements": [
"pycountry>=20.7.3",
"xmltodict>=0.12.0",
"cchardet>=2.1.7"
]
},
"tahoma": {
"version": "2.13.0",
"requirements": [
"pyoverkiz==1.3.6"
]
}
},
"integration_manifest": {
"domain": "zha",
"name": "Zigbee Home Automation",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/zha",
"requirements": [
"bellows==0.34.2",
"pyserial==3.5",
"pyserial-asyncio==0.6",
"zha-quirks==0.0.82",
"zigpy-deconz==0.19.0",
"zigpy==0.51.3",
"zigpy-xbee==0.16.1",
"zigpy-zigate==0.10.1",
"zigpy-znp==0.9.1"
],
"usb": [
{
"vid": "10C4",
"pid": "EA60",
"description": "*2652*",
"known_devices": [
"slae.sh cc2652rb stick"
]
},
{
"vid": "1A86",
"pid": "55D4",
"description": "*sonoff*plus*",
"known_devices": [
"sonoff zigbee dongle plus v2"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*sonoff*plus*",
"known_devices": [
"sonoff zigbee dongle plus"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*tubeszb*",
"known_devices": [
"TubesZB Coordinator"
]
},
{
"vid": "1A86",
"pid": "7523",
"description": "*tubeszb*",
"known_devices": [
"TubesZB Coordinator"
]
},
{
"vid": "1A86",
"pid": "7523",
"description": "*zigstar*",
"known_devices": [
"ZigStar Coordinators"
]
},
{
"vid": "1CF1",
"pid": "0030",
"description": "*conbee*",
"known_devices": [
"Conbee II"
]
},
{
"vid": "10C4",
"pid": "8A2A",
"description": "*zigbee*",
"known_devices": [
"Nortek HUSBZB-1"
]
},
{
"vid": "0403",
"pid": "6015",
"description": "*zigate*",
"known_devices": [
"ZiGate+"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*zigate*",
"known_devices": [
"ZiGate"
]
},
{
"vid": "10C4",
"pid": "8B34",
"description": "*bv 2010/10*",
"known_devices": [
"Bitron Video AV2010/10"
]
}
],
"codeowners": [
"@dmulcahey",
"@adminiuga",
"@puddly"
],
"zeroconf": [
{
"type": "_esphomelib._tcp.local.",
"name": "tube*"
},
{
"type": "_zigate-zigbee-gateway._tcp.local.",
"name": "*zigate*"
},
{
"type": "_zigstar_gw._tcp.local.",
"name": "*zigstar*"
}
],
"dependencies": [
"file_upload"
],
"after_dependencies": [
"onboarding",
"usb",
"zeroconf"
],
"iot_class": "local_polling",
"loggers": [
"aiosqlite",
"bellows",
"crccheck",
"pure_pcapy3",
"zhaquirks",
"zigpy",
"zigpy_deconz",
"zigpy_xbee",
"zigpy_zigate",
"zigpy_znp"
],
"is_built_in": true
},
"data": {
"ieee": "**REDACTED**",
"nwk": 1039,
"manufacturer": "_TZE200_bvu2wnxz",
"model": "TS0601",
"name": "_TZE200_bvu2wnxz TS0601",
"quirk_applied": false,
"quirk_class": "zigpy.device.Device",
"manufacturer_code": 4098,
"power_source": "Battery or Unknown",
"lqi": 255,
"rssi": -52,
"last_seen": "2022-10-10T21:54:49",
"available": true,
"device_type": "EndDevice",
"signature": {
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": 260,
"device_type": "0x0051",
"in_clusters": [
"0x0000",
"0x0004",
"0x0005",
"0xef00"
],
"out_clusters": [
"0x000a",
"0x0019"
]
}
}
},
"active_coordinator": false,
"entities": [],
"neighbors": [],
"endpoint_names": [
{
"name": "SMART_PLUG"
}
],
"user_given_name": null,
"device_reg_id": "7690cf5b3470d5c4d12e1a1ebe29116c",
"area_id": "470a6d223c514495b1a20eedbb94db8f",
"cluster_details": {
"1": {
"device_type": {
"name": "SMART_PLUG",
"id": 81
},
"profile_id": 260,
"in_clusters": {
"0x0000": {
"endpoint_attribute": "basic",
"attributes": {
"0x0001": {
"attribute_name": "app_version",
"value": 65
},
"0x0004": {
"attribute_name": "manufacturer",
"value": "_TZE200_bvu2wnxz"
},
"0x0005": {
"attribute_name": "model",
"value": "TS0601"
}
},
"unsupported_attributes": {}
},
"0x0004": {
"endpoint_attribute": "groups",
"attributes": {},
"unsupported_attributes": {}
},
"0x0005": {
"endpoint_attribute": "scenes",
"attributes": {},
"unsupported_attributes": {}
},
"0xef00": {
"endpoint_attribute": null,
"attributes": {},
"unsupported_attributes": {}
}
},
"out_clusters": {
"0x0019": {
"endpoint_attribute": "ota",
"attributes": {},
"unsupported_attributes": {}
},
"0x000a": {
"endpoint_attribute": "time",
"attributes": {},
"unsupported_attributes": {}
}
}
}
}
}
}
Additional logs
Paste any additional debug logs here.
Don't remove the extra line breaks outside the ``` marks.
Additional context Link to device: https://www.alibaba.com/product-detail/Tuya-Version-Wi-Fi-ZIGBEE-Smart_1600398708828.html https://www.aliexpress.com/i/1005003468882163.html
The signature can match to any of that quirks:
- SiterwellGS361_Type2
- MoesHY368_Type1
- _TZE200_b6wax7g0
- ZonnsmartTV01_ZG
- Thermostat_TZE200_c88teujp
All is using the same tuya Zigbe-MCU modules (_TYST11 / _TZE200) and cant only being identified by the design if the manufacture not have doing one change of the MCU firmware.
From my first point of view is one clone of the:
Saswell | SEA802 | _TZE200_c88teujp | TS0601 | ✅ Sas I 🥇 | 576 |
---|
Also Z2M was adding it in april as one Saswell and deleting it in august for adding it agen for 10 hours as one Zonnsmart.
Zonnsmart | TV01-ZG | _TZE200_e9ba97vf | TS0601 | ✅ ZS | 983 |
---|
Must testing witch is working OK but i think the last is the right the the Sas is little old and not updated and the new have little updated hardware design.
Also 2 different box names for it around for it AVATTO TRV06 (Z2M) and MYUET ME167 (DE).
Thanx for the update! Is there a step by step user guide on how to implement this an easy way?
There is a good guide to create your local quirk:
- https://github.com/zigpy/zha-device-handlers/discussions/693#discussioncomment-857274
You need to copy the ts0601_trv.py
file to your local zha_quirk folder and edit the content:
- https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/ts0601_trv.py
At the ZonnsmartTV01_ZG
edit the MODELS_INFO
adding your device:
MODELS_INFO: [
("_TZE200_7yoranx2", "TS0601"), # MOES TRV TV01 ZTRV-ZX-TV01-MS
("_TZE200_bvu2wnxz", "TS0601"),
("_TZE200_e9ba97vf", "TS0601"),
("_TZE200_hue3yfsn", "TS0601"), # TV02-ZG
("_TZE200_husqqvux", "TS0601"),
("_TZE200_kly8gjlz", "TS0601"),
("_TZE200_lnbfnyxd", "TS0601"),
("_TZE200_mudxchsu", "TS0601"),
],
Restart HA, and pair your device again.
Thanx :)
Followed the guides and added my device ("_TZE200_bvu2wnxz", "TS0601"), under ZonnsmartTV01_ZG and models_info.
I dont think my TVR is using the same as class as the ZonnsmartTV01_ZG (se picture)
Any other suggested devices I can try adding my model under MODELS_INFO?
First configure local quirks for ZHA in HA config: https://github.com/zigpy/zha-device-handlers/discussions/693#discussioncomment-857274.
Then copy one quirk file in the folder and adding your device ID in the signature (one new line but best copy one working one and editing it then no extra spaces or other things is braking the files format).
ZONNSMART TV01-ZG "type" is here https://github.com/zigpy/zha-device-handlers/blob/687adffe438c4baf2678e248c521f78dc8c5686c/zhaquirks/tuya/ts0601_trv.py#L1676-L1686
SAS is here: https://github.com/zigpy/zha-device-handlers/blob/687adffe438c4baf2678e248c521f78dc8c5686c/zhaquirks/tuya/ts0601_trv_sas.py#L233-L240
Only having one local quirk with your device ID in the folder so you is knowing witch is the working one !!
ZONNSMART is needing little more editing getting all working in ZHA but you is getting one standard TRV and it shall working if its the right one. Restart HA and look if the system is loading the quirk.
Also adding little debug logging is great help if getting problems.
I was too long at the doctor with me bad ear and was missing the train :-((((
Ohh, hope it worked out with both the ear and getting home :)
I will try the SAS file instead and see if the functionality is better there out of the box Thanx for tips not having more than one local quirk and device ID
@MS-Turbo Then is being paired and is working so you is getting the battery and / or the thermostat OK taking the battery out and waiting one minute and potting it back and it shall reporting all known commands and attributes.
@javicalle is needing them for matching the right quirk or making one new.
The "train" was not one real one only getting home and commenting this issue.
The ear was emerge OP last evening and i can hearing around 5-10% more then for the after last weekend (Zero) so going better.
And i need more holidays weeks is south Spain !!!!! (hola)
Thanx for tips not having more than one local quirk and device ID
You can copy both files in your local quirk folder and just add your manufacturer ID in just one device signature.
Checking (in the device view) your device signature will tell you if the device is loading the expected quirk.
After every file change, remove any __pycache__
folder from your local quirk folder and restart HA.
Not sure if pairing the device again is needed, but better if too much than too less.
Good information to have!
Status: I took out the batteries and put them back in. Then the device startet a calibration process, but still I get little data from device. Have i done everything correct?
Se picture of device view and no pycache folder in config Quirk: ts0601_trv.ZonnsmartTV01_ZG


Hola !!
The first gen was not needing repairing and some times ZHA was not loading the quirk and must starting more times (perhaps the bug is away 1.5 year later).
Then having the device up and running also with wrong quirk changing to ZONNSMART and restarting HA and then repower the device and all DP shall coming in the log for you.
Tried two restarts and removing device and re-adding it
Add https://www.home-assistant.io/integrations/zha/#debug-logging and restart HA and look in the log if the device is sending somthing interesting then doing changes on it locally.
As you seem to bee an expert on the subject, it seems to be a sollution in zigbee2mqtt. Unfortunately i am using ZHA, but is it possible to re-use the code that has been written by these guys?
https://github.com/Koenkk/zigbee2mqtt/issues/13727
It seems that the working Z2M version could be this one:
- https://github.com/twhittock/avatto_me167/blob/main/me167.js
The DPs seems very diferents from the current Tuya TRV quirks. That would need a few work to make it operational.
Hi guys, I have exact same thermostat valves model and I'm struggling with it too. Is any of these 2 quirks working for you @MS-Turbo ? I understand that we have to wait for somebody to integrate working existant js code into our python quirk ?
So far, non of the suggested qirks are working adequate
Hello everyone, I just received 6 of these bought from this listing.
@MattWestb wrote:
@MS-Turbo Then is being paired and is working so you is getting the battery and / or the thermostat OK taking the battery out and waiting one minute and potting it back and it shall reporting all known commands and attributes.
I have done this as suggested. Here is the log: TZE200_bvu2wnxz TS0601reporting.log
The tuya log lines are:
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [1] for attribute 0x0402 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [1] for attribute 0x0403 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0, 0, 0, 250] for attribute 0x0204 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0, 0, 0, 210] for attribute 0x0205 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0] for attribute 0x0107 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [1, 6, 0, 0, 120, 8, 0, 0, 160, 18, 0, 0, 220, 20, 0, 0, 200] for attribute 0x001c (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [2, 6, 0, 0, 120, 8, 0, 0, 160, 18, 0, 0, 220, 20, 0, 0, 200] for attribute 0x001d (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [3, 6, 0, 0, 120, 8, 0, 0, 160, 18, 0, 0, 220, 20, 0, 0, 200] for attribute 0x001e (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [4, 6, 0, 0, 120, 8, 0, 0, 160, 18, 0, 0, 220, 20, 0, 0, 200] for attribute 0x001f (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [5, 6, 0, 0, 120, 8, 0, 0, 160, 18, 0, 0, 220, 20, 0, 0, 200] for attribute 0x0020 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [6, 6, 0, 0, 120, 8, 0, 0, 160, 18, 0, 0, 220, 20, 0, 0, 200] for attribute 0x0021 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [7, 6, 0, 0, 120, 8, 0, 0, 160, 18, 0, 0, 220, 20, 0, 0, 200] for attribute 0x0022 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0] for attribute 0x0523 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0] for attribute 0x0124 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0] for attribute 0x0127 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x022f (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0, 0, 0, 210] for attribute 0x0205 (command 0x0002)
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0] for attribute 0x0403 (command 0x0002)
Set point temperature in degrees C, multiplied by 10. Minimum is 5 degrees:
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0, 0, 0, 250] for attribute 0x0204 (command 0x0002)
Current temperature * 10:
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [0, 0, 0, 210] for attribute 0x0205 (command 0x0002)
Mode (probably 0=auto, 1=?, 2=off):
[zhaquirks.tuya] [0x3835:1:0xef00] Received value [1] for attribute 0x0402 (command 0x0002)
It seems that the working Z2M version could be this one:
* https://github.com/twhittock/avatto_me167/blob/main/me167.js
The DPs seems very diferents from the current Tuya TRV quirks. That would need a few work to make it operational.
Actually, it does seem to be the same attribute list. If you convert an individual dataPoint to hex, it corresponds to the lower part of the attribute in hex.
For example,
me167HeatingSetpoint: 4
-> value [0, 0, 0, 250] for attribute 0x0204 (command 0x0002)
me167Schedule1: 28
(28 decimal = 1c hex) -> [zhaquirks.tuya] [0x3835:1:0xef00] Received value [1, 6, 0, 0, 120, 8, 0, 0, 160, 18, 0, 0, 220, 20, 0, 0, 200] for attribute 0x001c (command 0x0002)
I have started an implementation on this branch: https://github.com/challs/zha-device-handlers/tree/ts0601_me167_trv
The current room temperature is correctly sent back to Homeassistant, but the temperature setpoint and mode setting is not yet working properly. Maybe there is someone watching this who might want to comment on the implementation. I see that there are some very different styles of implementation, and it wasn't clear to me which is the current best practice style to use.
Blakadder identified it as below: https://zigbee.blakadder.com/Avatto_TRV06.html
Above DPs from Z2M and @challs help should be sufficient. Will do the quirk probably tomorrow.
Only question is: me167FrostGuard: 36, me167AntiScaling: 39, Are they switches to enable function or should they be just binary sensors??
0x0402 Mode (probably 0=auto, 1=?, 2=off): Someone need to check which is which. Z2M says: 0 - schedule 1 - manual 2 - off
Ah... device signature is needed, from HA device panel
the temperature setpoint and mode setting is not yet working properly
I'm not familiar with all the TRV implementations, but I believe that first you need to uncomment/implement the def map_attribute(self, attribute, value):
part. Add logs to validate that is working your code.
If this part is working as expected, and the reading part is working but none of the 'write' part, can be a NO_MANUFACTURER_ID
issue.
If it was the case I would overwrite the write_attributes(self, attributes, manufacturer=None):
method with something like:
async def write_attributes(self, attributes, manufacturer=None):
"""Overwrite to force manufacturer code."""
return await super().write_attributes(
attributes, manufacturer=foundation.ZCLHeader.NO_MANUFACTURER_ID
)
0x0402 Mode (probably 0=auto, 1=?, 2=off): Someone need to check which is which. Z2M says: 0 - schedule 1 - manual 2 - off
[0] auto [1] heat [2] off - according to me167.js.
I'm not sure that the Z2M entry is correct - the entry for the signature TZE200_bvu2wnxz
which we know belongs to the me167 says it is an Avatto TV02, which appears to be a different model.
I'm not familiar with all the TRV implementations, but I believe that first you need to uncomment/implement the def map_attribute(self, attribute, value): part
You are right, I hadn't finished that part yet thanks. The setpoint is done, though, and isn't working so far.
Looks like the temperature setting part is working after all already; :)