-
Notifications
You must be signed in to change notification settings - Fork 503
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
Button events check for duplicated sequence number (IKEA, Tuya and LIDL) #4716
Conversation
* Limited to IKEA and Tuya devices discard duplicated commands; * For all other devices a warning is printed so we can track the issue; * Sensor.previousSequenceNumber changed to uint16_t with initial value 0xffff to not accidantly discard valid commands. This PR is successor for dresden-elektronik#4265 but only addresses the duplicate switch events. The whole ZCL Default Response needs to be fixed at a higher level for all handlers in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please limit this to Tuya devices.
For IKEA, I've only seen the issue when they send both groupcast and unicast messages, because of the binding of On/Off (and other client clusters) to the group, and of Power Configuration to the coordinator. Fixed that in #4627 by ignoring the unicast (seems safer than relying on sequence numbers which are recycled after 255 messages).
Ok I'll limit this to Tuya (not includes LIDL remote but it already had this handling). Does #4627 also fix the issue for the IKEA shortcut button? In #4227 it is mentioned to have this problem too. |
For all of these: deconz-rest-plugin/de_web_plugin.cpp Lines 4054 to 4076 in 2512867
|
For IKEA the issue was already addressed in dresden-elektronik#4627
Perfect, have removed them now. And noticed I may have introduced a regression :) For the HG06323 remote the original manufacturer name is replaced with "LIDL Livarno Lux" and here the I think the check needs to be changed to: if (zclFrame.sequenceNumber() == sensor->previousSequenceNumber)
{
// useful in general but limit scope to known problematic devices
if (isTuyaManufacturerName(sensor->manufacturer()) || sensor->modelId() == QLatin1String("HG06323"))
{
// deCONZ doesn't always send ZCL Default Response to unicast commands, or they can get lost.
// in this case some devices re-send the command multiple times
DBG_Printf(DBG_INFO, "Discard duplicated zcl.cmd: 0x%02X, cluster: 0x%04X with zcl.seq: %u for %s / %s\n",
zclFrame.commandId(), ind.clusterId(), zclFrame.sequenceNumber(), qPrintable(sensor->manufacturer()), qPrintable(sensor->modelId()));
return;
}
else // warn only
{
DBG_Printf(DBG_INFO, "Warning duplicated zcl.cmd: 0x%02X, cluster: 0x%04X with zcl.seq: %u for %s / %s\n",
zclFrame.commandId(), ind.clusterId(), zclFrame.sequenceNumber(), qPrintable(sensor->manufacturer()), qPrintable(sensor->modelId()));
}
} |
Has anyone ever reported duplicate buttonevents for this device? Note that despite the name, this is a regular device, like all LIDL devices I've seen. It doesn't carry the Tuya cluster, and uses regular client clusters with group bindings (and without the bug in some of the IKEA firmwares). |
Hard to tell, the double sequence number check was already there (from the beginning?) so even if this was the case it wouldn't be noticed by users. I don't know if the check was only there because of copy paste or if the problem actually occured. If the remote only sends group casts the ZCL Default Response issue shouldn't be a problem. To be on the safe side I'd add the check as shown above, with a comment to remove it after testing. I have access to the remote next week. |
From my memory the defaut response can solve the issue too. |
Lol, so I don't found the "approval" button. |
This PR is meant to only address one thing, the duplicated commands. I'd like to fix the ZCL Default Response for good and in general (not device specific) in a separate issue. For this all other handlers need to be taken into account which needs a slight refactor. |
And logs can be usefull too, to reconize this issue for other brands/devices |
Note that the ZCL Default Response even then fixed can fail for all kinds of reasons: Like the APS queue is full, or the command gets lost on the way back — as we sometimes have routes which only work in one direction. Therefore having the duplicate check is not too bad in general. |
No, but it should be at the level of receiving the APS-DATA.indication, not when handling the buttonevents. |
The check was active for the LIDL remote before, and coould likely be removed after testing.
I hope so but would like to test this more before rolling out for all devices. I'm afraid of some wonky devices which are lazy to increase the sequence number. |
Seriously there is some devices that not increase the sequence number ? |
I hope not but wouldn't be surprised :D |
This PR is successor for #4265 but only addresses the duplicate switch events.
The whole ZCL Default Response needs to be fixed at a higher level for all handlers in a separate PR.