-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
'commandTuyaAction' Duplicate messages cannot be determined #22416
Comments
@kirovilya could you take a look at this? |
I found that there is a sequence number in transactionSequenceNumber, and the sequence number of repeated packets is the same. But when the front end receives Zigbee message from, the data is [], so there is no way to judge. The solution is to just put this transactionSequenceNumber to " Received Zigbee message" as ver1.33 or before [2024-06-15 19:56:29] debug: zh:zstack:znp: AREQ: <-- AF - incomingMsg - {"groupid":0,"clusterid":6,"srcaddr":55196,"srcendpoint":6,"dstendpoint":1,"wasbroadcast":0,"linkquality":142,"securityuse":0,"timestamp":5270905,"transseqnumber":0,"len":4,"data":{"type":"Buffer","data":[1,60,253,0]}} |
That's good right? We can just filter on the sequence number to detected repeated packages. Could you provide the data/database.db entry of your device? |
{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0029e8a58f","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6,8,10,11,12,13,47,110,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":257,"epId":2,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"3":{"profId":260,"epId":3,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"4":{"profId":263,"epId":4,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"5":{"profId":264,"epId":5,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"6":{"profId":265,"epId":6,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"8":{"profId":260,"epId":8,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"10":{"profId":260,"epId":10,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"11":{"profId":260,"epId":11,"devId":1024,"inClusterList":[1281,10],"outClusterList":[1280,1282],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"12":{"profId":49246,"epId":12,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"13":{"profId":260,"epId":13,"devId":5,"inClusterList":[25],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"47":{"profId":260,"epId":47,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"110":{"profId":260,"epId":110,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"interviewCompleted":true,"meta":{},"lastSeen":1718908229497} |
Could you provide the debug log when pressing the button once which outputs to MQTT actions? See this on how to enable debug logging. |
[2024-05-03 13:17:41] debug: z2m: Received Zigbee message from 'MY_BUTTON', type 'commandTuyaAction', cluster 'genOnOff', data '{"data":{"data":[],"type":"Buffer"},"value":0}' from endpoint 2 with groupID 0 [2024-06-15 19:56:29] debug: zh:zstack:znp: AREQ: <-- AF - incomingMsg - {"groupid":0,"clusterid":6,"srcaddr":55196,"srcendpoint":6,"dstendpoint":1,"wasbroadcast":0,"linkquality":142,"securityuse":0,"timestamp":5270905,"transseqnumber":0,"len":4,"data":{"type":"Buffer","data":[1,60,253,0]}}
|
I would expect multiple |
I pressed the 5th button of a wireless switch 3 times, but sent mqtt messages 4 times: This is the incomingMsg: Complete log ( "srcaddr":32543, "srcendpoint":5,) : |
Could you check if the issue is fixed with the following external converter:
external_converters:
- ext_converter.js
|
The issue has been fixed, thank you. |
Integrated the fix! Changes will be available in the dev branch in a few hours from now. |
What happened?
Tuya may send a repeated message after pressing the button once, but because this repeated data is exactly the same as the data received after pressing the button for the second time, two mqtt messages of action_1 will be published for the same button press.
Like this, these are two identical messages sent by Tuya with the same key press. Previously, hasAlreadyProcessedMessage could be used to process duplicate messages. But now because the data is the same, it cannot be processed this way:
Received Zigbee message from 'MY_BUTTON', type 'commandTuyaAction', cluster 'genOnOff', data '{"data":{"data":[],"type":"Buffer"},"value":0}' from endpoint 2 with groupID 0
Received Zigbee message from 'MY_BUTTON', type 'commandTuyaAction', cluster 'genOnOff', data '{"data":{"data":[],"type":"Buffer"},"value":0}' from endpoint 2 with groupID 0
What did you expect to happen?
I hope that duplicate messages can be filtered out. By pressing the key once, no matter how many times tuya sends duplicate messages, only one mqtt message will be published.
How to reproduce it (minimal and precise)
Use a wireless switch and keep pressing buttons. Sometimes due to delay, tuya will send multiple repeated messages for the same button press.
Zigbee2MQTT version
1.36,1, 1.37.0
Adapter firmware version
20221226
Adapter
SONOFF CC2652P Zigbee 3.0 USB Dongle Plus
Setup
Tested with add-on and docker, both are the same
Debug log
[2024-05-03 13:17:41] debug: z2m: Received Zigbee message from 'MY_BUTTON', type 'commandTuyaAction', cluster 'genOnOff', data '{"data":{"data":[],"type":"Buffer"},"value":0}' from endpoint 2 with groupID 0
[2024-05-03 13:17:41] debug: z2m: Received Zigbee message from 'MY_BUTTON', type 'commandTuyaAction', cluster 'genOnOff', data '{"data":{"data":[],"type":"Buffer"},"value":0}' from endpoint 2 with groupID 0
[2024-05-03 13:17:41] debug: z2m: MQTT publish: topic 'zigbee2mqtt2/MY_BUTTON/action', payload 'scene_2'
[2024-05-03 13:17:41] debug: z2m: MQTT publish: topic 'zigbee2mqtt2/MY_BUTTON/action', payload 'scene_2'
The text was updated successfully, but these errors were encountered: