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

It must be the refresh tile. It has no text. Just a gray circle. I have noticed I can’t get it to respond in smart apps like rule machine. I understand this is just a test device but should it work?

Thanks

Absolutely it should work. Refresh is a pretty basic ST tile. It polls the bulb for its status.

Are you US or UK? Android or iOS? Thanks for reporting!

Hi

US… Android…5.0.2. Same on two different devices. Everything else seems to be the same except the colors are wrong. And the refresh button works, I was asking more about smart apps. For example, in rule machine I can set some basic colors but it doesn’t seem to respond .

Thanks

It should work with Rule Machine color setting. I’ll try to test it soon myself. If you get a chance to capture live logs when Rule Machine tries to set the color, I’d appreciate seeing if an error is thrown.

Thanks again!

I hope this is what you wanted… Let me know what else I can do to help.

Thanks

b2a2ef8f-cc6b-4c55-894e-2c2f5613cf14 6:16:14 PM: info Livingroom Lighting With Motion (Music) is False
b2a2ef8f-cc6b-4c55-894e-2c2f5613cf14 6:16:13 PM: info Livingroom Lighting With Motion (Music): Motion Sensor Couch motion inactive
9cbf5099-7a51-4b55-b692-43c2252ccfb0 6:16:14 PM: error groovy.lang.MissingMethodException: No signature of method: script1451179694329552837350.zigbeeSetLevel() is applicable for argument types: (java.lang.String) values: [ff] @ line 464
9cbf5099-7a51-4b55-b692-43c2252ccfb0 6:16:14 PM: debug color name is : Han Purple
9cbf5099-7a51-4b55-b692-43c2252ccfb0 6:16:14 PM: debug hue value is 252
9cbf5099-7a51-4b55-b692-43c2252ccfb0 6:16:14 PM: trace setColor([hue:70, saturation:100, level:100])
b7b97dd8-6f28-447a-97b5-d6b1f5d21684 6:16:13 PM: error java.lang.StringIndexOutOfBoundsException: String index out of range: 184 @ line 273
1600ca54-ff05-4699-a8a5-e01c6d90ebde 6:16:13 PM: info Livingroom Light With Motion (Cable): Motion Sensor Couch motion inactive
b7b97dd8-6f28-447a-97b5-d6b1f5d21684 6:16:06 PM: error java.lang.StringIndexOutOfBoundsException: String index out of range: 184 @ line 273
b7b97dd8-6f28-447a-97b5-d6b1f5d21684 6:16:05 PM: error java.lang.StringIndexOutOfBoundsException: String index out of range: 184 @ line 273
b2a2ef8f-cc6b-4c55-894e-2c2f5613cf14 6:16:00 PM: info Livingroom Lighting With Motion (Music) is True
b2a2ef8f-cc6b-4c55-894e-2c2f5613cf14 6:15:59 PM: info Livingroom Lighting With Motion (Music): Motion Sensor Couch motion active
9cbf5099-7a51-4b55-b692-43c2252ccfb0 6:16:00 PM: error groovy.lang.MissingMethodException: No signature of method: script1451179851329552837350.zigbeeSetLevel() is applicable for argument types: (java.lang.String) values: [ff] @ line 464
9cbf5099-7a51-4b55-b692-43c2252ccfb0 6:16:00 PM: debug color name is : Red
9cbf5099-7a51-4b55-b692-43c2252ccfb0 6:16:00 PM: debug hue value is 360
9cbf5099-7a51-4b55-b692-43c2252ccfb0 6:16:00 PM: trace setColor([hue:100, saturation:100, level:100])
b7b97dd8-6f28-447a-97b5-d6b1f5d21684 6:16:00 PM: error java.lang.StringIndexOutOfBoundsException: String index out of range: 184 @ line 273
28f96c1c-35f8-44fd-8750-5e4b275f1f37 6:15:59 PM: trace triggeredRecently(7cccfc65-cd18-4ac2-8170-a08bafe847d5): false, lastTrigger: 1451343426860
28f96c1c-35f8-44fd-8750-5e4b275f1f37 6:15:59 PM: trace intrusionHandler(motion: active) - away

1 Like

Thanks Paul! This was a bug in the setColor() command when a level value is passed. Fixed and updated at the link in first post. Please let me know that it is indeed fixed for you as well.

Yep… seems to be working better. Thanks! And I think the refresh icon issue is with my tablet because it shows fine on my phone. Both Samsung (go figure?) Any way to add the cycle on/off function to smart apps? It would be cool to start that when music is playing.

Thanks

Expert features portion of Rule Machine should be able to call any of these custom commands thanks to @Mike_Maxwell.

I’ll be putting together a SmartApp in the next couple weeks specifically for these extra features as well.

Looks like I need to update. Looking forward to your app. Thanks

I keep getting this error in the logs when I press the refresh or any other buttons.

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

That looks like the method to get the Endpoint is throwing an error. There really is no reason you should be getting that, so it might be an ST issue.

Try making sure you use the Raw button in Github to copy the code over to make sure you didn’t get extra characters somewhere.

What bulb are you using it with?

Thanks v much for your work on this! Am using this device type with rule machine and the transition time parameter you’ve added for gentle wake up. Perfect.
Can’t work out how to amend the Smartthings Hue smart app to call the transition time parameter though. (I’m new to Smartthings). Just that one extra parameter would make that app really useful and although I can get the app to collect the value, I can’t seem to get it to pass it through. Frustrating!

1 Like

Do you mean Hue Connect for controlling bulbs connected via a Hue Bridge?

No I don’t have a hub, the hues are connected directly to ST using the enhanced device type.
The SmartApp I attempted to change is called Hue Mood Lighting - it is one of the options when you create a new SmartApp from a template.
It has the usual section to select triggers and mode filters and, in terms of hue functionality, allows you to choose colour and brightness. I was trying to add transition time as an additional parameter to complete the feature set.
Benefit of Hue Mood Lighting app over rule machine is that it has a ‘play’ button. I have different scenes that can be called either by just hitting play or through triggers or timers. But the gentle wake up ones need transition time… Was enjoying the challenge of trying the change the code - just wish it had ended in success!!

You picked a tough one to change because the level change gets lumped in with the color change. This devicetype takes a lot of action in the setColor() command that might be difficult to manage correctly. What’s your typical use case? Is the bulb off and you want it to slowly turn on, but in a specific color? Is it on and you want it to dim off slowly in a specific color?

I think if this is for a wake up scenario and the bulb is currently off, you could try this (lines 259-262):

def newValue = [hue: hueColor, saturation: saturation, level: null, switch: off]
	log.debug "new value = $newValue"

	hues*.setColor(newValue, 0)

Than after the setColor() command, you would probably want a small delay to make sure it fires first, followed by (I don’t know the best way to implement a short delay):

hues*.setLevel(lightLevel, transitionVariable)

I believe this would change the color of the bulb but keep it off, then you would use a normal setLevel() command with the slow transition to dim it on.

If this doesn’t work or isn’t as flexible as you’d like, then we could pretty easily add a new custom command to the devicetype that doesn’t do things like turn the bulb on/off, so you would call something like setColorLevel(color[], colorTransition, levelTransition) that will just move the color and then the level.

Hey @Sticks18 can you please take a look at the last three posts of this thread?

I have reset two hue lux bulbs and tried connecting to ST hub, but no luck. The old hue (RGB) bulb are working though. Do you have any ideas?

Thanks a lot in advance!

I’m getting this error too.

It is the white bulb from http://www.kudled.com/en/pl.jsp. Color bulb is fine.

Thanks for the advice, much appreciated. You got it absolutely right - basically a slow turn on in a particular colour maxing out at a particular level.

In rule machine using 4 custom commands (in 1 rule) I’ve got the hue to do a nice wake up by:-

  1. sethue(1)
  2. setlevel(0)
  3. setcolourtemperature(2000,6000)
  4. setlevel(2000,6000)

So I’m trying to see If I can get the hue app to use the transition times in the same way as rule machine.
Anyway thanks again for your advice. First week messing around with ST code so lots to pick up!

Interesting combination! Looks like you make the bulb Red, then have it dim to a very warm sunrise-ish white. I’m guessing the setLevel(2000,6000) is a typo. Level only goes to 100, haha.

Since you’re doing custom commands anyway, you might want to add a 0 or instant transition for the first two commands. That way you definitely shouldn’t see the bulb accidentally pop on briefly. So:

  1. setHue(1,0)
  2. setLevel(0,0)

Then again if it’s working the way it is, who am I to mess with it! Good luck working on the Hue app! Let me know if I can help further.

Oh yeah. Meant 100!
Think Philips are still working on the one that hits level 2000…