Aqara remote switch in zha

Evening all,

Firstly from looking around the forum I recognise there have been a number of posts on these switches previously but so far none of the actions which worked for others have worked for me (probably because I’m missing something obvious!) so really hoping someone can shed some light on a way forward.

I have two Aqara (Lumi) wireless remote two-gang switches I’m trying to add to zha (model WRS-R02) which seem to be identified in zha as “lumi.remote.b28ac1”

When I add them to home assistant the interview process concludes and the device is “ready to use” but the only entities I get are a battery (which I’ve only seen work once) and an “identify”. Neither switch rocker is identified as an endpoint and clicking them while listening for zha_event gives nothing.

I tried adding in a custom quirk from Here but the quirk isn’t picked up when adding the switch so assuming I’ve missed a step in adjusting the python to match my hardware maybe?

Any and all assistance or suggestions gratefully received as I’m still fairly new to HA.

Thanks.

Isn’t that quirk for a single-gang switch? There’s another here for the two-gang one (right at the bottom of a very long discussion - that doesn’t look too good… :worried:

Hi Stiltjack,

The quirk I linked to is titled “single rocker” but then towards the bottom of the code also refers to the double rocker WRS-R02 model too. (In fact two variants of that model)

I’m new to using custom quirks- should I be deleting all lines which don’t relate to the device I’m using or does zha parse the file until it finds a device identifier it recognises?

I think this is why I’m confused as there are several versions of quirks going round all subtly different but targeting the same devices.

Thanks.

Hi,
I’m guessing you were expecting a switch to be added? Those devices send triggered events when pressed rather than switch, so if you go into “Logbook” and press them you should see the event firing. You mentioned you didn’t see that? Perhaps looking under the wrong area, if you use Logbook initially and fire the event see if you spot it there as you can then use it for automations, etc.

Hi,
I was expecting something to fire either as an event or as a switch but literally nothing happens - I have another (wired) Aqara switch and that one does fire events exactly as in your screenshot and I have successfully used those in automations. However the wireless switches show nothing in the logbook at all.

It seems that Aqara (Xiaomi?) have I used some none standard protocol for those wireless switches hence me going down the custom quirk route to get their messages interpreted, but it looks like the quirk I’ve used isn’t working maybe as HA sees nothing as far as I can tell from the logbook.

Thanks

My understanding is that ZHA looks for the signature of your device, so you should be able to check whether it’s it’s in the quirk file. I don’t think you’re expected to edit the quirk unless you’re doing some sort of special bespoke version of your own - I just download and copy into HA.

Thanks that’s how I assumed it would work, but just wanted to make sure as trying to work out if I’m doing something wrong somewhere!

As the device isn’t seemingly picking up the quirk in zha I’ll check over the quirk in case I’ve named something incorrectly or pointed zha to the wrong directory to found the quirk.

Just to go back to your earlier comment

Did you mean the quirk linked at the end of the post didn’t look good or something else?

Thanks.

No, just me being a smartarse. Long discussions often mean complicated problems.

Haha ah I see! It certainly seems like Aqara aren’t making it easy to use these particular devices outside of their ecosystem!

Just a follow up on this in case anyone finds this post and is in the same situation- I now have one of the two switches working, but the other one still refuses to do anything!

Annoyingly I wasn’t very scientific on my approach and changed several things at once so difficult to say what exactly fixed it for the one which is working.

Steps taken:

  1. Started debug logging in zha and tried pressing the buttons both before and after trying to repair the switches. Saw several “unknown message” type log entries.

  2. noticed in one of the many posts I’ve looked at on the topic that the “enable_quirks: true” entry wasn’t necessarily needed in the yaml config file so removed that.
    Also removed comment above the lines for custom quirk directory in case the comment was causing the whole section to be ignored as the switches weren’t picking up the custom quirks.

  3. Tried pressing and holding both switches down for 10 seconds to factory reset before re-pairing.

After all that one switch now sends events for switch presses (right and left switch single press only but seems although there seem to be events available for double press, long press etc but can’t get them to trigger) and picks up the custom quirk, but the other one doesn’t.
Not sure if this is a firmware issue and one switch has different firmware than the other or if it’s just a case of keep trying till it works but will need to do some more digging in an attempt to get the second switch paired.

Will update if I find anything else and if I eventually find a proper resolution (then mark thread as fixed)

Further update and will mark this post as solved thereafter.

I now have both switches working at least getting single press events which is fine for what I need in their current use case.

In terms of getting the second one working it involved numerous resets of the switch. One thing which seemed to work was keeping the switch paired to HA then rapid pressing both switches five times and then holding both down on the firth press for about ten seconds (as per the Aqara website) then remove from ZHA, reset the switch with the usual hold for 10 secs till the leds flash and then re add to ZHA.
Through that sort of trial and error I eventually got the switch recognised and picking up the custom quirk mentioned in my earlier post.

Anyway hope that helps someone or at least reassures them that persevering pays off! Thanks to everyone who replied to my previous posts and offered suggestions.

1 Like

Hey there, thanks a lot for that solution! I made the rocker work too on my end!
Anyways, did you come up with a solution to get the other events working? Like long press, double press, etc?

I have this very same issue and am VERY new to HA and ZHA. Can you please advise me how to add quirlks and the exact coding I need to paste? I also have the same double wireless Aqara switch