Conbee xiaomi WXKG02LM switch shows as battery

@Robban I had set the two switches up using yaml and am happily using them.
In support of @mihalski problems, I then went to the automation creation UI. I picked the double switch version of WXKG11LM and I then ‘picked’ the ‘device’ option and the list of triggers populated. I then picked the single version of the same switch model and it prepopulated it with ‘event’ and the data I showed in the image. Is this helpful to know?

According to the list of integrations:

  • Aqara Round Switch
  • Aqara Square Switch

This is not true as demonstrated in my example. The round switches are indeed supported but the square ones are not.

I might dig around in the integration to see if this is an oversight or if there is some variability in how the square switches identify themselves (mine is a WXKG11LM).

I found this:

AQARA_ROUND_SWITCH_MODEL = "lumi.sensor_switch"
AQARA_ROUND_SWITCH = {
    (CONF_SHORT_PRESS, CONF_TURN_ON): 1000,
    (CONF_SHORT_RELEASE, CONF_TURN_ON): 1002,
    (CONF_DOUBLE_PRESS, CONF_TURN_ON): 1004,
    (CONF_TRIPLE_PRESS, CONF_TURN_ON): 1005,
    (CONF_QUADRUPLE_PRESS, CONF_TURN_ON): 1006,
    (CONF_QUINTUPLE_PRESS, CONF_TURN_ON): 1010,
    (CONF_LONG_PRESS, CONF_TURN_ON): 1001,
    (CONF_LONG_RELEASE, CONF_TURN_ON): 1003,
}

AQARA_SQUARE_SWITCH_MODEL = "lumi.sensor_switch.aq3"
AQARA_SQUARE_SWITCH = {
    (CONF_SHORT_PRESS, CONF_TURN_ON): 1002,
    (CONF_DOUBLE_PRESS, CONF_TURN_ON): 1004,
    (CONF_LONG_PRESS, CONF_TURN_ON): 1001,
    (CONF_LONG_RELEASE, CONF_TURN_ON): 1003,
    (CONF_SHAKE, ""): 1007,
}

I’m not 100% sure on the details here… but my switch is the lumi.sensor_switch.aq2 rather than aq3… My understanding is that it supports the same features minus the shake. I can’t test to see if this is so as I use hass.io on HassOS so my Home Assistant installation is immutable.

P.S. The lumi.sensor_switch is the round switch.
P.P.S. Apparently np long press or long release… “only single, double, treble, and quadruple presses.”

I have the square aqaura switch and it works fine in deconz

There is no “the” square switch… like I mentioned above there are at LEAST two versions of it, and the aq2 is not listed in the source of the decent integration.

Well if it helps mine is WXKG11LM
and shows as this in the old zigbee database i mained befpore porting to deconz

lumi.sensor_switch.aq2

That means it doesn’t work as I described and illustrated in the automation builder.

It may require you to request the device trigger be added, as there are different versions of this switch. The aq3 is actually a different model number (Xiaomi-WXKG12LM ) and the device trigger is probably only for a that one and not the ones we use.(aq2)
By default remotes use the events service and the device trigger needs to be added in the integration for the device to use it

until then you can use the deconz_event using the automations ui to use as triggers
image

Yes I know. That’s where the code I pasted was from.

I intend to try copying the component into custom_components and modifying it to see if I can add it myself. Make could make a PR then.

I added a single press as whether short or long the same event is returned upon button release.

CONF_SINGLE_PRESS = "remote_button_single_press"

And of course the mappings:

AQARA_SQUARE_SWITCH2_MODEL = "lumi.sensor_switch.aq2"
AQARA_SQUARE_SWITCH2 = {
    (CONF_SINGLE_PRESS, CONF_TURN_ON): 1002,
    (CONF_DOUBLE_PRESS, CONF_TURN_ON): 1004,
    (CONF_TRIPLE_PRESS, CONF_TURN_ON): 1005,
    (CONF_QUADRUPLE_PRESS, CONF_TURN_ON): 1006,
}

Unfortunately this is not enough to make it work. I guess I’m overlooking some other vital part of this system.

EDIT: OOPS!! Of course!

AQARA_SQUARE_SWITCH2_MODEL: AQARA_SQUARE_SWITCH2,

in REMOTES = {}.

Now it almost works, sans the single click I added which is obviously mapping to another name for automations somewhere.

43%20pm

EDIT: It was the translations… So I added the necessary item to the English translation and voila!

37%20pm

Could you please explain in detail where you added these lines of code?
I have multiple square buttons and some work as expected and some are only shown as battery.

Well…Update of HomeAssistant solved the issue. :muscle: