-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
double and long press function for xiaomi aqara button #274
Comments
Double press: yes, in v0.5.66. Long press: no, see dresden-elektronik/deconz-rest-plugin#349 (comment). |
Thx for information! Double press works. |
Hi, I would like to bring this up again as I find that there is a significant delay in the single press event triggered by Aqara switch compared with Philips Hue Dimmer switch. I feel that it could be due to the support of double press in Aqara switch so it must wait for a while to distinguish these two events. In some cases like light switching, this extra delay (around 1 sec) could be annoying. If that is really the cause, could we disable double press event in exchange for faster single press detection? |
Not in deCONZ; the Aqara switch sends different messages for single press vs double press. You would have to change this in the Aqara firmware (which is not upgradable over-the-air). |
It seems to me that there are 1000 (press) and 1002 (release) events, and single press is triggered by 1002 so far. What if single press is triggered by 1000 so it will be triggered as soon as a press occurs? If this brokes other mechanisms, what if we replace “long press” in homebridge with 1000 event so users who would like rapid single press can use this instead (although ironic) |
The Hue dimmer switch sends events on press vs release, the Aqara switch doesn’t. As I said before, it sends events on single press vs double press instead. Unfortunately the ZigBee standard doesn’t define this, and each manufacturer handles this differently. |
Actually, I find that this idea really works. I redirect the PRESS case to trigger LONG_PRESS event in hkZLLSwitchAction instead of NULL, and change the button type to SINGL_DOUBLE_LONG. I can see the following log:
As you can see, a long press is triggered before a single press for around 1 sec earlier and triggered the homekit action. Also in the double press event, there will be two long press actions. So I need to remove both single press and double press actions to avoid conflicts. But I'm satisfied with the rapid "Long Press" action. I also doubt maybe I'm actually using an old version of Xiaomi round button switch instead of Aqara version. Not sure where to check this. |
I think the
I'm not going to make that change homebridge-hue. It will break existing logic, and it will break compatibility with the Hue bridge. Unlike deCONZ, the Hue bridge doesn't send push notifications, so homebridge-hue relies on polling to receive buttonevents from the Hue bridge. The initial press is often missed because of that. |
Yes, I agree that it is a hack and will be unsuitable for general purpose. I will maintain my own fork. Thanks for the assistance! |
Thx for this awesome plugin!
Is it possible with deconz to add double and long press function for xiaomi aqara button (2)?
The text was updated successfully, but these errors were encountered: