Tried lots of things but still struggling with the Hue dimmer (v1) native via Sonoff Zigbee dongle. Any help?

Apologies for the length of this post. I really don’t want people to think I’ve popped up on the forum asking a silly question, without properly trying to resolve this myself. I do now feel I’ve given all possible effort, and it has come to nothing. So here I am!

Last time I tried HA it was about ~4 years ago. I’m trying it again now. “Wow” is all I can say. What an awesome lot of improvements there have been over the last few years. Absolutely incredible, and thanks to everyone who put in the work. As a part consequence of all this work, this time around, I was able to deploy a HAOS appliance image onto a proxmox box, and get it up and running.

Having done that, early successes included immediate appearance+support of my Elgato keylights, and, with a bit of fiddling to get the Sonoff Zigbee dongle ‘passed through’ proxmox (and a hardware reboot) support for that activated in HA. Great!

Then I de-paired a Hue bulb from my old hue bridge (which I want to get rid of). And then I paired it with the HA/Zigbee setup. And it just worked, right away. I can’t stress enough how amazed I was by this. It. Just. Worked!

I did the same for a second Hue bulb. Again, it just worked. Fantastic!

… Now this could be where I got overconfident…

I then tried one of the Hue dimmer switches (I believe this is a V1 unit, 324131137411). I de-paired it from the Hue bridge, held a pin in the hole on the back for the required number of seconds (15?) and then Zigbee (zha) spotted it and seemed to set it up. It shows up in HA as an RWL021. Even better, once it had completed doing its thing, and I went into the device’s page, in the Logbook, tapping on the on and off buttons and the dimming buttons actually showed sensible looking events appearing in HA. So I assumed all was fine, and now I could setup some automations.

This is where matters seemed to go from bad to worse, and everything I tried just failed obliquely and in a way that just seemed to defy resolution.

Firstly, I created an automation basically Trigger of “Turn on” pressed, and an action of “Turn on Ceiling Light”. This did not work. Running the automation manually from the web UI DID switch on the light. But pushing the button didn’t. Returning to the switch’s device page, and tapping on the relevant buttons still did produce event logs in the logbook. I can’t quite explain this! The inputs are being seen by HA. But they just aren’t … doing anything.

Two friends who are much more au fait with HA (and have large systems) have tried to help me on this too, and also been unable to shed light.

Googling around, and also searching through this forum, I discovered that apparently I should maybe be using a “Blueprint”. I actually tested two. One was the stefanroelofs one, and the other was the “Awesome HA Blueprints” one. Both of these looked really promising, because it seemed like people were seeing the same issue as I was, but I tested both, and neither worked in my situation, for some reason.

I did some more searching on the forum here. Some people were seeming to say that the dimmer could get itself confused, and into a partially working state, if during the pairing process, something had gone wrong. A way to resolve this was reportedly to tap a button a couple of times during the zigbee pairing process. I attempted this multiple times with the “reconfigure” option, in the device, and also fully deleting and recreating it. To be honest, I cannot really comprehend why this would have made a difference; as far as I could see the important aspect of the always worked for me; i tapped a button on the switch, it logged an event in HA. Surely that must mean it was “working”?

Anyway, reconfiguring, and even fully deleting and re-pairing, did not work.

And kinda… that’s where I’m stuck.

Clearly I am not alone with this problem, others also seem stranded and drifting without a solution; example : ZHA - Philips Hue Dimmer Switch (RWL020 & RWL021) - All buttons fully configurable - #5 by Oseriduun

I very much do not want to turn these switches into e-waste by chucking them all away and replacing them; it seems absolutely crazy to do that – especially as it feels like they so nearly work; pressing a button generates a log in HA. They (basically) do work. They just don’t work work!

Again, sorry for the length of this post but I seem to see a lot of people posting very short “help me” type posts for this specific item of hardware and being told the same thing over and over, which doesn’t work (at least for me). I feel I’ve exhausted all the options I can think of now. I think there is a trick I am missing; for example some people mentioned something about “enabling legacy mode” – could it be that? I couldn’t find anywhere to switch that on though.

So… yeah, hoping someone who has one of these things can help!

  • I have tried to post screenshots of the messages appearing in the Logbook for the switch, and also a screenshot of my Automation, but at the moment it’s not letting me post images as part of posts.

I don’t know if I can help, but I did something similar to you: I migrated from a Hue Bridge to a SkyConnect dongle on HA, using ZHA. I have two dimmer switches and they are working, so I assume it’s possible. This is an example of one of my automations, in YAML mode:

alias: Bedroom dimmer pressed
description: ""
trigger:
  - device_id: 876d0f83465045ca73dcf6a304db7da5
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: turn_on
condition: []
action:
  - service: script.turn_on
    data: {}
    target:
      entity_id: script.hue_dimmer_pressed
  - service: light.toggle
    data: {}
    target:
      entity_id: light.bedroom
mode: single

My dimmer button is probably different than yours – it has one power button at the top, and a hue button below. It’s a RWL022, according to ZHA.

I should have made clearer that the “script.turn_on” thing is because I use Node Red. Node Red is listening to that and running some other code (setting a flag, but that’s a different topic).

1 Like

Thanks very much. I’ll give that a whirl.

I vaguely think I read that the one that identifies itself as an RLW022 is the newer version, though…

Visually, mine (the 021, I think) has a straight bar (or a 1) on the top button, then a larger sun symbol, then a smaller sun symbol, then an unfilled circle (or a zero) on the buttons. Out of interest, are the symbols on yours slightly different to that?

Yeah, mine’s a slightly newer model. It has that power symbol at the top (circle with a line at the top) and a “Hue” button at the bottom – that’s the reason I’m calling the toggle service there. The trigger part of this might be what you need, though. I just went to the device in ZHA and clicked on the “+” icon next to Automations to get started.

TLDR: Try going to the device in ZHA and creating an automation from there? Apologies if you already tried this. I didn’t read your original post carefully enough.

1 Like

Strangely I actually think I have one of those somewhere…

Perhaps I’ll see if I can dig it out and try that, first.

If that one does work right out of the box, but still I cannot make the V1 ones work, that is at least a sort of clue, I think.

OK I have now dug out the one I thought might be an RWL022. Indeed it was.

So this is the same as yours, I think; power icon on the top, hue logo on the bottom, big and little sun in the middle. Slightly rounder corners.

I detected it in the zha bit, which worked fine. I then created two bog-standard automations, without any use of a Blueprint at all. And now I have it working perfectly with no issues at all!

So I think RWL022 is fine and RWL021 is still screwy, and still not really sure why!

This is, at least, a datapoint.

A lot of folklore seems to have grown up around zigbee because it’s such a black box. In this case there is a grain of reason behind the advice: many battery devices sleep to conserve power and have to be woken up before you can bind them. In my experience a single tap before binding does the trick. For pairing you shouldn’t need to as you’ve just pressed the reset button.

Having said that, there are a lot off issues around the RWL021. Have you checked for device handlers on GitHub?

1 Like

Hi Stiltjack.

Thanks for your reply. What is puzzling is that the newer version of the switch really does work perfectly, and did, right out of the box!

Re: looking for “device handlers” on GitHub… I had a look at that url, but honestly i’m not quite sure what I am looking at. Would I somehow “import” device handlers into the device from one of those posts into HA?

I get this strange feeling that although HA is seeing events from my 021 version (V1/ older) switches, maybe those events are somehow not being understood by HA… A parallel would be like… are they in the wrong language? Or something silly, like, HA is expecting a capitalised “On” but the sensor is reporting a lower case “on”. Or something mad like that?

Are the device handlers to ‘correct’ that?

Or am I miles away?

I am extremely new to this. Like… 1-2 days in!

For goodness sake, I can’t even use the forum properly tonight … :clown_face:

1 Like

Exactly right. The problem is that many manufacturers do not stick to the zigbee specification. The ZHA integration tries to, but the developers have to introduce custom handlers (“quirks”) for quite a lot of devices to make them work as intended. If you look at the device info for your RWL022, you’ll see that ZHA has one pre-installed.

For older and less common devices the handler has to be downloaded, and for very new devices you sometimes have to ask the developers to write one.

I don’t know if it will work, but you might try this one:

  • Create a folder in your HA config directory
  • Download the quirk (there’s a download button on the GitHub page, on the right, just above the code)
  • Copy it to the new folder
  • In configuration.yaml, tell ZHA where to find it
zha:
  custom_quirks_path: /config/your_new_folder/

Then restart and have another go at pairing.

1 Like

Can you paste an example of one of your automations?
I have several RWL021 and they are all working just fine.

Best regards

1 Like

OK. Thanks to the people who answered. The plot thickens. And I think I did one silly thing. I only tested with one RWL021. I think this is my bad. Tonight, flushed with success at the RWL022 working straight out of the box, I decided to start from scratch with another RWL021. Before doing anything (i.e. device handlers for quirks etc). I decided to try and pair it, mainly so I could record the specifics of the failure, and post them here.

Would you believe, this time, I successfully paired a RWL021, and it worked first time? No, nor could I. But, in every way, it worked perfectly. First time.

One thing I did notice, though, looking at the Logbook for the device when a button was pressed was it seemed more … verbose. There seemed to be “more of an entry” when a button was pushed… Example :

Philips RWL021 Remote Button Short Press - Turn On event was fired
22:41:09 - 4 minutes ago
Philips RWL021 Remote Button Short Release - Turn On event was fired
22:41:09 - 4 minutes ago

Something about this didn’t seem quite the same as with the one that had failed previously. I was sure it was shorter. So I paired ANOTHER RWL021. And this time, it failed in exactly the same way as the first!

Looking at the Logbook for the (new) failing one, my memory was correct; it was shorter :

Philips RWL021 On event was fired
22:40:30 - 6 minutes ago
Philips RWL021 On event was fired
22:39:34 - 7 minutes ago
Philips RWL021 On event was fired
22:39:08 - 8 minutes ago

So … something was not right here.

I deleted and attempted to re-pair the switch. Still the same. I chose to reconfigure the switch. This time I tapped a button whilst it reconfigured. This time, some tick marks that were orange, changed to green. All of them were green, once it had finished reconfiguring.

After that, the switch worked like the fully working one.

So … lessons?

I guess :

  1. always try a second item of the thing that is not working, if possible.
  2. I think maybe the RWL021 can get itself into a confused state, where it isn’t properly set up, but appears SEMI correctly set up, giving an illusion that it should work, but then it fails.
  3. A properly working RWL021 should not need a Blueprint or a Device Handler. Maybe device handlers do help with some of the more interesting things the switch can log (like, i’m thinking, maybe things like triple presses?) IDK.

But, yeah, anyway, sorry to bother everyone on this. I should add for completeness, I did also change one other variable in this equation : I updated HA to the 2023.11 version just before doing this experimentation BUT I did read through the release notes and I do not think this has played any part.

I do also wonder if something is different between the 021 and 022 variants of the dimmer, OR if theoretically the same weird “confused config” situation could in principle happen with the 022; but I was just lucky when I configured mine last night?

Anyway in summary, the solution seems to be to check the Logbook, and make sure each on press is creating a double entry; a “press” and a “release”. If it is, it’s probably all good. If it doesn’t, either Reconfigure it with maybe a button tap whilst it’s working OR delete and attempt to re-pair it again.

Thanks to the people who put in time replying to my rather unlettered and over-wordy rundown of what I had tried. I guess I hope that someone having the same issues as me finds this thread and fixes theirs as a result of the information contained herein! Please do comment and say if it did haha.

Next on my hit-list are getting some Atom Echos to work, wakewords and a Bluetooth dongle!

Cheers-
Alex.

2 Likes

I have had similar battles, but using Z2M rather than ZHA. I eventually got them to work by installing fresh batteries and making sure that legacy mode was turned off in Z2M. (I read that it needed to be on, but when I turned it back off after fresh batteries the switches started working!) I gave up on the blueprints as wasn’t sure if they were the problem or if it was the controllers. I have 2 older switches the same as yours and a newer model.

1 Like

Thank you for this!
I’m (finally) migrating from Hue Bridge to ZHA/SMLight and everything was going well until my RWL021’s.
Pairing attempt #1 - failed
Pairing attempt #2 - paired as useless unidentified device, with limited functionality (no double press etc.)
Pairing attempt #3 - used the ‘tap a button while pairing’ technique. Then, :100: perfect, identified as RWL021 with all expected functionality.