zigpy / zha-device-handlers

ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.
Apache License 2.0
731 stars 673 forks source link

[Device Support Request] TS0601 _TZE204_upagmta9 Tuya outdoor temperature and humidity sensor #2694

Open raven4is opened 11 months ago

raven4is commented 11 months ago

Problem description

No values recognized

Device info TS0601 by _TZE204_upagmta9 Zigbee info IEEE: a4:c1:38:74:06:b0:2c:89 Nwk: 0x2aff Device Type: EndDevice LQI: 192 RSSI: -52 Last Seen: 2023-11-01T13:11:52 Power Source: Battery or Unknown

Solution description

How can i get or make a custom quirk for this device?

Screenshots/Video

zigbee_204

Screenshots/Video [Paste/upload your media here]

Device signature

Device signature ```json { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=, *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": "0x0104", "device_type": "0x0051", "input_clusters": [ "0x0000", "0x0004", "0x0005", "0xef00" ], "output_clusters": [ "0x000a", "0x0019" ] } }, "manufacturer": "_TZE204_upagmta9", "model": "TS0601", "class": "zigpy.device.Device" } ```

Diagnostic information

Diagnostic information ```json { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.10.5", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.11.5", "docker": true, "arch": "aarch64", "timezone": "Europe/Bucharest", "os_name": "Linux", "os_version": "6.1.21-v8", "supervisor": "2023.10.1", "host_os": "Home Assistant OS 11.1", "docker_version": "24.0.6", "chassis": "embedded", "run_as_root": true }, "custom_components": { "browser_mod": { "version": "2.3.0", "requirements": [] }, "hacs": { "version": "1.32.1", "requirements": [ "aiogithubapi>=22.10.1" ] }, "lovelace_gen": { "version": "0.1.1", "requirements": [ "jinja2" ] }, "fusion_solar_kiosk": { "version": "3.0.6", "requirements": [] }, "scheduler": { "version": "v0.0.0", "requirements": [] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "after_dependencies": [ "onboarding", "usb" ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly" ], "config_flow": true, "dependencies": [ "file_upload" ], "documentation": "https://www.home-assistant.io/integrations/zha", "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp", "universal_silabs_flasher" ], "requirements": [ "bellows==0.36.5", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.105", "zigpy-deconz==0.21.1", "zigpy==0.57.2", "zigpy-xbee==0.18.3", "zigpy-zigate==0.11.0", "zigpy-znp==0.11.6", "universal-silabs-flasher==0.0.14", "pyserial-asyncio-fast==0.11" ], "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" ] } ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" }, { "type": "_uzg-01._tcp.local.", "name": "uzg-01*" }, { "type": "_slzb-06._tcp.local.", "name": "slzb-06*" } ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 11007, "manufacturer": "_TZE204_upagmta9", "model": "TS0601", "name": "_TZE204_upagmta9 TS0601", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "manufacturer_code": 4417, "power_source": "Battery or Unknown", "lqi": 192, "rssi": -52, "last_seen": "2023-11-01T13:15:58", "available": true, "device_type": "EndDevice", "signature": { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=, *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": "0x0104", "device_type": "0x0051", "input_clusters": [ "0x0000", "0x0004", "0x0005", "0xef00" ], "output_clusters": [ "0x000a", "0x0019" ] } }, "manufacturer": "_TZE204_upagmta9", "model": "TS0601" }, "active_coordinator": false, "entities": [ { "entity_id": "sensor.tze204_upagmta9_ts0601_rssi", "name": "_TZE204_upagmta9 TS0601" }, { "entity_id": "sensor.tze204_upagmta9_ts0601_lqi", "name": "_TZE204_upagmta9 TS0601" } ], "neighbors": [], "routes": [], "endpoint_names": [ { "name": "SMART_PLUG" } ], "user_given_name": null, "device_reg_id": "f617a18abfa66229233f67c4d981d85f", "area_id": null, "cluster_details": { "1": { "device_type": { "name": "SMART_PLUG", "id": 81 }, "profile_id": 260, "in_clusters": { "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0xef00": { "endpoint_attribute": null, "attributes": {}, "unsupported_attributes": {} }, "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0001": { "attribute_name": "app_version", "value": 73 }, "0x0004": { "attribute_name": "manufacturer", "value": "_TZE204_upagmta9" }, "0x0005": { "attribute_name": "model", "value": "TS0601" } }, "unsupported_attributes": {} } }, "out_clusters": { "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} }, "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} } } } } } } ```

