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
758 stars 695 forks source link

[Device Support Request] Tuya magnetic door sensor #2516

Closed njalon closed 1 month ago

njalon commented 1 year ago

Problem description

I've gotten a handful of these magnetic door sensors. In HA they shows up as Tuya TS0203 sensors, but as soon as they are connected and paired they stop responding, and shows as offline.

comparing them to other picturs they dont look like the TS0203 sensors that is why i think it is in order with a device support request.

Solution description

zha device support.

Screenshots/Video

Image of device

20230808_220252

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=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, 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": "0x0104", "device_type": "0x0402", "input_clusters": [ "0x0000", "0x0001", "0x0003", "0x0500" ], "output_clusters": [ "0x0003", "0x0004", "0x0005", "0x0006", "0x0008", "0x000a", "0x0019", "0x1000" ] } }, "manufacturer": "_TZ3000_au1rjicn", "model": "TS0203", "class": "zigpy.device.Device" }

Diagnostic information

config_entry-zha-d1763dabeee5f882571625066c7a949c.json.txt

I belive this is the most relevant information, but i m ight be wrong:

2023-08-07 17:57:41.647 DEBUG (MainThread) [zigpy.zcl] [0xDF39:1:0x0000] Received ZCL frame: b'\x18l\x01\x04\x00\x00B\x10_TZ3000_au1rjicn\x05\x00\x00B\x06TS0203' 2023-08-07 17:57:41.648 DEBUG (MainThread) [zigpy.zcl] [0xDF39:1:0x0000] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, is_cluster=False, is_general=True), tsn=108, command_id=1, direction=<Direction.Client_to_Server: 1>) 2023-08-07 17:57:41.650 DEBUG (MainThread) [zigpy.zcl] [0xDF39:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='_TZ3000_au1rjicn')), ReadAttributeRecord(attrid=0x0005, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='TS0203'))]) 2023-08-07 17:57:41.652 INFO (MainThread) [zigpy.device] [0xdf39] Read model 'TS0203' and manufacturer '_TZ3000_au1rjicn' from <Endpoint id=1 in=[power:0x0001, identify:0x0003, ias_zone:0x0500, basic:0x0000] out=[identify:0x0003, groups:0x0004, scenes:0x0005, on_off:0x0006, level:0x0008, lightlink:0x1000, ota:0x0019, time:0x000A] status=<Status.ZDO_INIT: 1>> 2023-08-07 17:57:41.652 INFO (MainThread) [zigpy.device] [0xdf39] Discovered basic device information for 2023-08-07 17:57:41.652 DEBUG (MainThread) [zigpy.application] Device is initialized 2023-08-07 17:57:41.653 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for _TZ3000_au1rjicn TS0203 (a4:c1:38:bc:1d:38:f0:8d) 2023-08-07 17:57:41.653 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitchFace2'> 2023-08-07 17:57:41.653 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1, 2, 242} {1} 2023-08-07 17:57:41.654 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitchFace1'> 2023-08-07 17:57:41.654 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1, 2, 41, 42, 242, 51, 21, 31} {1} 2023-08-07 17:57:41.654 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'> 2023-08-07 17:57:41.654 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {232, 230} {1} 2023-08-07 17:57:41.655 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'> 2023-08-07 17:57:41.655 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {232, 230} {1} 2023-08-07 17:57:41.655 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.tuya.ts0201.MoesTemperatureHumidtySensorWithScreen'> 2023-08-07 17:57:41.655 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint 2023-08-07 17:57:41.655 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'> 2023-08-07 17:57:41.655 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint 2023-08-07 17:57:41.656 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'> 2023-08-07 17:57:41.656 DEBUG (MainThread) [zigpy.quirks.registry] Fail because input cluster mismatch on at least one endpoint 2023-08-07 17:57:41.656 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'> 2023-08-07 17:57:41.657 DEBUG (MainThread) [zigpy.quirks.registry] Fail because input cluster mismatch on at least one endpoint 2023-08-07 17:57:41.658 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'> 2023-08-07 17:57:41.658 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {11, 13} {1} 2023-08-07 17:57:41.661 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 1 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.PowerConfigurationClusterHandler'> 2023-08-07 17:57:41.662 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 3 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.Identify'> 2023-08-07 17:57:41.662 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 1280 class: <class 'homeassistant.components.zha.core.cluster_handlers.security.IASZoneClusterHandler'> 2023-08-07 17:57:41.662 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 0 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.BasicClusterHandler'> 2023-08-07 17:57:41.663 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: a4:c1:38:bc:1d:38:f0:8d-1 2023-08-07 17:57:41.667 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'binary_sensor' component -> 'IASZone' using ['ias_zone'] 2023-08-07 17:57:41.668 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'button' component -> 'ZHAIdentifyButton' using ['identify'] 2023-08-07 17:57:41.668 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'Battery' using ['power'] 2023-08-07 17:57:41.668 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'RSSISensor' using ['basic'] 2023-08-07 17:57:41.668 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'LQISensor' using ['basic'] 2023-08-07 17:57:41.670 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0xDF39:a4:c1:38:bc:1d:38:f0:8d entering async_device_initialized - is_new_join: True 2023-08-07 17:57:41.670 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0xDF39:a4:c1:38:bc:1d:38:f0:8d has joined the ZHA zigbee network 2023-08-07 17:57:41.670 DEBUG (MainThread) [homeassistant.components.zha.core.device] 0xDF39: started configuration 2023-08-07 17:57:41.670 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] 0xDF39:ZDO: 'async_configure' stage succeeded 2023-08-07 17:57:41.670 DEBUG (MainThread) [homeassistant.components.zha.core.device] 0x6195: Device seen - marking the device available and resetting counter 2023-08-07 17:57:41.670 DEBUG (MainThread) [homeassistant.components.zha.core.device] 0x6195: Update device availability - device available: True - new availability: True - changed: False 2023-08-07 17:57:41.680 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xDF39:1:0x0000]: Configuring cluster attribute reporting 2023-08-07 17:57:41.680 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xDF39:1:0x0000]: finished cluster handler configuration 2023-08-07 17:57:41.680 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xDF39:1:0x0003]: Configuring cluster attribute reporting 2023-08-07 17:57:41.680 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xDF39:1:0x0003]: finished cluster handler configuration 2023-08-07 17:57:41.680 DEBUG (MainThread) [zigpy.zcl] [0xDF39:1:0x0500] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, is_cluster=False, is_general=True), tsn=110, command_id=<GeneralCommand.Read_Attributes: 0>, direction=<Direction.Server_to_Client: 0>) 2023-08-07 17:57:41.681 DEBUG (MainThread) [zigpy.zcl] [0xDF39:1:0x0500] Sending request: Read_Attributes(attribute_ids=[1]) 2023-08-07 17:57:41.681 DEBUG (MainThread) [zigpy.device] [0xdf39] Extending timeout for 0x6e request 2023-08-07 17:57:41.681 DEBUG (MainThread) [bellows.zigbee.application] Sending packet ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xDF39), dst_ep=1, source_route=None, extended_timeout=True, tsn=110, profile_id=260, cluster_id=1280, data=Serialized[b'\x00n\x00\x01\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=None, rssi=None) 2023-08-07 17:57:41.681 DEBUG (MainThread) [bellows.ezsp.protocol] Send command setExtendedTimeout: (a4:c1:38:bc:1d:38:f0:8d, True) 2023-08-07 17:57:41.681 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xDF39:1:0x0001]: Performing cluster binding 2023-08-07 17:57:41.681 DEBUG (MainThread) [zigpy.device] [0xdf39] Extending timeout for 0x70 request 2023-08-07 17:57:41.682 DEBUG (MainThread) [bellows.zigbee.application] Sending packet ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=0, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xDF39), dst_ep=0, source_route=None, extended_timeout=True, tsn=112, profile_id=0, cluster_id=<ZDOCmd.Bind_req: 0x0021>, data=Serialized[b'p\x8d\xf08\x1d\xbc8\xc1\xa4\x01\x01\x00\x03(j\xab\xfe\xff\x8dy\xe0\x01'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=None, rssi=None) 2023-08-07 17:57:41.682 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xDF39:1:0x0006]: Performing cluster binding 2023-08-07 17:57:41.682 DEBUG (MainThread) [zigpy.device] [0xdf39] Extending timeout for 0x72 request 2023-08-07 17:57:41.682 DEBUG (MainThread) [bellows.zigbee.application] Sending packet ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=0, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xDF39), dst_ep=0, source_route=None, extended_timeout=True, tsn=114, profile_id=0, cluster_id=<ZDOCmd.Bind_req: 0x0021>, data=Serialized[b'r\x8d\xf08\x1d\xbc8\xc1\xa4\x01\x06\x00\x03(j\xab\xfe\xff\x8dy\xe0\x01'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=None, rssi=None) 2023-08-07 17:57:41.682 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xDF39:1:0x0008]: Performing cluster binding 2023-08-07 17:57:41.682 DEBUG (MainThread) [zigpy.device] [0xdf39] Extending timeout for 0x74 request 2023-08-07 17:57:41.682 DEBUG (MainThread) [bellows.zigbee.application] Sending packet ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=0, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xDF39), dst_ep=0, source_route=None, extended_timeout=True, tsn=116, profile_id=0, cluster_id=<ZDOCmd.Bind_req: 0x0021>, data=Serialized[b't\x8d\xf08\x1d\xbc8\xc1\xa4\x01\x08\x00\x03(j\xab\xfe\xff\x8dy\xe0\x01'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=None, rssi=None) 2023-08-07 17:57:41.682 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xDF39:1:0x0006]: Performing cluster binding 2023-08-07 17:57:41.683 DEBUG (MainThread) [zigpy.device] [0xdf39] Extending timeout for 0x76 request

Logs

Logs ```python [Paste the logs here] ```

Custom quirk

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

Additional information

No response

MattWestb commented 1 year ago

I think we need deep debug logging from the pairing or one sniffing of it for knowing whats going wrong here then its have the new Telink module ZTU and i have one LIDL and with Silabs and its still working OK then testing it for one minute ago.

PS: My is not doing all Zigbee 3 things like pull control so many things can going wrong we dont knowing like TC-Link key is being requested and not OK transmitted / acked and the device is leaving the network.

One thing is trying paring it with different routers if you is having more like IKEA is normally very good Zigbee 3 and is supporting all advance futures and other is have very limited functions implanted like most tuya ones and can making things working or not OK in the end.

elboletaire commented 1 year ago

Duplicate of #2352 (?)

asbachb commented 9 months ago

@njalon is this still an issue? I have the same sensor, but no problems with usage/pairing.

MikeEllis-personal commented 9 months ago

I have a TS0203 (TZ3000_au1rjicn) and I'm having problems with it - pairing is hit-and-miss, often getting stuck at the "configuring" stage, and when it does work, the device drops off line a few minutes later having been working for those few minutes. Restoring connection seems to require a re-pairing attempt. Very happy to provide diagnostics and run tests etc. Downloaded diagnostics attached.

zha-f07bd5d77ed3eb4a63b6b2e79160f890-_TZ3000_au1rjicn TS0203-38df84cd8e3279289be78b589bf1f666.json.txt

njalon commented 9 months ago

Yes and no, i've forgot about the isshue and moved over to zigbee2mqtt where it was supported out of the box, but i do not have any issues going back to zha to help out with hw. support in zha

Med vennlig hilsen / Best regards Njål Lone

@.*** +47 943 17 662

man. 29. jan. 2024 kl. 18:59 skrev Mike Ellis @.***>:

I have a TS0203 (TZ3000_au1rjicn) and I'm having problems with it - pairing is hit-and-miss, often getting stuck at the "configuring" stage, and when it does work, the device drops off line a few minutes later having been working for those few minutes. Restoring connection seems to require a re-pairing attempt. Very happy to provide diagnostics and run tests etc. Downloaded diagnostics attached.

zha-f07bd5d77ed3eb4a63b6b2e79160f890-_TZ3000_au1rjicn TS0203-38df84cd8e3279289be78b589bf1f666.json.txt https://github.com/zigpy/zha-device-handlers/files/14087883/zha-f07bd5d77ed3eb4a63b6b2e79160f890-_TZ3000_au1rjicn.TS0203-38df84cd8e3279289be78b589bf1f666.json.txt

— Reply to this email directly, view it on GitHub https://github.com/zigpy/zha-device-handlers/issues/2516#issuecomment-1915274975, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGDHGNTX3UWF6B7WWMSGZMDYQ7PONAVCNFSM6AAAAAA3I7VTHWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJVGI3TIOJXGU . You are receiving this because you were mentioned.Message ID: @.***>

Jumperm commented 8 months ago

I have brought 3 of them an. I got the issue while the first configuration. It don't finish this process. Sonoff Dongle E with EmberZnet NCP 7.4.1.0

Any solution or alternativ door/windows sensors for ZHA with EZSP?!

github-actions[bot] commented 2 months 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.

regetskcob commented 1 week ago

I also have a lot of issues with configuration these sensors, I bought a bunch of them since the tuna sockets work great with my ZHA instance, but these dorr/window sensors do not get configured properly.