-
Notifications
You must be signed in to change notification settings - Fork 507
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
Support for Xiaomi button (lumi.sensor_switch) #89
Comments
Interesting, it behaves exactly like the Aqara door/window sensor. It's more a stateful contact sensor than a stateless switch, like the Hue dimmer or the Trådfri remote. Would you want this supported as a ZHASwitch or a ZHAOpenClose sensor? As ZHASwitch, it would probably only support two values for |
Behaviour of the button indeed looks the same as the Xiaomi door/window sensor. |
The ZHASwitch is also my favourite, I'll put something together in the next release based on the ZHAOpenClose code. |
That's the most compelling argument! And less than EUR 7 on GearBest. I couldn't resist... It should arrive in 20 days or so. |
Beta version 2.04.62 now includes experimental support, need to be tested. Based on some Xiaomi Youtube video I figure that the switch also could support long press event in future. |
Thanks, it appears in the REST api:
I also get events when connected to the websocket. |
Indeed, so would I.
No |
It took a while to get the manufacturername, I had the same with my door sensor.
|
The events are reversed now: f801bd6 |
homebridge-hue should now support this switch as well, but I haven't been able to test it yet... |
I've also ordered the Xiaomi magic cube, looks like a fun device. |
It does! Might be challenging to define meaningful buttonevents for it, though. Maybe use different "buttons" for the different gestures: tap, shake, move, rotate, turn; and distinguish between 90° and 180° turn by short release vs long release button events? HomeKit only knows Single Press, Double Press, and Long Press. I don't support Double Press from homebridge-hue, as I cannot detect that reliably through polling. With deCONZ event notifications I probably could, however. Single Press is issued on the short release buttonevent; Long Press on the first hold or long release buttonevent. |
Events are in the right order now. Should I close the issue or leave it open for magic cube? |
I'll close it for now, it's best to open a new issue for the cube to keep headlines organized :) |
The button works fine. |
I was able to let the Xiaomi button join the network. It appears in deCONZ (2.04.61), but not in the REST api.
In deCONZ I see the following:
Model identifier: lumi.sensor_switch
IEEE: 0x00158d000152d709
Basic Cluster 0000
On/Off Cluster 0006
Running deCONZ with dbg-aps/dbg-info it shows the following when pressing and releasing the button (same messages):
Button down:
11:53:53:750 APS-DATA.indication srcAddr: 0x00158d000152d709, dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 255, rssi: -47
Button release:
11:53:53:959 APS-DATA.indication srcAddr: 0x00158d000152d709, dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 255, rssi: -46
There is also no difference in messages when the button is hold down for a longer time, except a longer time between the first and second message.
Is it possible to integrate this button in the REST api?
If you need any additional information to integrate the button in the REST api, please let me know.
The text was updated successfully, but these errors were encountered: