Conbee xiaomi WXKG02LM switch shows as battery

My problems stem from the conbee2 and Deconz :confused:
I was previously using zigbee2mqtt and as far as functionality, everything was almost perfect… a little difficulty in configuration but at leat it made sense… With Deconz I’m finding all sorts of horrible idiosyncrasies apart from the fact that you can’t create an automation in the ui (for the sure buttons - WXKG11LM)

For example the power sockets don’t appear in any way linked to the name of their devices… I have sensor.consumption_11, sensor.consumption_13, sensor.consumption_15, sensor.consumption_18… I mean these devices (show up as lights in phoscon) were named before I added the home assistant integration. I don’t understand why it’s all so convoluted.

According to Phoscon my firmware is up to date:
41%20pm

It just arrived today and so far I’m very disillusioned.

Also make sure the deconz add-in is up to date. The last update to deconz also made things better for me.
I must admit i dont use ui to create automations. Too many occasions where the ui isn’t sophisticated enough yet … but it is getting better.

So, having a play with the UI for automations for your benefit, bearing in mind I have automations in place in the yaml file, this is what came up… and I am as confused as I guess you might be.

WXKG02LM_double_deconz

Also deconz here is 3.6

and conbee2 is different to yours…
conbee2

Finally, the yaml I use for xiaomi single and double switches.

- id: switch1S
  alias: Click switch 1
  trigger:
    platform: event
    event_type: deconz_event
    event_data:
      id: single_switch_1
      event: 1002    
  action:
    service: light.toggle
    data:
      entity_id: light.hall
      brightness: 255

- id: switch2RS
  alias: Right button click switch 2
  trigger:
    platform: event
    event_type: deconz_event
    event_data:
      id: double_switch_2
      event: 2002    
  action:
    - service: light.toggle
      data:
        entity_id:
          - light.hall

What is it that gets you confused?

Well @Robban I have two switches with the same part number from Xiaomi. One is a single, the other a double. Both have the same single, double click and hold events.
The confusion is that one shows up as a ‘device’ with its capabilities fully detailed in the drop-down list, the other showed as an ‘event’…
I have got both working as I would wish using yaml but others seek to use the UI to create scripts…

How do you mean it shows Up as an event?

Device triggers is a manually curated list so if a device isn’t supported there isn’t a mapping. See deconz integration documentation on how to request support for new device triggers

@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: