ZHA - Xiaomi Mijia Round Wireless Switch (WXKG01LM) - lumi.sensor_switch

Hello @jodur!
I will take a look at that! As you mention, the longpress is not supported by ZHA, but it can be implemented using the ZHA events, as you did with your automation.
Will update here when I got some news.

Both of my switches don’t pop up on the list. Did I miss something?

You are using the Zigbee Home Automation integration, correct?
Go to your devices, and paste here a printscreen of your device here please, something like this:

Hi, this is showing in mine:
there is a device but no entity

Which HA version are you running?
Also, which ZB coordinator are you using?

You can try deleting the device, and re-pairing it, to check if it is recognized properly!

For those that need a hold action, use https://community.home-assistant.io/t/zha-xiaomi-mijia-round-wireless-switch-wxkg01lm-with-hold-lumi-sensor-switch/263075/1

If you’re interested, you can streamline the action like this:

action:
  - variables:
      command: "{{ trigger.event.data.command }}"
      click_type: "{{ trigger.event.data.args.click_type }}"
  - condition: template
    value_template: "{{ command == 'click' }}"
  - choose:
    - conditions: "{{ click_type == 'single' }}"
      sequence: !input remote_button_short_press
    - conditions: "{{ click_type == 'double' }}"
      sequence: !input remote_button_double_press
    - conditions: "{{ click_type == 'triple' }}"
      sequence: !input remote_button_triple_press
    - conditions: "{{ click_type == 'quadruple' }}"
      sequence: !input remote_button_quadruple_press
    - conditions: "{{ click_type == 'furious' }}"
      sequence: !input remote_button_multiple_press
1 Like

@123, thanks a lot for your contribution! That’s a nice improvement, makes it more readable :slight_smile:
Also, @jodur, thanks for taking your time into implementing the hold action!

I have changed my Blueprint to include these 2 improvements, thanks again.

1 Like

I am also having the same issue. the blueprint cannot see the device i have.

removing the device and adding it again solved the problem.

Good to hear that.
Probably the integration has changed since you added the device for the first time, and now recognizes it correctly.

i recently passed from deconz to zha, and i can0t add my xiaomi switch. i paired it, the hub recognised it, but the it goeas in to a loop and i can’t add it as a device. any suggestion? i also try to single press “like a mad the button”, i also try to add it trought an another router (aka an ikea repeater). But nothing seems to work. the system sees it but doesn’t add it.

Hello!
When you say you paired it, you mean adding it via the ZHA integration?
Also, what do you mean by “the system sees it but doesn’t add it”?

Some printscreens might help here :slight_smile:

That is the state. it’s never changed.
Thanks

@nebbiadigiorno, take a look at this post please:

Thanks a lot! it did the trick!!

1 Like

This blueprint is great!. However i’m having an issue that wont allow 2 actions happen when a single click or double click event is pressed.

Example: i’ve added 2 actions to turn on 2 separate lights when a single press is activated.
Only the first action executes however and the second does not.

I’ve tried this also on the double click event but doesn’t work either. It does however work on the hold event?.When the button is held both lights turn on as expected.

Is the issue on my side or can someone else confirm multiple actions work on a single or double click event.

Thanks in advance.

Hello @Araforn!
First of all, thanks!

Second, thanks again, because you just noticed an issue with the blueprint hehe
In fact i tried adding 2 actions to the single/double click events, and the second action never executed.

That was due to the “Automation Mode” (Automation modes - Home Assistant), which was set to “restart”, and since the single/double click events actually trigger 2 “zha_event” events, the automation was restarted and never executed the subsequent actions.

I have changed it to “queued” here, and it is working fine, triggering multiple actions. I will fix that in a few minutes and updated the BP code; after that, i think if you reload your Automations, the BP will be fixed!

Thanks a lot again!

Hello,
I’ve updated the BP code, as mentioned before, but i actually changed the Automation Mode to parallel, instead of queued, to improve speed on possible multiple fast actions.
It might be interesting to have a drop-down in the BP to choose the Automation Mode. If anyone would like to have this feature, just let me know.