Skip to content
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

Aqara Wall Switch WXKG02LM not reporting App/Rest-API #890

Closed
juzta opened this issue Oct 21, 2018 · 28 comments
Closed

Aqara Wall Switch WXKG02LM not reporting App/Rest-API #890

juzta opened this issue Oct 21, 2018 · 28 comments

Comments

@juzta
Copy link

juzta commented Oct 21, 2018

Hello all,

I got the Aqara Wall Switch Wireless 2 buttons connected to Deconz but it is not showing up in the Rest-API or WebApp.

Windows 10
Version 2.05.20 / 4/8/2018
Firmware 261F0500

Model I'm using, https://www.gearbest.com/alarm-systems/pp_610095.html

Am I missing something here?

Thereby, I see that there are new versions of deCONZ and FW updates, but these are only for ARM. Is there some sort of time frame when this is being released for x64?

eq1
eq2
eq3

Thanks!

@juzta
Copy link
Author

juzta commented Oct 21, 2018

After clicking a few times on the button I noticed that it has updated the cluster info tab with some additional info.

eq4

@ebaauw
Copy link
Collaborator

ebaauw commented Oct 21, 2018

This seems to be a newer model of the lumi.sensor_86sw, and needs to be whitelisted explicitly.

I doubt whether the endpoints have been read in full; you're running an older version of deCONZ (and of the ConBee firmware). Did more clusters appear after button presses (left, right, both)?

Could you run deCONZ with --dbg-info=1 --dbg-aps=2 flags and check what commands teh switch sends when pressing/releasing/holding the buttons? If it's like the lumi.sensor_86sw, it would send a Report Attributes commands for the OnOff cluster on press, from endpoint 0x01 for the left button, 0x02 for the right button and 0x03 for both buttons.

@juzta
Copy link
Author

juzta commented Oct 21, 2018

Stupid question, how can I run Windows version of deCONZ with --dbg-info=1 --dbg-aps=2? Adding them to the target of the shortcut?

"C:\Users\Server\AppData\Local\deCONZ\bin\deCONZ.exe --dbg-info=1 --dbg-aps=2" seems to change nothing?

And where ccan I check what commands have been sent?

@Rolf56
Copy link

Rolf56 commented Oct 21, 2018

I tried to connect a new Xiaomi Aqara wall switch too. It was found in the deCONZ GUI with the name Light 8, Vendor is shown as unknown. On the Phoscon App web page I can't see the switch, only a lamp with name Light 8.

I found this deconz-rest-plugin page now, what could be the solution for my problem.
Can me please someone explane how to to install the deconz-rest-plugin-master on my windows pc or is it for RasberryPI platform only?

Windows 10
Version 2.05.20 / ‎08‎.‎04‎.‎2018
Firmware 261F0500

nodeinfo

@ebaauw
Copy link
Collaborator

ebaauw commented Oct 21, 2018

Stupid question, how can I run Windows version of deCONZ with --dbg-info=1 --dbg-aps=2?
And where ccan I check what commands have been sent?

Sorry, I have no clue about Windows.

I tried to connect a new Xiaomi Aqara wall switch too.

This is a mains-powered wired in-wall switch (by the looks of it a lumi.ctrl_ln?), not a battery-powered wireless wall switch. It's exposed as a light, to control the wired light(s). If it is indeed a lumi.ctrl_ln switch, there should also be three /sensors resources, a ZHASwitch, a ZHAConsumption, and a ZHAPower.

Can me please someone explane how to to install the deconz-rest-plugin-master

The REST API plugin is distributed with deCONZ. This repository is needed only, if you want to make changes to the plugin and/or compile it yourself. It is only supported on Raspbian, see https://github.com/dresden-elektronik/deconz-rest-plugin#supported-platforms.

The latest Windows beta of deCONZ (incl. the REST API plugin), v2.05.40, can be downloaded from https://www.dresden-elektronik.de/deconz/win/

@juzta
Copy link
Author

juzta commented Oct 21, 2018

Thanks, atleast I have a newer version of the deCONZ SW and REST API. Was not able to find this URL somewhere else.

Sadly it didn't change that it is still not showing up in the REST API or PWA. Information in deCONZ GUI has not changed about the device compared to previous version.

@juzta
Copy link
Author

juzta commented Oct 21, 2018

Actually the end points have been changed for the device

eq

@ebaauw
Copy link
Collaborator

ebaauw commented Oct 21, 2018

Sadly it didn't change that it is still not showing up in the REST API or PWA.

That was to be expected; the switch will have to be whitelisted, before it will show.

Actually the end points have been changed for the device

That's more like it, but still no OnOff clusters. And no Multistate Input on endpoint 0x03. Could you check in the deCONZ GUI if the Present Value attribute 0x0055 of the Multistate Input cluster changes on button presses?

@juzta
Copy link
Author

juzta commented Oct 21, 2018

I connected it to the Xiaomi GW I still had to see if there was maybe some FW updates for the switch. Removed the GW again from socket and tried reconnecting it to deCONZ. Now I'm having troubles that deCONZ is not able to pair with it anymore? Tried adding sensor, switch, open network.. standing 10cm away from the stick.

Removed the the node ofcourse from deCONZ but everytime I restart deCONZ the note is there again, but without any connection or lines to one of the coordinators or routers.

Why is the device not being totally removed and can I add it again?

@ebaauw
Copy link
Collaborator

ebaauw commented Oct 21, 2018

Did it update the firmware? You need to factory reset the switch, I guess by holding one or both buttons for 10 seconds, until the LED blinks reds. Make sure to open the network (search) from Phoscon, not from the GUI. Try reading the Basic cluster attributes while pressing/releasing a button every second or so, to make sure the switch is awake.

@Rolf56
Copy link

Rolf56 commented Oct 21, 2018

Thank you. The latest Windows beta of deCONZ (incl. the REST API plugin), v2.05.40 shows the device as lumi.ctrl_In2.aq1 as two lamps now. The relays can be switch from the WebApp by clicking on the bulb. Scenes do not work and there are no /sensors resources shown.

@ebaauw
Copy link
Collaborator

ebaauw commented Oct 21, 2018

Phoscon probably doesn't yet support the /sensors resources. You should be able to see them using the REST API. Check the mac address in the uniqueid to match the resources.

If they don't show, search for devices from Phoscon, then read the Basic cluster attributes in the deCONZ GUI. That should trigger the creation of the /sensors resources.

@juzta
Copy link
Author

juzta commented Oct 21, 2018

Thanks for your clear ebaauw.

To be sure, Rolf56 is talking about some other problem with an other type. I'm using the Wireless version.

I seem to not be able to remove this node from deCONZ. I tried deleting is 100 times, rebooting, etc.. its unresponsive to any action.

eq5

0x8D85 = the Aqara Wireless Switch

any other methods to clear an entry like this? Because I'm also not able to reconnect the switch to deCONZ now. Tried factory resetting multiple times.

deCONZ is now on
Version 2.05.40 / 10/8/2018
Firmware 26240500

@juzta
Copy link
Author

juzta commented Oct 21, 2018

Oke I hard deleted the record 0x8D85 from the zll.db with DB Browser in table devices. It is gone from the GUI now after restarting but still can't seem to reconnect the switch to deCONZ with this latest SW+FW version

@Rolf56
Copy link

Rolf56 commented Oct 21, 2018

I use the wired switch.
At the moment I'm try to use the REST API. I always get following error:
jason-error

@juzta
Copy link
Author

juzta commented Oct 21, 2018

Read http://dresden-elektronik.github.io/deconz-rest-doc/getting_started/

use raw undereath the ip address and type the stuff that is also seen there on the picture.

@manup
Copy link
Member

manup commented Oct 21, 2018

You may also try the latest version 2.05.42, it has some improvements related to deleting sensors and lights.

https://www.dresden-elektronik.de/rpi/deconz/beta/deconz-2.05.42-qt5.deb

Deleting a node in deCONZ won't purge it from database, for that you need to delete it via REST-API or if shown delete it from the Phoscon App.

@juzta
Copy link
Author

juzta commented Oct 21, 2018

Thanks, just a new version I see. Now on
Version 2.05.42 / 10/21/2018
Firmware 26280500

I purged it myself from the DB with DBBrowser. It never appeared in the REST-API so I'm not sure if I can even delete it from there?

@juzta
Copy link
Author

juzta commented Oct 22, 2018

I'm still unable to connect the device to deCONZ. Removed everything from deCONZ to start with fresh setup. 10sec hardreset, LEDs start blinking like they should but it is not pairing. Replaced batteries twice to see if that helps.. nothing..

What can I do differently?

@manup
Copy link
Member

manup commented Oct 22, 2018

I reckon you use ConBee? If the device doesn't even show up in deCONZ you may try to use a USB extension cable so that the ConBee is not directly connected to the PC, in some cases this caused issues due some interference.

@juzta
Copy link
Author

juzta commented Oct 22, 2018

Oke will try tomorrow. But I also tried on an other PC With different versions of deCONZ.

Yes I’m using Conbee.

While searching On the web I also See that they had Some issues With Homey and these New 2018 version of the switch. https://community.athom.com/t/xiaomi-aqara-smart-home-zigbee-app-v0-4-3/156/2

@juzta
Copy link
Author

juzta commented Oct 25, 2018

Sadly it didn't change that it is still not showing up in the REST API or PWA.

That was to be expected; the switch will have to be whitelisted, before it will show.

Actually the end points have been changed for the device

That's more like it, but still no OnOff clusters. And no Multistate Input on endpoint 0x03. Could you check in the deCONZ GUI if the Present Value attribute 0x0055 of the Multistate Input cluster changes on button presses?

So after a super tiresome proces of trying to reset this switch I finally succeded with the following method.

Holding one of the keys until all 3 LEDs starting to burn, at that exact moment pull out of the battery. Of this I was able to pair it again. Maybe luck.. maybe a condensator that finally decharged.

So within the 2.05.42 version I have the following end points. As you can see also on the 03.
knipsel2

So.. checking this 0x0055 value in the Multistate input cluster.

2knipsel

Left button gives a change to this on value 0x01 from 0 to 1 or the other way around. But not like that you click and it goes to 1 and another click it is 0 again..

Right is 0x02.. same behaviour

0x03 changes when pressing left and right at the same time.. from 1 to 2 or other way around.

Not sure where to go from here... :-)

@ebaauw
Copy link
Collaborator

ebaauw commented Oct 25, 2018

Ah, it’s a stateful switch. Probably, when used with the Xiaomi gateway, first press/release is to turn on associated lights, second is to turn them off again. We could create different buttonevents for these (effectively exposing 3 On and 3 Off buttons; buttonevent values 1002, ..., 6002), but it probably makes more sense to map both On and Off to the same buttonevent (resulting in 3 Toggle buttons; buttonevent values 1002, ..., 3002). That the endpoint corrsponds to the buttons (1 = left, 2 = right, 3 = both) is quite common for the Xioami switches.

@juzta
Copy link
Author

juzta commented Oct 25, 2018

3 Toggle buttons makes most sense yes. The rest of the "intelligence" can be done by Home-Assistant imo. Making the Xiaomi switches have the same logic makes also most sense.

So how to proceed? I also just fetched some Wireshark information but not sure if this adds any value. There is clear communication for that 0xAF21 source when clicking on the buttons.

@ebaauw
Copy link
Collaborator

ebaauw commented Oct 26, 2018

Yes, the switch sends Report Attributes commands for the Multistate Input clusters. The GUI already uses these to display the attribute value. We’ll simply have to whitelist the model, create a buttonMap, and link the model to it. I’ll see if I can cook up a PR.

@juzta
Copy link
Author

juzta commented Oct 26, 2018

Thanks! You are a winner!

@manup manup changed the title Aqara Wall Switch not reporting App/Rest-API Aqara Wall Switch WXKG02LM not reporting App/Rest-API Nov 5, 2018
@veeceeoh
Copy link

veeceeoh commented Nov 19, 2018

Sorry to raise this thread from the dead, but I believe the new 2018 revision of the 2-button Aqara Wall Switch (WXKG02LM) with ZigBee product ID lumi.remote.b286acn01 may actually support single-press, double-press, and hold on each of the two buttons.

I don't yet own one of the new WXKG02LMs, and haven't received any reports from SmartThings or Hubitat users with one, but in my searching I see that the Homey driver for the WXKG02LM supports single-/double-press and hold.

Also this announcement article on Xiaomi Today for the new 2018 revision Aqara Wall Switch models seems to confirm single-press, double-press, and hold support by saying "the dual-key version has seven different functions".

If I understand the Homey driver code correctly, the data needed to identify single-press, double-press, and hold is also included in Multistate Input attribute reports.

EDIT: In this GitHub thread regarding adding support of the new revision WXKG02LM for the zigbee2mqtt solution, it is directly stated that it supports single-press, double-press, and hold on each of the buttons as well as for both buttons pressed together.

The updated zigbee2mqtt code indicates that the data portion of attribute reports from Multistate Input includes values for single-press, double-press, and hold.

@manup
Copy link
Member

manup commented Nov 24, 2018

Thanks for the information, please continue discussion in #811

Closing this issue so we have just one to track progress on the matter.

@manup manup closed this as completed Nov 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants