[OBSOLETE][UPDATED as of March 24, 2016] Hue Lights & Groups & Scenes (OH MY!)

Hmm, just tested adding a new group through the API Debug Tool and the HLGS SmartApp found it right away as a group. This may be a long shot, but could you try creating a second group through the debug tool? It might have something to do with a case when there is only one group?

Also, for curiosity sake, what firmware version is on your Hue hub?

Ok, just added a second group. Still no luck, hmmm. My Hue Bridge is the newer (squarish) one - firmware is 01031131.

Here’s what the live log is saying as the SmartApp is “discovering” groups, if this helps:

8:45:09 PM EDT: info 2 scenes found
8:45:09 PM EDT: trace 1: [lights:[2, 10, 14], recycle:false, name:Dining Lights, action:[bri:62, effect:none, sat:202, hue:12377, alert:none, on:true, colormode:xy, ct:467, xy:[0.5124, 0.4086]], type:LightGroup]
8:45:09 PM EDT: trace 2: [lights:[1, 6], recycle:false, name:Living Bay, action:[bri:67, effect:none, sat:226, hue:10078, alert:none, on:true, colormode:hs, ct:500, xy:[0.5493, 0.3967]], type:LightGroup]
8:45:09 PM EDT: trace Adding scenes to state…
8:45:08 PM EDT: debug END GROUP DISCOVERY
8:45:08 PM EDT: trace result = 10.0.1.161:80
8:45:08 PM EDT: trace discoverHueGroups REACHED
8:45:08 PM EDT: debug START GROUP DISCOVERY
8:45:08 PM EDT: debug HUE GROUPS:
8:45:08 PM EDT: debug [:]
8:45:05 PM EDT: debug HUE GROUPS:
8:45:05 PM EDT: debug [:]
8:45:01 PM EDT: debug HUE GROUPS:
8:45:01 PM EDT: debug [:]

Could you try again now that parent/child SmartApps are working again?

Also, has anyone else tried adding groups with my updated code? What was the outcome?

1 Like

Just tried again, no change in behavior. Think it’s worth removing all of my bulbs, the SmartApp and the device handlers and trying over again from scratch?

EDIT (30 mins later): Alright! Just removed all my Hue devices, the Handlers, and the SmartApp. Then rebooted my Hue Bridge and ST hub for good measure. Reinstalled from scratch and now it all seems to be in order! It found my bulbs, then it found my groups, and then it found my scenes. Perhaps platforms issues junked up my original set-up yesterday. Thank you again for your help sorting this out!

How do I get my hands on this Hue Debug tool?

Check out @claytonjn’s note above, with a link to @RobtheEngineer’s explanation: Philips Hue Groups Control App. It’s pretty easy to do.

Great thanks.

1 Like

I guess i jinxed myself as the smartapp won’t find any of my new groups. Worse I can’t uninstall it now due to some unexpected error. Platform issues I guess.

Yeah, it’s really frustrating. I had to email support to have the engineers manually remove my old Hue bridge and the original Hue (Connect) app. They did so within 24 hours, which gave me the opening to try this this project instead (since I was starting over from scratch anyway).

It’s working now. Didn’t do anything. It fits a definition of insanity…

Adding new groups is working for you?

They still show up as scenes but when I change the device handler to groups they work fine.

I have switched to your DeviceHandlers / Smartapps now… still a lot to do to make it all work again. One big issue i see right now:
The other devices (non hue) like:
LivingWhite Adapters (Zigbee Dimmers from Philips) only appear as scenes and not as devices. These scenes i cannot turn on either… any idea why that is?

I’m planning on taking a thorough look through the code and the recent changes and try to figure out what’s going on. It’s still possible it’s platform related, but I want to be sure.

If anyone who is having devices show up under the wrong category is interested in testing for me, send me a PM. If there’s nothing glaringly wrong in the code it’s going to be hard to track down because i’m not seeing this behavior.

I have tried to create a group on the api debug tool but its not letting me create a token…

Sigh - all I want to do is turn on the 2 hue bulbs in the master to the same color temp and same light level… you’d think this would be a bit easier

Just wanted to let you know that custom installing the correct device handler to the “thing” worked fine. However, im now seeing 3 big problems for my setup. Maybe you can let me know if these are platform limitations or if it can be done:

  1. If i trigger a scene the corresponding lamps do not update (kind of expected that as the scene is triggered from hue)
  2. Much more important: The lights do not update anymore. Previously i was able to refresh and see any changes i have done outside of smartthings i.e. directly in Hue.
  3. If a light is at 0% it doesnt turn off. Well it turns off (light output = 0%) but the state remains on. If turning off and on again it goes to 1% output but shows 0%…

As for testing…sure shoot over your code. Happy to help.

To be honest, I don’t use scenes at all. @infofiend, is this the expected behavior?

I believe that this is because of the platform issues, but it’s on my radar. I plan on tackling this as soon as SmartThings is stable again (if the problem even still exists). Until then, it’s going to be almost impossible to debug.

This is an easy fix. What is the behavior with the default Hue (connect)? It’s been a while, so I don’t remember. Our code is almost identical for setLevel, so the behavior should be the same.

Anyone who wants to test the issue with groups showing up as scenes:

Add this between lines 226 and 227:
log.warn "/api/${state.username}/groups"

Then open up Live Logging and start the search for groups on your phone. You should see a yellow warning in Live Logging with /api/${state.username}/groups where ${state.username} should be a bunch of random characters. Copy the /api/${state.username}/groups from live logging. Open the Philips Hue API Debug Tool, paste the copied text into URL field, and hit the GET button.

You should get a list of all of your groups in the response field. If not, what do you get?

Marcus-

Presently, that’s the expected behavior. I hope to update this in the future.

Marcus-

I haven’t confirmed this yet, but I think it might have something to do with how the Philips Hue Hub named the “type” of those devices. Its likely that the type is slightly different from the types I have coded for thus far.

This would cause the (OH MY) service manager to improperly classify those devices as scenes, because, in order to pair devices between the Hue Hub and the ST Hub, the (OH MY) Service Manager queries the Hue Hub, and then creates corresponding bulbs / groups / scenes within ST using the following logic:

  1. AP Hue Bulb devices are created for Hue lights with the type of (i) “Extended color light”, “Color light”, or “Dimmable light”;
  2. AP Hue Group devices are created for Hue groups with the type of (i) “Room” or (ii) “Light Group”; and
  3. because the Hue Hub doesn’t list “type” for scenes, AP Hue Scene devices are created for anything that doesn’t fit within (1) or (2) above.

As I don’t have any LivingWhite Adaptors, I am not able to see how the Hue Hub names the “type” of those devices. Thus, if you have the capability, it would be a great help if you could go into the API Debug Tool and let me know what the Hue Hub is using for the type of those devices.

Once I have that information, I can reconfigure the code to accomodate them.

-Tony