Driver for Aqara Wireless Switch WXKG16LM

I bought a Aqara ZIGBEE Wireless SINGLE BUTTON Switch. It is quit a new type: WXKG16LM.
I tried both the driver Reworked for use with Hubitat Elevation hub by gn0st1c with additional code by veeceeoh AND the Generic Zigbee Switch driver.
Both do not seem to give the right configuration and when I put the switch in a scene nothing happens when I press the button.

I see at State Variables, there a no buttons active...

  • numOfButtons : 0
  • flashing : false
  • bin : 1

Can anybody tell me how to change the number of buttons? (If that will be the solution to get this working).
greetings
Mart

A quick custom app (15 mins maybe) could generate a sendEvent(name:”numOfButtons”,value:1) but the driver should pick that up on its own, and if it isn’t then you could have further issues down the road.

Just a thought - Have you tried any of the inbuilt Zigbee drivers such as Tuya Zigbee Scenw switch

Is your switch this one : Aqara E1 Wireless Remote Switch (Single Rocker) WXKG16LM Zigbee compatibility

These are new Aqara E1 series switches and unfortunately, at the moment there are no known Hubitat drivers that will work 100% with these devices. You can search this forum for 'Aqara double rocker' - this is another switch, but from the same E1 series - have you tried all the drivers mentioned in these threads?

To kkossev and njande. I tried the Tuya Zigbee Scene Switch but that did not changed the number off buttons. I will have a look for the double rocker. I found one other that might fit (if I change it a bit, which I am not very experienced in) Hubitat/zigbee-aqara-wall-switch-expanded.groovy at release · markus-li/Hubitat · GitHub. Would that be an idea?
To thebearmay: I am afraid I am not (so far) skilled enough to know how yo make a custom app with the command you mention.

To Kkossev: Yes, that is the switch.

This should be close:

App Code
/* 

 *  Licensed Virtual the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */

static String version()	{  return '0.0.1'  }


definition (
	name: 			"Button Number", 
	namespace: 		"thebearmay", 
	author: 		"Jean P. May, Jr.",
	description: 	"Quick app to change the number of buttons",
	category: 		"Utility",
	importUrl: "https://raw.githubusercontent.com/thebearmay/hubitat/main/apps/xxxxx.groovy",
	oauth: 			false,
    installOnOpen:  true,
    iconUrl:        "",
    iconX2Url:      ""
) 

preferences {
   page name: "mainPage"
}

def installed() {
    log.info "${app.name} v${version()} installed()"
    state?.isInstalled = true
    state?.singleThreaded = true
    initialize()
}

def uninstalled() {
    log.info "${app.name} v${version()} uninstalled()"
    removeDevice()
}

def updated(){
//	log.trace "updated()"
    if(!state?.isInstalled) { state?.isInstalled = true }
	if(debugEnable) runIn(1800,logsOff)
}

def initialize(){
}

void logsOff(){
     app.updateSetting("debugEnable",[value:"false",type:"bool"])
}

def mainPage(){
    dynamicPage (name: "mainPage", title: "", install: true, uninstall: true) {
      	if (app.getInstallationState() == 'COMPLETE') {   
	    	section("Main")
		    {
                input "qryDevice", "capability.*", title: "Select the device to change:", multiple: false, required: false, submitOnChange: true
                			
                if (qryDevice != null) 
                    input "button1", "button", title: "Send Button Number"
                if(state?.buttonPushed) {
                    state.buttonPushed = false
                    qryDevice.sendEvent(name:"numOfButtons",value:1)
                }
                    
		    }
	    } else {
		    section("") {
			    paragraph title: "Click Done", "Please click Done to install app before continuing"
		    }
	    }
    }
}


def appButtonHandler(btn) {
    switch(btn) {
        case "button1":
            state.buttonPushed = true
            break
        default: 
            log.error "Undefined button $btn pushed"
            break
      }
}
def intialize() {

}

My advice will be to put this Aqara switch aside and use something else, until a proper driver for Hubitait is written especially for it.

This is a rather complex device that operates in several different modes and needs a driver that configures it properly.

Beware, in one of the operational modes this Aqara device uses Zigbee Group Messaging to broadcast on/off commands to all Zigbee switches/plugs that support Zigbee groups. A lot of devices by default use group #0, which means that all or most of your other switches, plugs, and bulbs may be suddenly switched off/on, without Hubitat hub control!

1 Like

Hi Jean. thanks for your effort so far. I added the code as a user app and run it. I woke up the switch just to be sure ( I now had the generic Zigbee swich as drover), but there is no change in the buttom parameter. Maybe it is best to wait for a decent driver as kkossev suggest...

Thanks four your advise. If things are so complicated then I´ll better wait a bit. I felt for the switch for the look and also the price. But I had better checked compatibility first then. However, it would be nice to have a button, just for leaving and entering the house (I don´t intend to use my phone for that). Where I live I can get a Button – Aeotec but that is also not in the list of supported devices. Do you have suggestion for one that will work Zwave is also fine for me if it will respond quickly. The one I had took ages to wake up.

You can try the previous of this button:
Model WXKG06LM , D1 Wireless Remote Switch
This works fine with Smartthings, looks the same as the E1 model. I have both, E1 (don't work) and D1 (work fine).
I my opinion should works also in HE.