[OBSOLETE] Enhanced Zigbee Hue Bulb - Direct Connect to ST

To use this device handler, you’d have to connect them directly to ST.

But you can trigger the Blink and Breathe style blinking through the Hue Connect integration by adding the alert key to the setColor map. Not sure if Rule Machine advanced features can send a map as a parameter.

Here’s some code I had in a SmartApp I was writing. If you send “select” in the alert value it will blink once. Send “lselect” to do the breathe that blinks over 15 seconds.

hueHubs.each { bulb ->
def hue = bulb.currentValue(“hue”)
def sat = bulb.currentValue(“saturation”)
def alert = state.hueHubOption
def value = [hue: hue, saturation: sat, alert: alert]
bulb.setColor(value)

Up until a few days ago, everything was working fine for me using the Hue (Connect) SmartApp to control my 18 Hue lights (mix of BR30, A19 a couple of lightstrips and 1 lightstrip plus). However, now, I have no control over my lights (and now they’re always on…because I had already rewired all my Z-Wave switches…so the only way to turn them off is at the circuit breaker).

The Hue hub shows a red exclamation in a circle with the message (Light may not be reachable).

Can I dump the hub and switch over to direct to ST using your custom Device Type?

Hue technical support has been no help in terms of the connectivity issue…and its strange to have just suddenly occurred (with no recent changes at my end…things working well for 2-3 weeks).

I suppose if the problem isn’t with the Hue hub, then I might have connectivity issues with anything, but I’m keen to try as I have few options left.

Hi Chris,
You will need the Lutron Connected Remote to reset the Hue bulbs but after that you can use the zigbee Hue Bulb device handler. You lose the ability to use groups and scenes (groups are convenient for me especially when all of the lights in the group power on/off together). Groups also cut down on the device ‘clutter’ and without them I’d be way over the 100 device limit. You are also at the mercy of ST when it comes to accessing your bulbs. Personally I like having the Hue app as a backup. Of course it sounds like your Hue hub died so it may not be of use anyway!

Thanks, I’ll put it on my list.

I tried a “hail Mary” today, and replaced the old Hue hub with the newer version hub. The transition was smooth, and so far, the new Hue hub hasn’t lost/complained about connectivity with the lights.

However, if this happens again, I’ll likely try tying in directly with ST. Though ST has had it’s issues of late as well…

Do I need to be a coder to understand and make this work? I just bought a Phillips hue and color buld out of curiosity and I only have a ST hub !

@Sticks18 Does your device handler work with this bulb http://www.homedepot.com/p/Philips-60W-Equivalent-Soft-White-A19-Hue-Connected-Home-LED-Light-Bulb-455295/206633282 ?
I added the bulb in and switch to your device handler. I can’t turn it on or off. I got same error as someone posted above

groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.math.BigInteger#.
Cannot resolve which method to invoke for [null, class java.lang.Integer] due to overlapping prototypes between:
[class [I, int]
[class [B, int]
[class java.lang.String, int] @ line 503

Looks like you’re having the same endpoint issue as many folks have. Check out this post for more info on how to fix. (PS: This device handler is really for color bulbs. It would have a lot of wasted UI elements for just a white bulb.)

Hi I got two individual Hue Gen2 bulbs and I’m having issues pairing with one of them directly to my SmartThings v2 hub (Zigbee Channel 14).

I installed the handler and one of the bulbs was found and connected just fine (connected under a minute) but the other one just won’t be found. These were new bulbs sealed in box so I don’t think they were paired with anything else. However live in a townhouse and a neighbor might have a Hue Bridge setup so could it have been “stolen”.

Do I need to get the Lutron Connected Remote to reset it or is there another way of adding the bulb to the network?

i get this error. any ideas :

Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script14824435689521905299603.groovy: 718: unexpected token: GitHub @ line 718, column 9. Contact GitHub API Training Shop Blog About ^ 1 error

Thank you for the device handler @Sticks18
My Hue A19 White bulbs are working great!

Note to other folks: If your Hue white bulb doesn’t work right away, try changing the color to some color like white…

Hi guys,

        I have some A19 white bulds in my setup, connected to the ST. I find this scenario unstable.  I have some custom pistons where more than one bulb must turn on given a configured logic. I may have two bulbs, side by side. One turned on and the other not. If I try it again later,  it works (both bulds turned on). Therefore the reliability is not that good. Did it happen to you as well?
         Indeed I'm thinking about purchasing the Hue hub to try the official integration. I believe this scenario may be much more reliable.

@Sticks18 Thanks for your excellent work! It works beautifully with my Hue White & Color A19 bulb, except one flaw:

I made a piston in webCoRE so that when some trigger happens, the bulb will turn on, set loop duration for 15 seconds and do color loops for 5 minutes. In webCoRE the interface allows me to define the loop duration (=loopTime in your code) which is very nice. The problem is, after I defined 15 seconds there, I ended up getting a 15000 seconds duration for the actual color loop (After I save the piston and run it, I can see the 15000 shows up as loop duration in the bulb’s config page in SmartThings App on my phone, and the bulb behaves like that too). The workaround I found is simply define 15 milliseconds in webCoRE, since looks like it is a 1000 times difference for whatever reason. This workaround works well for me.

Have you or anyone here experienced the same? What could be the root cause? Would it be a bug in webCoRE or this device handler itself?

Thank you.

@Sticks18 Just took another look at your code, looks like you took params.time and assumed its unit is in seconds. Maybe you could confirm, but it seems to be in milliseconds, at least in this case.

The ZLL documentation says it’s in seconds. I think webCore may translate your 15 seconds to 15000 since ST typically uses milliseconds for things like delays. If you were passing 15 to the command then loopTime should be 15, not 15000; so it really seems like 15000 is being sent by webCore.

Thanks @Sticks18 I was able to fix this issue by doing a /1000 conversion at Line 313 in your code:

sendEvent(name:"loopTime", value: value / 1000)

Before this, I tried to do the same at Line 334 but seems like it won’t make any difference. Any idea? Thanks!

That’s odd. I thought you were calling startLoop() not loopTime()…

Have you tried using live logging to debug what’s happening?