Conbee xiaomi WXKG02LM switch shows as battery

I feel certain I have seen the solution to this but cannot find it. Can anyone direct me.?

I have deconz installed into hassio HA. Conbee/deconz found my two double switches and they show in Integrations as battery level. Posts I’ve found have suggested looking at events and listening but deconz_events not listed in right side of events page.

I think the solution is a bit of json code but …

They are not visible on the event page. You can subscribe to the events to see what happens or look at deconz vice triggers for automations

Thanks for responding, could you be more explicit. I don’t know what you mean by ‘subscribe to events’ etc.
Thanks in anticipation !

Hello ianadd,

Go to “Dev Tools” - “Events” and start listening with: “deconz_event”

Maybe it helps…

1 Like

Thanks for your suggestion, however as I said in my post my events page does not list deconz_event despite deconz being installed and working.

The conbee has found my hue hub sunrise/set event. It has also found the two switches and I see them in the integration page. However it has recognized their battery level sensor not the switch triggers.

I have seen it suggested that the deconz_event does not appear on the events page until a trigger has been received, this may be related to my problem ??

Just type it in the box

I also had problems integrating with my Xiaomi Cube, it was shown as “switch_13” and “switch_14” !!! I think you are not the only one with the problem, look here …

Good luck…

Ok, progress

I chose the ‘*’ event listener which I hadn’t noticed before.
It shows all events and lo.

I click a switch and out comes this:
{
“event_type”: “deconz_event”,
“data”: {
“id”: “switch_4”,
“unique_id”: “00:15:8d:00:02:f3:89:b8”,
“event”: 1002
},
“origin”: “LOCAL”,
“time_fired”: “2019-10-05T10:26:32.782827+00:00”,
“context”: {
“id”: “291132445e9e4ede895b651186af79cc”,
“parent_id”: null,
“user_id”: null
}
}

To stop me floundering what do I do with this knowledge to cause the switch to trigger a light for example.

Woohoo, I’ve cracked it.

Automation created from the above event and it works.

##
# Test switch
##
- id: switch1LS
  alias: Left button click switch 1
  trigger:
    platform: event
    event_type: deconz_event
    event_data:
      id: switch_4
      event: 1002    
  action:
    service: light.toggle
    data:
      entity_id: light.kitchen
1 Like

In frontend automations look up device triggers, your deconz remotes should be listed there as well

Very good… :+1:

I’m having the same sort of problem with my square Xiaomi buttons. Just a battery trigger:

The round buttons work as expected:

This doesn’t really seem to make sense.

I had all sorts of frustrations until I discarded the xiaomi hub and used a conbee2 and the deconz add-in. The only hurdle I then had to cross to get beyond the battery only issue was to get the conbee2 firmware up to date. This I resolved by plugging it into my PC and it immediately upgraded.

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