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
733 stars 673 forks source link

[BUG] Tuya curtain switch stops working after pairing (_TZ3000_e3vhyirx) #2050

Closed gluca closed 1 year ago

gluca commented 1 year ago

Describe the bug After pairing TS130F _TZ3000_e3vhyirx courtain switch it stops working after few seconds.

To Reproduce Steps to reproduce the behavior:

  1. Pair the curtain switch
  2. after paired move the slides of the cpver entity created
  3. it works (but with wrong percentage) a couple of times and then stops workoing
  4. See error

Expected behavior it should operate the motor in the proper way with percentage feedback aligned with cover openong status

Screenshots

```yaml { "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=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0202", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0x0006", "0x0102" ], "out_clusters": [ "0x000a", "0x0019" ] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } }, "manufacturer": "_TZ3000_e3vhyirx", "model": "TS130F", "class": "zhaquirks.tuya.ts130f.TuyaTS130GP" } ```
Diagnostic information ```yaml { "home_assistant": { "installation_type": "Home Assistant Container", "version": "2022.12.8", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.10.7", "docker": true, "arch": "armv7l", "timezone": "Europe/Rome", "os_name": "Linux", "os_version": "5.15.76-v7+", "run_as_root": true }, "custom_components": { "alexa_media": { "version": "4.4.0", "requirements": [ "alexapy==1.26.4", "packaging>=20.3", "wrapt>=1.12.1" ] }, "homewhiz": { "version": "0.0.6", "requirements": [ "bleak", "bleak_retry_connector", "dacite", "aiohttp", "bidict" ] }, "meross_cloud": { "version": "1.2.6", "requirements": [ "meross_iot==0.4.5.0" ] }, "HomeWhiz": { "version": "0.0.3", "requirements": [ "bleak" ] }, "landroid_cloud": { "version": "2.3.4", "requirements": [ "pyworxcloud==2.1.23" ] }, "nodered": { "version": "1.1.2", "requirements": [] }, "meross_lan": { "version": "2.6.2", "requirements": [] }, "tapo_control": { "version": "4.2.1", "requirements": [ "pytapo==2.8", "onvif-zeep-async==1.2.0" ] }, "hacs": { "version": "1.29.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "solem": { "version": "0.1.0", "requirements": [ "bluepy==1.3.0" ] }, "xiaomi_cloud_map_extractor": { "version": "v2.2.0", "requirements": [ "pillow", "pybase64", "python-miio", "requests", "pycryptodome" ] }, "candy": { "version": "1.0.0", "requirements": [ "backoff~=2.0", "aiolimiter~=1.0" ] }, "volkswagen_we_connect_id": { "version": "1.0", "requirements": [ "weconnect==0.50.1", "ascii_magic==1.6" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.34.5", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.89", "zigpy-deconz==0.19.2", "zigpy==0.52.3", "zigpy-xbee==0.16.2", "zigpy-zigate==0.10.3", "zigpy-znp==0.9.2" ], "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": 28517, "manufacturer": "_TZ3000_e3vhyirx", "model": "TS130F", "name": "_TZ3000_e3vhyirx TS130F", "quirk_applied": true, "quirk_class": "zhaquirks.tuya.ts130f.TuyaTS130GP", "manufacturer_code": 4417, "power_source": "Mains", "lqi": 255, "rssi": -76, "last_seen": "2022-12-31T11:53:16", "available": true, "device_type": "Router", "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=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0202", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0x0006", "0x0102" ], "out_clusters": [ "0x000a", "0x0019" ] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } } }, "active_coordinator": false, "entities": [ { "entity_id": "cover.finestra_cover", "name": "_TZ3000_e3vhyirx TS130F" } ], "neighbors": [], "routes": [], "endpoint_names": [ { "name": "WINDOW_COVERING_DEVICE" }, { "name": "unknown 97 device_type of 0xa1e0 profile id" } ], "user_given_name": "Finestra", "device_reg_id": "6cac63b889b747669599e9ea0886c34a", "area_id": "bagno_mansarda", "cluster_details": { "1": { "device_type": { "name": "WINDOW_COVERING_DEVICE", "id": 514 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": {}, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": null, "attributes": {}, "unsupported_attributes": {} }, "0x0102": { "endpoint_attribute": "window_covering", "attributes": { "0x0008": { "attribute_name": "current_position_lift_percentage", "value": 95 }, "0xf000": { "attribute_name": "tuya_moving_state", "value": 2 } }, "unsupported_attributes": {} } }, "out_clusters": { "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} }, "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} } } }, "242": { "device_type": { "name": "unknown", "id": 97 }, "profile_id": 41440, "in_clusters": {}, "out_clusters": { "0x0021": { "endpoint_attribute": "green_power", "attributes": {}, "unsupported_attributes": {} } } } } } } ```
Additional logs - Not surev it contains *only* logs related to the device. But i've recorded it after sending cover command ``` 2022-12-31 13:53:49.256 DEBUG (MainThread) [zigpy.zcl] [0x6F65:1:0x0102] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=False), tsn=191, command_id=5, *direction=, *is_reply=False) 2022-12-31 13:53:49.257 DEBUG (MainThread) [zigpy.zcl] [0x6F65:1:0x0102] Sending request: go_to_lift_percentage(percentage_lift_value=11) 2022-12-31 13:53:53.531 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xE3B5), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=None, profile_id=260, cluster_id=6, data=Serialized[b'\x08\xcc\n\x00\x00\x10\x00\x01@!\x00\x00\x02@!\x00\x00\x01\x800\x01\x02\x800\x00\x00P0\x01\x00\x80\x10\x00'], tx_options=, radius=0, non_member_radius=0, lqi=255, rssi=-79) 2022-12-31 13:53:53.532 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0x0006] Received ZCL frame: b'\x08\xcc\n\x00\x00\x10\x00\x01@!\x00\x00\x02@!\x00\x00\x01\x800\x01\x02\x800\x00\x00P0\x01\x00\x80\x10\x00' 2022-12-31 13:53:53.534 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0x0006] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=204, command_id=10, *direction=, *is_reply=True) 2022-12-31 13:53:53.537 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0x0006] Decoded ZCL frame: TuyaZBOnOffAttributeCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=Bool, value=)), Attribute(attrid=0x4001, value=TypeValue(type=uint16_t, value=0)), Attribute(attrid=0x4002, value=TypeValue(type=uint16_t, value=0)), Attribute(attrid=0x8001, value=TypeValue(type=enum8, value=)), Attribute(attrid=0x8002, value=TypeValue(type=enum8, value=)), Attribute(attrid=0x5000, value=TypeValue(type=enum8, value=)), Attribute(attrid=0x8000, value=TypeValue(type=Bool, value=))]) 2022-12-31 13:53:53.540 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0x0006] Received command 0x0A (TSN 204): Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=Bool, value=)), Attribute(attrid=0x4001, value=TypeValue(type=uint16_t, value=0)), Attribute(attrid=0x4002, value=TypeValue(type=uint16_t, value=0)), Attribute(attrid=0x8001, value=TypeValue(type=enum8, value=)), Attribute(attrid=0x8002, value=TypeValue(type=enum8, value=)), Attribute(attrid=0x5000, value=TypeValue(type=enum8, value=)), Attribute(attrid=0x8000, value=TypeValue(type=Bool, value=))]) 2022-12-31 13:53:53.542 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0x0006] Attribute report received: on_off=, on_time=0, off_wait_time=0, backlight_mode=, power_on_state=, 0x5000=, child_lock= 2022-12-31 13:53:53.544 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0x0006] Sending reply header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=204, command_id=, *direction=, *is_reply=True) 2022-12-31 13:53:53.545 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0x0006] Sending reply: Default_Response(command_id=10, status=) 2022-12-31 13:53:53.572 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xD9D7](TRADFRI bulb GU10 W 400lm): Device seen - marking the device available and resetting counter 2022-12-31 13:53:53.572 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xD9D7](TRADFRI bulb GU10 W 400lm): Update device availability - device available: True - new availability: True - changed: False 2022-12-31 13:53:53.576 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xE3B5), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=None, profile_id=260, cluster_id=57345, data=Serialized[b'\x08\xcd\n\x10\xd00\x000\xd00\x00\x00\xd0 \x00\x01\xd0\x1b\x00\x00\x00\x00\x02\xd0#\x00\x00\x00\x00\x03\xd0#\x00\x00\x00\x00\x04\xd0#\x00\x00\x00\x00\x05\xd0#\x00\x00\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=255, rssi=-79) 2022-12-31 13:53:53.577 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0xe001] Received ZCL frame: b'\x08\xcd\n\x10\xd00\x000\xd00\x00\x00\xd0 \x00\x01\xd0\x1b\x00\x00\x00\x00\x02\xd0#\x00\x00\x00\x00\x03\xd0#\x00\x00\x00\x00\x04\xd0#\x00\x00\x00\x00\x05\xd0#\x00\x00\x00\x00' 2022-12-31 13:53:53.579 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0xe001] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=205, command_id=10, *direction=, *is_reply=True) 2022-12-31 13:53:53.583 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0xe001] Decoded ZCL frame: TuyaZBExternalSwitchTypeCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0xD010, value=TypeValue(type=enum8, value=)), Attribute(attrid=0xD030, value=TypeValue(type=enum8, value=)), Attribute(attrid=0xD000, value=TypeValue(type=uint8_t, value=0)), Attribute(attrid=0xD001, value=TypeValue(type=bitmap32, value=)), Attribute(attrid=0xD002, value=TypeValue(type=uint32_t, value=0)), Attribute(attrid=0xD003, value=TypeValue(type=uint32_t, value=0)), Attribute(attrid=0xD004, value=TypeValue(type=uint32_t, value=0)), Attribute(attrid=0xD005, value=TypeValue(type=uint32_t, value=0))]) 2022-12-31 13:53:53.585 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0xe001] Received command 0x0A (TSN 205): Report_Attributes(attribute_reports=[Attribute(attrid=0xD010, value=TypeValue(type=enum8, value=)), Attribute(attrid=0xD030, value=TypeValue(type=enum8, value=)), Attribute(attrid=0xD000, value=TypeValue(type=uint8_t, value=0)), Attribute(attrid=0xD001, value=TypeValue(type=bitmap32, value=)), Attribute(attrid=0xD002, value=TypeValue(type=uint32_t, value=0)), Attribute(attrid=0xD003, value=TypeValue(type=uint32_t, value=0)), Attribute(attrid=0xD004, value=TypeValue(type=uint32_t, value=0)), Attribute(attrid=0xD005, value=TypeValue(type=uint32_t, value=0))]) 2022-12-31 13:53:53.587 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0xe001] Attribute report received: 0xD010=, external_switch_type=, 0xD000=0, 0xD001=, 0xD002=0, 0xD003=0, 0xD004=0, 0xD005=0 2022-12-31 13:53:53.590 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0xe001] Sending reply header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=205, command_id=, *direction=, *is_reply=True) 2022-12-31 13:53:53.591 DEBUG (MainThread) [zigpy.zcl] [0xE3B5:1:0xe001] Sending reply: Default_Response(command_id=10, status=) 2 ```

Additional context Add any other context about the problem here.

javicalle commented 1 year ago

Is your device battery powered or mains?

4. See error

I can't see any error logs in your info.

gluca commented 1 year ago

Mains

Inviato da Outlook per Androidhttps://aka.ms/AAb9ysg

Sorry for shortness and typos


From: javicalle @.> Sent: Tuesday, January 3, 2023 11:49:06 AM To: zigpy/zha-device-handlers @.> Cc: Gianluca @.>; Author @.> Subject: Re: [zigpy/zha-device-handlers] [BUG] (Issue #2050)

Is your device battery powered or mains?

  1. See error

I can't see any error logs in your info.

— Reply to this email directly, view it on GitHubhttps://github.com/zigpy/zha-device-handlers/issues/2050#issuecomment-1369624695, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAANSWZ5P4KIAWT7ZWMT7MDWQP72FANCNFSM6AAAAAATNRDOCQ. You are receiving this because you authored the thread.Message ID: @.***>

javicalle commented 1 year ago

If it is mains powered I have no idea what can it be. We need to have some error or evidence to know where the problem can be.

Maybe a communications problem with the device?

gluca commented 1 year ago

I've probably solved. I removed the device from zha, restarted home assistant and re added the device. Now it seems to work.

Il mar 3 gen 2023, 12:21 javicalle @.***> ha scritto:

If it is mains powered I have no idea what can it be. We need to have some error or evidence to know where the problem can be.

Maybe a communications problem with the device?

— Reply to this email directly, view it on GitHub https://github.com/zigpy/zha-device-handlers/issues/2050#issuecomment-1369655189, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANSWZH6FJCNKHXUIPWRDDWQQDT7ANCNFSM6AAAAAATNRDOCQ . You are receiving this because you authored the thread.Message ID: @.***>

TheJulianJES commented 1 year ago

Is the curtain switch still working? (so can we close the issue?)

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.