Logs

Logs ```python Logger: zigpy.zcl Source: runner.py:186 First occurred: 13:05:38 (5 occurrences) Last logged: 13:13:56 [0x2AFF:1:0xef00] Unknown cluster command 17 b'\x00\x03@' ```

Custom quirk

Custom quirk ```python [Paste your custom quirk here] ```

Additional information

https://www.aliexpress.com/item/1005005627336725.html Zigbee Version I tried some quirks but with no help. Can someone help me?

metawops commented 2 months ago

Count me in here, also got 2 of these from Ali today, same issues, no Temp/Hum sensors appearing. Using ZHA.

HappyLer commented 1 month ago

I tried to investigate this issue. I used https://github.com/zigpy/zha-device-handlers/blob/daef3943d1499808eb6ad4391f19fa6f77f3e4da/zhaquirks/tuya/ts0601_sensor.py which has the quirk implemented. I got the spells to execute.

2024-08-26 23:49:07.983 DEBUG (MainThread) [zigpy.zcl] [0xAE7F:1:0x0402] Executing attribute read spell on Tuya device a4:c1:38:21:bd:de:9c:86
2024-08-26 23:49:08.131 DEBUG (MainThread) [zigpy.zcl] [0xAE7F:1:0x0402] Executed attribute read spell on Tuya device a4:c1:38:21:bd:de:9c:86
2024-08-26 23:49:08.131 DEBUG (MainThread) [zigpy.zcl] [0xAE7F:1:0x0402] Executing data query spell on Tuya device a4:c1:38:21:bd:de:9c:86
2024-08-26 23:49:08.298 DEBUG (MainThread) [zigpy.zcl] [0xAE7F:1:0x0402] Executed data query spell on Tuya device a4:c1:38:21:bd:de:9c:86

However, the result is the same. I get the battery entity without readings and after some random tinkering the Humidity and Temperature also show without any readings. What caught my eye was what seems to be the response to the data query spell:

2024-08-26 23:49:08.297 DEBUG (MainThread) [zigpy.zcl] [0xAE7F:1:0xef00] Decoded ZCL frame: TemperatureHumidityBatteryStatesManufCluster:Default_Response(command_id=3, status=<Status.UNSUP_MANUF_CLUSTER_COMMAND: 131>)

I see a similar message in https://github.com/zigpy/zha-device-handlers/issues/2694#issuecomment-1995956296. _UNSUP_MANUF_CLUSTERCOMMAND sounds like something went wrong.

I also looked at the packet trace of a successfull pairing from here: https://github.com/Koenkk/zigbee2mqtt/issues/19137#issuecomment-1789596125 (I had to add the keys in Edit -> Preferences -> Protocols -> Zigbee -> AES-128 Encryption, 32-bit Inegrity Protection -> Edit and add 5A:69:67:42:65:65:41:6C:6C:69:61:6E:63:65:30:39 , 01:03:05:07:09:0B:0D:0F:00:02:04:06:08:0A:0C:0D and af:82:c4:4b:f9:91:08:27:0c:4c:f9:15:6a:95:d8:c5.

There I think Frame 103 is the spell (command 0x03) and 106 is the rection from the device, which indicates it worked (command 0x02). This was also described here: https://github.com/Koenkk/zigbee2mqtt/issues/19137#issuecomment-1793125830 I can not find a corresponding 0x02 command from the sensor in the zha DEBUG logs. Sadly I do not have a setup, where I can directly sniff the traffic.

Over at z2m a race condition might have caused issued: https://github.com/Koenkk/zigbee2mqtt/issues/19137#issuecomment-1811181299

The fix was this commit: https://github.com/Koenkk/zigbee-herdsman-converters/commit/c6af42110ec166795794b254ddd9613d29d3fe22

Maybe someone with a sniffing setup can compare what z2m does compared to zha. Or maybe someone can use the packet trace mentioned above to find a difference.

LennardPlay commented 3 weeks ago

Has there been any progress on this? I recently switched to ZHA (because Z2MQTT gave me a headache) and am pretty dissappointed, that my cheap sensor is now a cheap paperweight.

srohr87 commented 2 weeks ago

Same Problem. 3 ZTH05 without any entity. Are there any news about a solution?

HappyLer commented 2 weeks ago

As this issue (and others) is quite confusing with all the comments already, I suggest voicing support by giving a Thumbs Up to the first post instead of posting more comments. Researching this topic becomes harder and harder with more comments that do not add additional information.