Philips Hue Tap Dial button - potential music (Sonos) controller?

Samotech has just release an adapter for these to go over UK sockets. Fast turnaround, I emailed them a couple of weeks back to see if they had a product, they said to try the version for the Hue Button which I did. It was a few mm small (not sure why I didn't check that beforehand!). The next week they had this, just got mine.

https://www.samotech.co.uk/products/hue-tap-dial-3d-printed-adapter-for-uk-eu-light-switches/

I wrote a driver that works decently well. The dial is setup to be a dimmer/level value 0-100.
And the firmware I'm currently on, all the buttons work 1-4, but when you hold down a button, no matter what, the same data comes out of the device, so I've set that up as button 5-held for now.

I don't have a hue hub, so I can't update the firmware, but I will try to update it at my partners house this weekend to see if that fixes the held button issue.

Here's the driver
https://raw.githubusercontent.com/Andywebs/hubitat/main/drivers/PhilipsHueTapDialV2.groovy

3 Likes

Thanks @andywebs :smile:

I'll set mine up today and try it out. 2.59.25 looks to be the latest firmware, just need to wait for my new one to update.

Mine took about an hour or so to update. I got a second one and it was fine from the start.

The dial also appears to work with CocoHue if you are interested.

1 Like

Thanks. Not used CocoHue before, will read up on it

1 Like

I've added the dial with the new driver but don't seem to get any response from it, no button presses/dial movements are showing up in HE logs/device page. There is an error in the log though

I don't think this is being run, when I go to the button controller it's showing 10 buttons for the dial.

image

If I comment out those 'runIn' calls then click configure in the device it correctly shows 5 buttons. Still no response from the dial itself though.

image * << the pushed is from clicking 'push' on the device page

1 Like

Yup, it works in CocoHue
5 = dial anti-clockwise
6 = dial clockwise
held seems to work on all 4 buttons

image

Here's how I've set it up with the button controller for a Sonos speaker. Volume control is okay if you move the dial slowly. I guess there needs to be 2 extra commands, eg held = start raising volume, released = stop raising volume.

There's a post here on the smooth volume issue Advanced Button Controller (ABC) - #173 by SmartHomePrimer

2 Likes

Based on that catchall output, it looks like the device is sending out different data with the new firmware.

I’ll have it updated after the weekend and will fix my driver then. But it seems like someone else also has a working driver. Wish I had found that before writing this one.

I’m very hopeful the new firmware really does fix the held button issue. The out of the box firmware sent identical messages regardless of button held.

2 Likes

1 thing to note with the held command is that it does the pushed first, at least on the Coco driver

For what it's worth, I treat all my drivers as a chance to learn something new, with the idea that either someone else will develop something better, or the premise behind my work will be surpassed, taking what I can from my work on the driver. That said, I could imagine that for some, having a potentially leaner interaction with the Hue bridge for a dedicated purpose may be appealing....

Yeah, I would prefer the dedicated driver. Seems overkill installing cocohue just for this.

The updated firmware hasn’t seemed to change anything. Still only receiving data that there was a held button. It looks like the previous issue was with how I am configuring the device. This is my first driver for hubitat, and the first time dealing with zigbee, so YMMV.

The way I had it working before, I didn’t have the fingerprint in there, so when it did it’s initial registration, it seems to have detected as a philips dimmer button controller v2. Then I set the driver to my custom driver. That remains the most consisten method to get this working.

I’ve been working on the configure method, and it now “works”.

1.) Reset tap dial - holding setup button for 10 seconds.
2.) add device -> manual zigbee device.
3.) Detects device. Name it, add it to a room if you like
4.) At this point, it seems to go into a loop of disconnecting/reconnecting.
5.) Go bac to add device->manual zigbee
6.) when it says detecting already added device, when the tap dial blinks green, I then hit stop zigbee pairing.

I’m mostly happy with how the driver is working, and less so with how the configuration works. I’ve looked at a lot of documentation, but it is immense. Happy to get feedback or direction on what’s going wrong. I couldn’t find the code for the built-in dimmer button controller driver v2, which would be great to see how that configure/binding is working so well.

1 Like

With your driver does holding down a button trigger the push first and then the held command? That seems to be the issue with the Coco driver, rendering held pretty useless.

@bertabcd1234 - it feels you are likely best to comment on how the Coco-Hue drivers work with the Tap Dial device.....

1 Like

I tested a few button devices and can't remember what this one did specifically, but the general trend was that they'd send an even on an initial push/tap, then keep sending additional events if the button is held. There is nothing for release. CoCoHue just takes these events and makes "pushed" or "held" out of it, so the above sounds normal. This is in line with what the devices actually report.

It's not the only way this data could be dealt with, but the only other thing I can think of is to add some timer and fake a "released" event if there isn't any additional data for a certain amount of time after a hold. This is risky in general but probably particularly so with a chain of Zigbee (Hue network) to LAN (Hue Bridge) to Hubitat (over a still-in-development API, at that). Separately, there could be something that suppresses "pushed" unless it knows a "held" isn't happening, which would also involve a timer and I think is a bad idea for two reasons, the one I just mentioned and the fact that this would delay "pushed" for users who only care about that event (solvable with a separate "fast" driver, I suppose, but this is all more complex than I'd like it to be).

3 Likes

Yeah I see what you mean, for myself I'm not really bothered about held, a 4 button controller with a dial is perfect for my Sonos!

I was thinking though, I have a 'Sonoff ZigBee Button Controller', just a single button but that handles push/held/double-click.

If I get some spare time I'll look into how it does it and see if I can work it out, I'm a driver virgin though :rofl:

I did look at the cocoa hue driver, but it appears to be a bridge driver, where mine is for direct connect.
In my version, you don't get an initial tap, just the held. But again, the actual message that comes over is identical, regardless of which button is held.

I'm not sure how the cocoa hue is getting an initial tap, since looking at the zigbee traffic shows nothing. But perhaps there is something different with the registration/binding but that would be between the hue bridge and the button. So if someone that has a hue bridge and this dial wants to capture those registration messages, I could look into it.

Or if anyone has more insight on the zigbee registration stuff in general. But, the driver is working enough for me at the moment, and without a direction or better example zigbee drivers, I'll likely not be messing with it anymore. The code is in GitHub, so anyone with an urge to tweak it is welcome, and I'd be interested to see what I'm not doing right.

2 Likes

Yeah I can do that. What do I need to do, I guess it's enable logging on the device then check the logs whilst I click each button?

How is this configured with a Sonos? Particularly using the dial for volume. I tried the mirror app but the device wasn’t in the list.

I am using it with the coco-hue drivers. Volume does work but not very well, you have to move the dial slowly step by step. I don't fully understand the issue as to why Hubitat doesn't play well will rotary dials, maybe it's more to do with the Sonos Integration part not supporting what it needs, eg stop/start raise volume. I have read elsewhere that the dial work well for HA users though

Saying this though, I have had some failures where button clicks haven't responded. I've tried so many options with HE for Sonos but I'm gonna try the new IKEA sound remote gen 2, out March in the UK, with an IKEA hub (reluctantly)