-
Notifications
You must be signed in to change notification settings - Fork 482
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
Xiaomi Aqara Wall Switches #356
Comments
Looks like they do - see endpoint 0x03.
I'd expect the REST API to create already an on/off light for this? Did you open the network from the Settings in the Web app, or from the deCONZ GUI? The REST API will only create a resource when you open the network from the Web app. Could you open the Cluster Info panel on the Basic cluster on endpoint 0x01, Read the attributes, and post a screenshot? It might take a couple of attempts, but as this switch is mains powered it might work straight away. We would especially need the Manufacturer Name and the Model Identifier. If they work like the other Xiaomi switches, you might need to press briefly the reset button, to have the switch report it's Basic attributes. The switch looks very similar to the QBKG03LM (#335) and the WXKG02LM (#165), so maybe adding the name is enough to get the buttons to work with deCONZ. You wouldn't be able to sniff the ZigBee network and see what messages the switch sends? |
Hi @ebaauw , I did try both, WebUI (deCONZ plain) and deCONZ GUI. I even tried Phoscon. The screenshot requested: (btw, deCONZ 2.04.99 with the built REST-plugin) I believe it is VERY similar if not the same, as the other QBKG03LM Kind regards, Tom. |
Oh, I do not have a sniffer ready, but....I do have a dusty RaspBee and a spare pi lying around. |
Not - you'd need a ConBee. |
oh, well I do have a conbee, as my main device. Can I do this without messing up my setup afterwards ? (I would have to have to revisit all Hue bulps again :) ) |
You'd need to shutdown deCONZ and flash different firmware to the ConBee, see #69. The deCONZ installation would remain untouched, except for the info stored on the ConBee (stuff like PANID, network key, channel). Best make some screenshots of the deCONZ Network Settings, so you can restore these. deCONZ should prompt to flash the ConBee firmware back. Not sure I would recommend this. I would take the next reinstallation (we're still on beta...) to move production to the RaspBee, before messing with the ConBee. Which reminds me: I still need to do a restore test from my production pi to my test/backup pi (both having a RaspBee). |
@manup As a side-note to the lumi.ctrl_neutral2, I also have a lumi.ctrl_neutral1 (One Button in-wall switch) Now, can we get the one that has a typo (neural2 instead of neutral2) fixed, + this one with neutral1. I would also like to see this as a light ON/OFF, as this is what it supports. I can click on the On/Off/Toggle button and that works great: When the switch (light) is "OFF", this is shown: When the switch (light) is "ON", this is shown: Please let me know if you require more info. Kind regards, Tom. |
I would expect the OnOff cluster on the 03 endpoint to reflect the state of the light. The OnOff on some other endpoint should reflect the state of (one of the) the key(s), probably true for pressed and false when not pressed (there are stateless switches, aren't they?). If they work like the other Xiaomi switches, the value should change life, when you press/release the key. It would be cool if you could reverse-engineer what the Multistate Input clusters represent (i.e. what value to they show under what condition). @manup I don't understand why the On/off light isn't exposed. Could it be a ZLL On/off light on a ZHA endpoint (would deCONZ display it like this)? @mathos77, I'm happy to submit a PR for support of the switches, but you'll have to wait for Manual to return and release a new version. |
Hi @ebaauw Erik, That would be cool. if you can create the PR. |
Yes, we’d need to understand how the attribute value for each cluster changes when you press/release/hold a (or both) key(s). Typically, attribute 0x0000 of cluster 0x0006 of endpoint 02 would be true while you hold the left button and false after you release it. Same for the right button and endpoint 04. Maybe endpoint 05 for both buttons. I’m hoping the multistate input (endpoint 05, cluster 0x0012, I think attribute 0x0055) might provide more specific info, like different values for press, double press or so. We need to map these to the |
Hi Erik, okay, I will test this tonight with both the single and double key switches |
Hi @ebaauw , I have tested the single-key wall switch (lumi.ctrl_neutral1) which I also added to the 2.04.99 version of the REST plugin before building it. It is added as a sensor, but not doing anything (actually 3 clusters are added) Futher, the only status I see changing is under EP 02 0x0000, Cluster 0x0006: On this EP/Cluster, I can also utilize the Toggle, On and Off buttons to switch the light on/off |
You need to pair the switches with the compiled plugin. Please delete the sensor resources from the REST API, delete the node from the deCONZ GUI and re-pair the sensor. It might be prudent to shutdown deCONZ and remove physically the Deleted sensor resources from the database (in Something odd is going on: the GUI screenshots only show endpoints 01, 02, 03 and 04. The REST resources suggest that there's also endpoints 05, 06, and 08, the first two with a 0x0012 cluster and the last with a 0x000c cluster.
Is this on a one-button switch (
That's probably because this endpoint is still bound to the 03 endpoint. |
I have two one-key switches, and I've been experimenting with them a bit:
I've tried to implement this on my fork, and it seems to work, but sometimes the switch will stop responding to commands until the device is paired again, and I'm not sure what's going on: the log will have several entries saying |
Do you mean the 0x0006 cluster on the 02 endpoint with device type 0xFFFF? What do you mean by "respond to changes"? Did you try the On, Off, and Toggle commands on cluster 0x0006 of endpoint 03 (the On/Off light)?
Bloody hell, it's mains powered but not a ZigBee router. Good catch!
You're exposing endpoint 02 as the light? Won't that break adding it to a group or a scene, as these clusters are on endpoint 03? I think in |
See #335: that has the 05, 06, and 08 clusters in the screenshot, but the 03 cluster isn't an On/Off light. If I were superstitious, I'd say these switches are cursed. |
On my
Endpoint 03, On/off light, cluster 0x0006:
This is why I'm exposing endpoint 02 as the light, but I haven't tried to add them to groups or scenes. Regarding the missing endpoints, the previous screenshots by @mathos77 do have endpoints 05, 06 and 08, like mine do, they seem to have disappeared from his setup? The one on #335 is the two button model, but it has three 0xFFFF endpoints with a 0x0006 cluster instead of two. |
But no On/Off light.
And a 04 0xFFFF endpoint, similar to the two-button switch.
And 04 has changed from device type 0xFFFF and having only an OnOff cluster to an On/Off switch with also a Multistate input cluster? I suspect pairing, deleting, re-pairing using a different version, without removing the deleted records from the database would do this. Probably combined with the usual Xiaomi pairing blues - the device not being read in full. Maybe you need to press briefly the reset button a couple of times while pairing, as is typically needed for the battery-powered Xiaomi switches. Doing some digging on Ali-Express, GearBest and YouTube, the two-button switch actually has two independent light outputs. I would expect it to expose two On/Off lights. I'd theorise that the 02 and 03 endpoints are, in fact, the two outputs, but the 03 is not fully functional on the lumi.ctrl_neutral1. Do you have group and scene clusters on your endpoint 02, or only on 03? |
@manup @ebaauw Can we get something going for these? Please let me know what you require to get these properly supported as both sensor, and switch/light (On/Off). (ps. I can sniffer if that is required) Thanks!!! Kind regards, Tom. |
Hello, got QBKG03LM from Gearbest https://www.gearbest.com/alarm-systems/pp_610096.html , but unable to add to REST plugin & zll DB . It looks like #335, but not working. I'm running 2.05.02, compiled REST plugin. Read all issues about that. Tried to add via REST plugin Web interface, PWA, directly making HTTP POST, but no success. I can see device only in deCONZ GUI and at least EP 2 & 3 cluster 0006 are working, when clicking ON/OFF/TOGLE also captured debug logs, by running: deCONZ_QBKG03LM_libde_rest.log What I'm doing wrong? BR Dalius. |
Thanks that's helpful, 2.05.03 will arrive shortly, this should add the REST sensor resource for lumi.ctrl_neutral2, anyway button events likely need some more work. There will be more debug options too in order to see APS/ZCL payload. |
Version 2.05.03 is online for Raspbian: More noisy debug output via To add the sensor open the network in the WebApp or Phoscon App (search sensors). |
@manup, collected two logs with options adding sensor: and different button combination: BR Dalius. |
From the logs it looks like the switch does only send 3 states like the battery version of the switch. The button events should be:
If you see these via REST API that's all we can do, since the switch does not send events for press and release. |
Looking forward to testing on Ubuntu build! Cheers manup! |
I have the Aqara (single) wall switch. After update to 2.05.23 it works immediately for the first time ever - well done!!! It shows 4 lights in Phoscon (and no sensors); one of the 4 lights can turn the switch on/off (the other 3 are without any function). The only problem I see: when I create group and add this single light and switch the group on/off (which I would like to use with sensor) it does not work - only the single light can be switched on/off. |
serious serious kudos. Deleted the node form deconz gui, deleted the sensor from rest api too and then upgraded to .23 and re-joined the light. It gives me two lamps in the phoscon app (which both work). I have some new daylight sensors and consumption sensors (not sure if they were part of it too). This is fantastic, just what I've been waiting for. Now back to home assistant to get this hooked up with everything else! Thanks so much! |
@tomfritz1, which model is this, the @simonporter007, which model is this, the |
@ebaauw Yup, the lumi.ctrl_neutral2 {
"6": {
"config": {
"battery": null,
"on": true,
"reachable": true,
"temperature": null
},
"ep": 4,
"etag": "da23764c0cd9d001967fec85ac258bed",
"manufacturername": "LUMI",
"mode": 1,
"modelid": "lumi.ctrl_neutral2",
"name": "Kitchen Light",
"state": {
"buttonevent": 1002,
"lastupdated": "2018-04-24T23:43:26"
},
"type": "ZHASwitch",
"uniqueid": "00:15:8d:00:01:6c:73:51-04-0006"
},
"7": {
"config": {
"battery": null,
"on": true,
"reachable": true,
"temperature": null
},
"ep": 8,
"etag": "da23764c0cd9d001967fec85ac258bed",
"manufacturername": "LUMI",
"modelid": "lumi.ctrl_neutral2",
"name": "Consumption 7",
"state": {
"consumption": null,
"lastupdated": "none"
},
"type": "ZHAConsumption",
"uniqueid": "00:15:8d:00:01:6c:73:51-08-000c"
}
} /lights = {
"2": {
"etag": "da23764c0cd9d001967fec85ac258bed",
"hascolor": false,
"manufacturername": "Unknown",
"modelid": null,
"name": "Light 2",
"state": {
"alert": "none",
"on": false,
"reachable": true
},
"swversion": null,
"type": "Smart plug",
"uniqueid": "00:15:8d:00:01:6c:73:51-02"
},
"3": {
"etag": "da23764c0cd9d001967fec85ac258bed",
"hascolor": false,
"manufacturername": "Unknown",
"modelid": null,
"name": "Light 3",
"state": {
"alert": "none",
"on": false,
"reachable": true
},
"swversion": null,
"type": "Smart plug",
"uniqueid": "00:15:8d:00:01:6c:73:51-03"
}
} The other sensors and lights are just ikea/motion sensor stuff I cut out for brevity sake. Cheers, |
How come mine is not working? |
I have the same issue. Only the Light with the name "Xiaomi Wallswitch" works, light 8,9,10 seems to have no effect. EDIT: It looks like, "light 10" is the name of the device in deConz, but "Xiaomi Wallswitch" (former "light 7") is able to turn it on and off. Lights REST:
Sensors REST:
|
@ebaauw here is the /lights }, |
@ebaauw model identification is "lumi.ctrl_neutral1" it is the xiaomi wall switch (single button) |
@alexvandervegt , @simonporter007 , @tomfritz1 , @KingTomaHawk , The PR also parses the Xiaomi magic report for the lumi.ctrl_ln2.aq1, see the
Could you please capture these log messages for the lumi.ctrl_ln1.aq1, lumi.ctrl_neutral1, and lumi.ctrl_neutral2? Thanks. |
@ebauw how can i purge the database? |
When you delete a resource through the REST API, the corresponding record in the database is marked "deleted". When the node is re-discovered, the "deleted" record is restored. For a clean re-pairing, you need to delete the "deleted" records from the sqlite database in I use sqlitebrowser, which, on Raspbian Stretch, is simply installed through |
@manup Can you please upload a new build with the fix included? I'm not very familiar with the build process. |
I created earlier to create a ticket(#543) for my aqara wall switches but @manup refered to this ticket. I have upgraded to latest package available, removed the switches in pwa and database and tried to connect it back to the network. It's paired and I can see it in pwa/device/switches but I can't use it in groups. I tried to read /api/apikey/switches and it's missing. |
This is not a wall switch - please use the original issue. |
I can confirm that the number of detected lights is reduced to 2 (I had to clear the entries from the DB before) :
Light number 7 is the working one. If someone can explain me how to get the the requested --dbg-info=2 log, I will post them too. |
It looks like all other Xiaomi wireless switches dont work now anymore. I just updated to deconz 2.0.5.25 and when i check the logs i see: 11:42:22:645 Daylight now: goldenHour1, status: 160 |
I've only looked at the wired in-wall switches ( |
It seems like none of the light entries are discoverable over the hue Api. Can someone confirm that? |
Any updates about the non working buttons for the wireless switch? |
WXKG02LM & WXKG03LM both work for me using deCONZ v2.05.27 It took several attempts to get them to join and be reported by the REST API. I found that resetting them first by pressing the button for >5 seconds after removing and reinserting the battery had better results. After doing the reset cycle I added them again by opening the network and pressing the button for 5 seconds. Hope it helps! |
Closing this issue, discussion continues in issue #798 |
Hi @manup,
I have ordered these Xiaomi single and double key switches, which are powered by mains.
https://www.gearbest.com/alarm-systems/pp_610096.html?utm_source=email_sys&utm_medium=email&utm_campaign=shipping
https://www.gearbest.com/alarm-systems/pp_625774.html?utm_source=email_sys&utm_medium=email&utm_campaign=shipping
I was hoping to find these supported as being a light (on-off) as they should have this capability.
After joining them into deCONZ, I see this:
Can we get these switches supported, as it would greatly improve my home automation, for places where I do not want a real smart light, so in this case it would become a semi-smart light.
Thanks!
Kind regards, Tom.
The text was updated successfully, but these errors were encountered: