Deconz/Aqara Dual Switch WXKG02LM Rev.2 Issue

Hi Guys

I am a complete noob. I am running the latest version of HA 89.1, though this issue has been bugging me for a few versions before that! I am running HA on a windows box using Python (latest version). I have a Deconz Conbee USB stick plugged into the PC and is running well. The version of Deconz is the latest v 2.05.59.

So the issue I have is that I have a Aqara Dual switch wireless WXKG02LM Rev.2 (2018). In HA integrations tab I look at the deconz gateway and then the switch only shows one entity ID (i.e. i cant see the switches - only the battery level). This is a problem because I need the dual switches. All other Aqara and other sensors seem to work fine through deconz including a motion sensor and light bulb. See image below.

Previously it would show only one switch of the two but now it shows none at all.

Please help :):grinning:

Capture

Hi,
it’s normal. In simple: sensor generate information, switch generate event.
Go to developer menu → states, find your sensor.aqara_2_gang… and try click switch.

Thanks so much for such a quick response karp :slight_smile:

I have looked there. The only thing that shows is sensor.aqara_2_gang_battery_level. I cannot find the left or right click switch listed :frowning:

PS so unlike the below image from the forum I do not have multiple entities for this switch, just one.

sensor.aqara_2_gang_battery_level

Further I have debug mode setup for deconz and all looks well in terms of what it is sending when I click a button.

2019-03-10 13:46:17 DEBUG (MainThread) [pydeconz.websocket] Websocket data {“e”:“changed”,“id”:“11”,“r”:“sensors”,“state”:{“buttonevent”:1001,“lastupdated”:“2019-03-10T00:46:17”},“t”:“event”,“uniqueid”:“00:15:8d:00:02:83:e2:ad-01-0012”}

Any pointers would be appreciated :slight_smile:

There is a dev tool on the sidebar in hass that will show recent events. You should be able to see the button clicks there

Hey Robban

Thanks so much for the quick response. Not using Hass,. Using Python. I am seeing the button clicks in debug mode. Just cannot see them or more importantly the entities in HA like all the other devices.

Check the docs, especially this part;

Remote controls (ZHASwitch category) will not be exposed as regular entities, but as events

aha. Right so in debug mode as per below. Likely the event will be like 1001 and 1002 (though that one is not listed) etc right?

2019-03-10 13:46:17 DEBUG (MainThread) [pydeconz.websocket] Websocket data {“e”:“changed”,“id”:“11”,“r”:“sensors”,“state”:{“buttonevent”:1001,“lastupdated”:“2019-03-10T00:46:17”},“t”:“event”,“uniqueid”:“00:15:8d:00:02:83:e2:ad-01-0012”}

Yes, that is how it works. And as @Robban wrote you can see recent events in the dev tool in the side bar as well.

Sorry. I know this is second nature to you. I am really struggling with some stuff its a very steep learning curve!

So I read here https://www.home-assistant.io/docs/configuration/events/ How do i see the event? I know where to go i just don’t know what buttons to push sorry!!!

And just so I am really clear once i have my events i add them in my automations.yaml file i will need something like this for every light switch for every event like turning on.off the lights etc?

automation:
  - alias: 'Toggle lamp from dimmer'
    initial_state: 'on'
    trigger:
      platform: event
      event_type: deconz_event
      event_data:
        id: remote_control_1
        event: 1002
    action:
      service: light.toggle
      entity_id: light.lamp

I know it can be a steep learning curve, but I’m not sure what you’re struggling with as the documentation is pretty clear in my opinion. Start by using the example code from the docs and work from there.

Changing event: 1002 to event: 2002 will change from the second to the first button. The id: is in your case lumi.remote.b286acn01 as you can see from the battery level sensor.

automation:
  - alias: 'Toggle lamp from dimmer'
    initial_state: 'on'
    trigger:
      platform: event
      event_type: deconz_event
      event_data:
        id: remote_control_1
        event: 1002
    action:
      service: light.toggle
      entity_id: light.lamp

Thanks so much sjee. The event bit was what I missed. Promise I have read it, just don’t quite get some of it and wondered why I couldn’t see entities like the other devices.

When I say steep learning curve i meant overall, not specifically this. I am not a coder and you kinda need a very logical mind and that is not so much me. Thing is that HA is really the only option for the devices I want to use. All other hubs etc only do parts of the job.

I really appreciate both you and Robban’s help. I have been trying to get this right for weeks, reading the forum etc.

1 Like

PPS will the battery level sensor work correctly at some point? According to the Xiaomi hub it’s down a bit from 100% and always seems to show 100%

No worries, take it step by step. The battery level works but it’s not very accurate. The level can suddenly drop down and stay low for a long time.