[OBSOLETE] Hue Dimmer Switch (ZHA) (beta) (no hue bridge)

This is a device type handler for the Hue Dimmer Switch using its ZHA based endpoint

List item

Update Jan 18 2017

  • Remove unneeded configure button (was for testing)
  • Added numberOfButtons event to make this device work correctly in CoRE (I think this will only work for newly added devices)

Update Nov 13 2016 - Fixed pairing with SmartThings, will no longer pair as Thing/Unknown (I am an idiot and had the fingerprint backwards) ST Now shows the correct ZHA fingerprint for the device.

The Good

  • Supports Press and Held States on all 4 buttons.
  • Actually reports 4 states, PRESS, HOLDING, RELEASE, RELEASE AFTER HELD, only the last 2 are mapped to events at the moment. (I dont think the other 2 have smartthings analogues)
  • The device even reports how long the button was held though there doesn’t seem to be a good way to expose this in smart things.
  • Uses Zigbee Home Automation Clusters instead of Light Link (no pretending to be a bulb)
  • Reads Battery Status (un-calibrated)

The Bad

  • So far unknown if it solves the dropping off the network issue
  • Code is really really greasy (I am working on it heavily still, I have just struggled with these switches for so long I wanted to end the suffering… hopefully)

Credit to @Sticks18 for getting us started with his ZLL base Device Type

6 Likes

Seems that this method suffers from the same dropout issue as using the ZLL profile. Possibly even worse.

will have to try this one. The latest hub update fixed my dropouts so far. Been up for over 3 days as it before fell out after about one hour.

Hello,

I set up a hue Dimmer with your latest device type this morning.

We will see if it retains connection.

Because of the new bug for picking buttons in smart lighting automations I added this line to my local copy. This should be added to the repository

def configure() {

/// New Code so UI on iphone is aware of how many buttons
sendEvent(name: “numberOfButtons”, value: 4, displayed: false)

Okay, I connected the hue dimmer in the morning, when I came home from work in the evening, clicking on a button shows the red light instead of green and smartthings no longer sees the button presses.

:(. Sad face

So I repaired this morning, and this evening it is still connected

only get one button working in CORE. What should i do? also dont get held to work. but it show up as events all the buttons.

1 Like

I can get it to work however I get errors / warnings

24261499-6dec-45b1-8fea-e4e6c83ec5c3 17:11:08: error Button: 4 Hue Code: 4002 Hold Time: 1
24261499-6dec-45b1-8fea-e4e6c83ec5c3 17:11:08: warn SmartShield(clusterId: 0xfc00, command: 0x00, data: [0x04, 0x00, 0x00, 0x30, 0x02, 0x21, 0x01, 0x00], destinationEndpoint: 0x02, direction: 0x01, isClusterSpecific: true, isManufacturerSpecific: true, manufacturerId: 0x100b, messageType: 0x00, number: null, options: 0x0100, profileId: 0x0104, senderShortId: 0x7e83, sourceEndpoint: 0x02, text: null)
24261499-6dec-45b1-8fea-e4e6c83ec5c3 17:11:08: error Button: 4 Hue Code: 4000 Hold Time: 0
24261499-6dec-45b1-8fea-e4e6c83ec5c3 17:11:08: warn SmartShield(clusterId: 0xfc00, command: 0x00, data: [0x04, 0x00, 0x00, 0x30, 0x00, 0x21, 0x00, 0x00], destinationEndpoint: 0x02, direction: 0x01, isClusterSpecific: true, isManufacturerSpecific: true, manufacturerId: 0x100b, messageType: 0x00, number: null, options: 0x0100, profileId: 0x0104, senderShortId: 0x7e83, sourceEndpoint: 0x02, text: null)

did you figure out how to get more than one button to show up?

Now that I have a replacement hub and am back online, I have had the time to incorporate this change into my git repo. Newly added devices with the latest handler now work properly with CoRE. I also removed the useless configure button.

1 Like

These errors are nothing to worry about just some aggressive debugging that was left in by mistake. I have removed it from the latest release.

I just bought a hue dimmer switch hoping to add it to smarthings. I do not have a Hue bridge. I can’t seem to get the device to show up in ST.

I have added the device handler, but don’t see how to use this without getting the device recognized first. What’s the trick?

./ignore I reset the device and it found it.

I’ve got button 1 and button 4 working for on and off, but haven’t yet found the right action combination to get button 2 and 3 working to dim/raise.

Does this suffer from the dropouts the same as previous device handlers for the dimmer switch?

Watching this thread with great interest. How far off general release do you think it is? I’m trying to avoid installing anything beta or alpha, because of the way my wife looks at me when things go wrong. Lol

3 Likes

I’ve installed this with a spare Hue Dimmer I had, to test control of a Fibaro Dimmer. Is it possible to program (via CoRE) an action based on a double click?

ok, I’d sacrifice Double-Click, as it seems like quite a tricky request.

However, I’d like to figure out how holding a button can translate into dimming up and dimming down.

Essentially, I’m trying to duplicate the OOB functionality, with a non Hue light bulb/dimmer.

So I answered this myself.

I changed

            if ( buttonState == 3 ) {
            result = createEvent(name: "button", value: "held", data: [buttonNumber: button], descriptionText: "$device.displayName button $button was held", isStateChange: true)
                    sendEvent(name: "lastAction", value: button + " held")
			}

for

            if ( buttonState == 1 ) {
             result = createEvent(name: "button", value: "held", data: [buttonNumber: button], descriptionText: "$device.displayName button $button has been held for " + buttonHoldTime + "ms", isStateChange: true)
                    sendEvent(name: "lastAction", value: button + " held")
	         }

and now it’s creating the event while the button is being held, and not when a held button has been released.

I realise that as a button that’s not ideal, but as a dimmer, it is perfect for me. Perhaps a cleaner way would be to allow configuration in the device settings to say that holding button x acts is a dimmer or as a button.

Also, if it were possible to configure actions within the DH, it would certainly speed up the button transactions, instead of having to rely on CoRE.