Xiaomi WXKG02LM switch automations stopped working


I don’t use this switch often so its possible I missed a breaking change somewhere but I can’t find what it is. I have the WXKG02LM configured in Zigbee2Mqtt and I can see the correct messages being sent in MQTT but my automations have stopped working. I also noticed that this device now has a sensor.0x00xxxxxxxxxxxxxxxxx_click entity which shows left/right/both.

Below is an example of how I am using this switch, any suggestions as to what I am doing wrong?

- alias: Laundry Light lock off
  initial_state: true
    platform: mqtt
    topic: "zigbee2mqtt/Hallway_Switch"
    - condition: template
      value_template: "{{ 'left' == trigger.payload_json.click }}"
    - condition: state
      entity_id: input_boolean.laundry_lightlock
      state: "on"
    - service: homeassistant.turn_off
      entity_id: input_boolean.laundry_lightlock
    - service: light.turn_off
      entity_id: light.0x94103ef6bf437ec2_light, light.toilet1
        transition: 10

Thank you

I think this is the same issue as mine - however I am not using zigbee2mqtt (ZHA). Which leads me to think perhaps this is a core issue or change, specifically the ‘click’ command I think perhaps?

1 Like

Thanks, it does sound like the same issue.

What is interesting is sometimes the switch does work, but only on the “both” click and it only works 10% of the time I click both. Left or right never works.

Not sure if this will end up being the same - but I found a solution to my issues with two different sorts of devices, one being Xiaomi button. LINK

With the Xiaomi button, I was using this with 114.3 and below:

Trigger type: event
Event Type: zha_event
Event Data:
  click_type: single
  unique_id: '00:15:8d:00:01:3e:a2:07:1:0x0006'

Post 114.3, I found that this becomes an option:
Trigger type: device
Device: Garage Button (friendly name of switch - available in a drop down menu!)
Trigger: “remote_button_short_press” button pressed

I hope this can help with your issue too - if not, take a look at my post re the templates change and see if that may perhaps have an effect on your situation. Good luck!

Thanks for replying. This has all started working again either with a home assistant update or a zigbee2mqtt update, I am not sure which one.