ZHA - Aqara Wireless Mini Switch

Hey, I’m using the Conbee II with the ZHA Integration. Is it possible to add the Mini Switch somehow to HomeKit as a device?

Just wanted to say thanks for the BP, works flawlessly with the 2 buttons I just got!

Thank you!

Perfect. Thank you!

@BigWalnutZ did you manage to get thee WXKG11LM / lumi.remote.b1acn01 working?
I have same issue, only discovering power/diagnostic entity…

Thank you

Yes I did. I believe I had to use the all events temporarily to monitor while pressing the button to find the proper device ID, stop the all events after pressing the button just a few times to limit the output to go through, and then filter for the device ID and the single, double, hold, release are buried there.

When I get to a computer I can get more accurate info.

So:

  1. Use the “events: all” and filter Event Type zha_event with two output properties: a) msg.payload = event data and b) msg.topic = J:expression $outputData("eventData").event_type
  2. Use “switch” node on property msg.payload.event.device_id == “your device id” (looks like: f6e7b23df7dddchangedddbebdatheid)
  3. Use a second “switch” node on property: msg.payload.event.command to identify the “==” four (4) different switch case options: single, double, hold, and release states.
  4. Kick that to whatever you want done with call service or w/e.

3 Likes

This is exactly what I’m doing in Node-red. So easy to trigger events with the event node listening. Thanks for posting @BigWalnutZ Gotta love node-red.
Also, I had an issue with the button presses sometimes sending 2 payloads immediately, so was causing an issue because I wanted to use single press to toggle light on and off. It would turn the light on and then immediately off when the 2 payloads were sent. I didn’t want to waste the double click on the off command so I found that adding a 400 millisecond stop timer fixed the issue.

Nice! I want to do the same, but my dumb sengled wi-fi light bulbs I was testing with didn’t always turn them all on together so the toggle could get them out of sync with each other so I did that out of necessity so I didn’t have some turning off while others turning on. Also they don’t always report status right, so couldn’t just check to see if they were on or not, etc. Grr. Definitely would be better with my other lights that are wall switches instead of individual bulbs.

Can you post how you did your stop timer?

I wanted single to be toggle on/off, double to be cycle between say 2-3 scenes for the lights etc., and the hold to start increasing brightness until they got to top brightness then reverse direction and start dimming and repeating until releasing at the desired brightness. I’ll have to do that with my in-wall dimmer switches so things stay in sync.

Hey @BigWalnutZ . I just got 4 Sengled zigbee lights last night! I’ve only setup one so far in a lamp outside my wifes office. When she is on her phone, I have the light turn blue and as soon as she hangs up the light goes off. Its very responsive. I will setup a couple more in a group and see if I run into the same issues you are having. Perhaps its an issue with the sengled wifi bulbs vs zigbee?
Love the idea of long hold on the aqara switch for increasing brightness. I’m going to play around with that this week. Anyway here is the screenshot of the stop-timer. I didn’t try any less than 400 milliseconds but less than half a second response has been great.

stop-timer

I just wanted to get some clarification – a Aqara hub is NOT required to utilize this button, is that correct?

Thank you so much!

I have Conbee II Zigbee gateway and the button works a-ok with this blueprint. You need some kind of Zigbee gateway for this to work but it doesn’t need to be Aqara.

Just wanted to express my appreciation for this! I was also stuck and now… have transcended :slight_smile:

You are the man! Thank you!!

I am having great issues with the mini switches, I bought one and a Zigbee gateway, it paired fine, then I added the blueprint but it would not work. I deleted the device and re added it and it worked right away. I have now bought a second switch and it too was discovered fine, I have added a second automation for different lights but I can’t get it to work. I tried removing it and re adding it to no avail. I have seen it work once but not again. I added a ZHA event monitor to node red and I can see the first switch activity but nothing from the second. I initially re named the switch with a .02 on the end as I thought both of them having the same name might be a problem but have now reverted to its original name. Any ideas?

Dropping a comment to say THANK YOU!
This is so much easier than using the zha_events listener and setting up device_id’s/commands.

to update my own problem, the switch is working but only if I click it really fast. I am leaning toward it being a hardware issue, something internal that times the button presses and works out if it’s a single, double or held press.

When I use the single press, the automation says “UndefinedError: ‘dict object’ has no attribute ‘event’”

Hi, this is the first blueprint i’ve used with HA and i’ve run into a bit of an issue. I am running HA 8, use the zzh stick from electrolama and have zigbee2mqtt running well. I have purchased the mini switch with model number wxkg11lm. I have imported 2 blueprints but when i go to create an automation the device drop down is empty and it says ‘no devices found’ - do i need to do anything before i can create the automation? thanks!

I know it’s a bit late, but I had the same issue. Solved it by completely removing the switch from ZHA and adding it again after the blueprint was imported. That fixed it for me.

Oh and @SeanM, thanks for this; I don’t think I’d ever gotten the switch to work without it.