-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tuya zigbee switch delay issue #8149
Tuya zigbee switch delay issue #8149
Comments
Could you provide the herdsman debug log when pressing one button? (keep the log as small as possible, start at the point right before you press the buttons). See https://www.zigbee2mqtt.io/information/debug.html#zigbee-herdsman-debug-logging on how to enable the herdsman debug logging. Note that this is only logged to STDOUT and not to log files. |
@Koenkk Okay I will try it. |
@Koenkk
If you need more logs, feel free to ask. |
It is a log when button 2(
It is a log when button 3(
|
Can you share the network key of your smart things sniff? |
@Koenkk
Above includes the Zigbee Dongle and ST I used. Oh I checked it.
|
Could you:
|
@Koenkk I will check the packets. |
Nice one. I have the same problem but on deconz 😕 |
@Koenkk It looks like same as packets of ST. |
…#2848) * Attempt to fix TuYa switch delay. Koenkk/zigbee2mqtt#8149 * Update fromZigbee.js
Merged now. Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html) |
Appears to be fixed when testing TS0042 on CC2351 |
@gavin0987 can you sniff your network when using the conbee ii and pressing the button on the TuYa switch? https://www.zigbee2mqtt.io/how_tos/how_to_sniff_zigbee_traffic.html |
@Koenkk I finally managed to flash my CC2531 with the Sniffing software, re-paired my TS0042 with the Conbee2+Z2M setup and its now working instantly (No delays happening on subsequent clicks). Thanks for the work on this issue, The patch came just in time as I was about to purchase an Aqara H1 to replace the Tuya TS0042. |
Ok, so this issue has returned Attached are the logs and a pcap showing the sniffed transaction from the same time. ([Key:[01030507090b0d0f00020406080a0c0d]) In summary,
Please let me know if there is anything more I can provide to assist with this. |
@gavin0987 did it hang after point 6? Sniff looks good to me, each command is followed up by a default response from the coordinator. |
@Koenkk it is taking 3 seconds to get from Physical clicking of the button, to the point where it actually sends the "ZCL OnOff" packet to Z2M, so the delay is already occured by the time we get to point 6. Investigating the timing of the packets, there seem to be two delays being inserted, 1second delay after first "Report Attributes", and then 2seconds after the second "Report Attributes" Doing a comparison with Smartthings, I can see that only one "Report Attributes" is sent to smartthings, and also the OnOff packet is sent immediately after the "Default Resopnse" is sent back from Smartthings. Smartthings Timings (Based on output from wireshark)
Z2M timings (Based on output from wireshark)
Based on the above I would say the TS0042 sends a "Report Attributes" packet and then waits (upto 1second) for an ACK (Default Response). Although Z2M now sends a response, its ignored. So after waiting 1 second for a "Default Response" it decides to resend the packet (Like a TCP Retransmission?). After sending the "Report Attributes"(2nd time) it waits for 2 seconds to see if it gets a valid response. Once again it doesnt receive a valid response from us so the timeout passes after 2 seconds and it then moves on and sends the ZCL OnOff. Comparing the DefaultReponse packets between Z2M and Smartthings the only difference is the "Frame Control Field" Smartthings (Default Response)
Z2M
Any thoughts, or have I gone off investigating in wrong direction? |
The Maybe the issue could be caused by the multiple |
You only mentioned I tried adding something like this into the
Any pointers for how I can test this theory out. |
That is strange, adding the options should influence the transaction sequence number (https://github.com/Koenkk/zigbee-herdsman/blob/e7f27312207dd9330a9cd749021a6e8c434578ff/src/controller/model/endpoint.ts#L550)
See https://www.zigbee2mqtt.io/information/debug.html#zigbee-herdsman-debug-logging on how to enable the herdsman debug logging. Note that this is only logged to STDOUT and not to log files. |
I managed to get my test working, and it seems to resolve the issue. So it appears that these Tuya Scene Switches expect a response after each command is sent.
The OP's delay was related to Z2M not replying to the OnOff Command packets, and my issue was Z2M not Responding to Report Attributes packets (Z2M was sending packets, but wrong content). Hack/Fix Now after a restart I can see the correct The only side effect from my test is that the original 4x Three Notes:
TS0042_Z2M_NoDelay.zip |
|
I feel that the OP and I are actually having slightly different issues, although the same type of fix is needed for both. We are both experiencing delays with the Tuya devices, but now I re-read the OP's issue it seems to be that they are seeing delays when repeatedly Clicking the button. In this case the Tuya device was not dispatching subsequent The main difference between OP and myself is that they are focusing on buttons 3&4 which only send OnOff packets....so their delay was because Z2M was not acknowledging OnOff packets. However I am using button 1, which first fires a My issue is almost the same, but I am seeing delays anytime I click, and that is because the original fix for OP only sends a With regards to point 2. in the previous post:
Smarthings Responses with a
Z2M & Conbee2 responds with a
I am not sure if this is easier discussed on Discord or here? Happy to take a different approach if it makes things easier. TS0042_NoDelaySmartthings.zip TS0042_3SecondDelay.zip |
I believe that zigbee-herdsman should now send the same response. |
Tested the change and when sniffing, I can see that the direction is now as expected. Adding my hack back into the I cannot see any differences between my hacked Edit: Added pcap capture after the change suggested by @Koenkk in the previous message. (Same outcome, but can see the direction looks correct) |
I'm comparing With Now I'm even more confused since https://github.com/Koenkk/zigbee-herdsman/pull/400/files shouldn't be needed. |
@Koenkk Thanks for sticking with this......
Packet 4,5,6 & 7 are original Z2M I did ask in a previous message, why my hack was not replacing Z2M's
|
I am not sure what changes were made to the DEV branch in the last 24hours, but after doing another test tonight with Conbee2 and SonoffBridge. I also am no longer seeing the 4x I'd love to hear what changes were made which could have fixed this.... |
This happens on the MAC layer of the ConBee FW I think. When the connection isn't strong enough it tries more times to send something (An USB extension cable helps to improve reception). |
@gavin0987 there have been no changes related to this. I guess #8149 (comment) explains the issue. Assuming this can be closed now. |
Hi, I'd like to reopen this issue. It seems not to be related with weak connection. Button 1 works fine, without any delay after pressing it multiple times, however 2, 3 and 4 has 3 seconds delay which is very annoying. |
Did anyone ever get to the bottom of this? Just received one of these switches today and having the exact same issue. |
Having the same issue too |
I retured my Tuya switches, and got Aqara Opple instead, which works perfectly and has more options (single, double, tripple, hold, release). |
No, it still doesn't work reliable for me. Sometimes it's instant and then you start seeing 3 second delays.
I haven't replaced it with an alternativr as its only in used in the child's bedroom for him to turn his ceiling light and lamp on and off.
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Dawid Góra ***@***.***>
Sent: Saturday, May 7, 2022 9:42:41 AM
To: Koenkk/zigbee2mqtt ***@***.***>
Cc: gavin0987 ***@***.***>; Mention ***@***.***>
Subject: Re: [Koenkk/zigbee2mqtt] Tuya zigbee switch delay issue (#8149)
Hi, I'd like to reopen this issue. It seems not to be related with weak connection. Button 1 works fine, without any delay after pressing it multiple times, however 2, 3 and 4 has 3 seconds delay which is very annoying.
Did anyone ever get to the bottom of this? Just received one of these switches today and having the exact same issue.
I retured my Toya switches, and got Aqara Opple which works perfectly and has more options (single, double, tripple, hold, release).
—
Reply to this email directly, view it on GitHub<#8149 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AK6LP53NTZKHCYH2CVSRQPTVIYUIDANCNFSM5BCGONHA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Any News/Changes here? |
No News ? |
What happened
#4468
This is an issue with the above equipment.
When a button is pressed in succession, a delay occurs from the second button.
After waiting for a few seconds again, When I press it again, the first button responds quickly, but after the second button, there is a delay of 2-3 seconds again.
I thought it was a device problem, so I tried another switch, but the same problem occurred.
The same thing happened to not only 4 gang switche(TS0044) but also 2(TS0042) and 3(TS0043) gang switches.
When I tried to link SmartThings using Custom DTH, everything worked fine.(Even when the button was pressed in succession, all reacted immediately.. https://www.youtube.com/watch?v=SLrzZbe5iRQ )
I tried sniffing packets respectively when connected to Zigbee2Mqtt and Smartthings.
All of the following situations are packets when two buttons are pressed at the same time.
With Smartthing Hub (filter by
zbee_newk
)With Zigbee 2 Mqtt (filter by
zbee_newk
)I was able to see the
ZCL: Default Response
packet only in the Smartthings environment that is running normally,In the
Z2M
environment, it seemed like retrying by failure.I am not familiar with the packet structure of Zigbee, but there seems to be a delay due to a function that is not implemented.
zigbee sniff.zip
Is it possible to solve this problem?
What did you expect to happen
If I press the button in succession, it should all react immediately.
How to reproduce it (minimal and precise)
Even with a new pairing, it still happens.
A delay occurs when one button is pressed and then another or the same button is pressed immediately.
Of course, it also happens when you press two buttons at the same time.
Debug info
Zigbee2MQTT version: 1.19.1 (docker in synology nas)
Adapter hardware: CC2531, CC2538, Slaesh's CC2652RB stick (I had the same problem with all 3 dongles)
Adapter firmware version:
Zigbee2MQTT:info 2021-07-01 16:30:49: Coordinator firmware version: '{"meta":{"maintrel":2,"majorrel":2,"minorrel":7,"product":2,"revision":20201010,"transportrev":2},"type":"zStack30x"}'
Zigbee2MQTT:info 2021-07-27 04:46:33: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20210120,"transportrev":2},"type":"zStack3x0"}'
The text was updated successfully, but these errors were encountered: