AQARA WXKG02LM (new Hardware Rev)?
Somehow my changes to device.js don't get picked up by my zigbee2mqtt, i.e. after adding the code below, I don't get WARN No converter available for it is still WARN Device with modelID 'lumi.remote.b286acn01' is not supported. when I click a button. Maybe an invisible Unicode char in the modelID?
So here we go with this ticket for another reincarnation of WXKG02LM (edited to refelct now corrected values):
{
zigbeeModel: ['lumi.remote.b286acn01\u0000\u0000\u0000'],
model: 'WXKG02LM',
vendor: 'Xiaomi',
description: 'Aqara double key wireless wall switch',
supports: 'left, right and both click',
fromZigbee: [
fz.xiaomi_battery_3v, fz.WXKG02LM_click_multistate, fz.ignore_basic_change, fz.ignore_multistate_change
],
toZigbee: [],
},
It does support left click, double left click, long left click, double right click, long right click, both click, double both click, long both click, so I guess it would need something like
WXKG02LM_click_multistate: {
cid: 'genMultistateInput',
type: 'attReport',
convert: (model, msg, publish, options) => {
let ep;
let lu;
const value = msg.data.data['presentValue'];
const lookupEp = {
1: 'left',
2: 'right',
3: 'both',
};
const lookup = {
0: {click: ' long'}, // long click
1: {click: ''}, // single click
2: {click: ' double'}, // double click
};
if ((ep = lookupEp[msg.endpoints[0].epId]) && (lu = lookup[value])) {
lu.click = ep + lu.click;
return lu;
}
return null;
},
},
in fromZigbee.js as I did not find a matching genMultistateInput for the Events in the Logs.
Judging by the log, xiaomi_battery_3v should do for the battery voltage.
Logs for clicks: https://pastebin.com/qprUTe0V
Logs for state (battery) https://pastebin.com/KZg08mBV
Further down the rabbit hole, it turns out the modelID really hast Unicode chars: lumi.remote.b286acn01\u0000\u0000\u0000... now it shows up and I can start adding coverters :) β I leave the issue open, until I come up with a solution / pullrequest for now.
=> I got the real modelID out of the data/database.db, maybe that could help others, too, to have it in the wiki.
Because of the UniCode Problem .. we got it here too https://github.com/Koenkk/zigbee2mqtt/issues/286
BTW: Please post your database.db content ..
I paired the device, took the posted ieeeAddr from the log to grep the database:
cat /opt/zigbee2mqtt/data/database.db | grep 0x00158d00027c0d08
{"id":13,"type":"EndDevice","ieeeAddr":"0x00158d00027c0d08","nwkAddr":51894,"manufId":4151,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.remote.b286acn01\u0000\u0000\u0000","epList":[1,2,3],"status":"offline","joinTime":null,"endpoints":{"1":{"profId":260,"epId":1,"devId":24321,"inClusterList":[0,3,18,25,65535],"outClusterList":[0,3,4,5,18,25,65535],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genIdentify":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":2},"attrs":{}},"genScenes":{"dir":{"value":2},"attrs":{}},"genMultistateInput":{"dir":{"value":3},"attrs":{}},"genOta":{"dir":{"value":3},"attrs":{}},"manuSpecificCluster":{"dir":{"value":3},"attrs":{}}}},"2":{"profId":260,"epId":2,"devId":24322,"inClusterList":[3,18],"outClusterList":[3,4,5,18],"clusters":{"genIdentify":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":2},"attrs":{}},"genScenes":{"dir":{"value":2},"attrs":{}},"genMultistateInput":{"dir":{"value":3},"attrs":{}}}},"3":{"profId":260,"epId":3,"devId":24323,"inClusterList":[3,12],"outClusterList":[3,4,5,12],"clusters":{"genIdentify":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":2},"attrs":{}},"genScenes":{"dir":{"value":2},"attrs":{}},"genAnalogInput":{"dir":{"value":3},"attrs":{}}}}},"_id":"F74K4PsdTv7bywzA"}
I'm testing my the converter now... had to add a new lookup table for left, right, both (inkl. long, double). Hope to post in 1-2h.
Could you please provide one full run with DEBUG=* npm start and post this log via pastebin or other ?
Pull request is out... do I need to name the model different than "WXKG02LM"?
Log will follow shortly... new log format for me, got the check what needs to be sanitized. If you are looking for particular entries, I can post that quickly.
Here is the log from DEBUG=* start https://pastebin.com/sdP5CqRW
In your logfile i doesnΒ΄t see any informations of your lumi device .. search failed .
please do following: stop zigbee2mqtt , rename database.db to something else and restart zigbee2mqtt with debug=* npm start .. after that pair again your lumi device.
please report with full log from start to stop.
If search for this: Identified Device: { manufacturer: %s, product: %s }'
your posted log show actually only
Identified Device: { manufacturer: IKEA of Sweden, product: TRADFRI bulb E27 opal 1000lm } +4ms ;)
@k3erg The previous revision allegedly only supports click events for left/right/both. So this new revision sounds pretty interesting. Is there any clue on how to spot this new revision on Gearbest/Aliexpress?
@tb-killa lol, yes, because I had my new model and converters already in place. https://paste.ee/p/eRJnJ
@cybe My mandarin is not very good, so I stick with the numbers and signs :) It is branded as AQARA and carries the same SKU and Model Number as noted on the old box. But if you compare the two boxes the new one has references to Apples HomeKit on it (not very prominent, dough). The new AQARA Gateway is HomeKit compatible. This led to changes in certification policy for compatible products. So the most noticeable change on the new box is the CE and RoHS Logo. There are also different EAN-13 codes on the boxes: OLD: 6 970504 210049 NEW: 6 970504 210516
Not sure if this goes with the policy to directly link the product I ordered: http://s.click.aliexpress.com/e/cpldVy5w I order from that seller quite often, they delivered fast an reliable to me. Hope they come up with new CE certified wired wall switches, too.
Hope this helps.
@k3erg Much appreciated!
Hi, is this device currently working on Home Assistant using zigbee2mqtt?
I have installed Home Assistant in a rapsberry 2 and I can not find the file "device.js" to add the code. How can I configure zigbee-shepherd-converters to add the new WXKG02LM?
Thank you.
The code can be usually found in
/opt/zigbee2mqtt/node_modules/zigbee-shepherd-converters/devices.js
and
/opt/zigbee2mqtt/node_modules/zigbee-shepherd-converters/converters/fromZigbee.js
As of writing this, the working code is not yet merged, but can be found in this PR https://github.com/Koenkk/zigbee-shepherd-converters/pull/62
The code can be usually found in
/opt/zigbee2mqtt/node_modules/zigbee-shepherd-converters/devices.jsand/opt/zigbee2mqtt/node_modules/zigbee-shepherd-converters/converters/fromZigbee.jsAs of writing this, the working code is not yet merged, but can be found in this PR Koenkk/zigbee-shepherd-converters#62
I can not find this path. I use docker, I think this may be the problem. Is there any way to modify the docker image to modify devices.js?
@emiliojose91 Switch inside the running container first, like docker exec -ti zigbee2mqtt sh. If you use the official Docker image, those files are are located in /app/node_modules/zigbee-shepherd-converters/
@k3erg and @cybe Thanks for the answers. I do not know docker, I try to run "docker exec -ti zigbee2mqtt sh" from command line but can not find docker. The installation of Home Assistant was done following the steps of https://www.home-assistant.io/hassio/installation/ in my Raspberry 2. Do I have to install docker to execute this?
Code has been merged - txs for this great project!