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

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

Marcus-

This is intentional behavior. It will not be changed.

-Tony

@infofiend how doe one go about updating groups that were initially found during install?

For example, HLGS showed 4 groups: Living Room, Dining Room, Porch and Dimmer 2. I have since run into a name conflict with the Amazon Echo and I wanted to update my groups.

First, I use the ‘Huemote’ app to create groups. In that App, it only shows 3 groups: Living Room, Dining Room Dimmer 2. I no longer need ‘Living Room’ so I deleted it. I then updated the name of ‘Dining Room’ to ‘Dining Room Fixture’ and updated the name of ‘Dimmer 2’ to ‘Dining Room Light Switch’.

Therefore, my new groups are: Dining Room Fixture and Dining Room Light Switch.

I opened the HLGS smart app and began to go through the discovery process again; however nothing changed. All of the groups that were deleted are still there and the updated names have not changed. Is there a way to update what Groups it see’s without having to delete the entire smart app and re-add? I’m also curious where it’s seeing the ‘Porch’ group from since I don’t have a porch group in Hue.

@Jnick the big problem is that because there is no “official” support for groups in the currently available official Hue app, each app does it slightly differently. Also, like scenes, I suspect that they never actually get deleted from the hub. I would highly suggest using the API Debug Tool to look at what your actual hub shows in terms of groups. That’s what HLGS gets its information from, so what’s shown in a third-party and even in the official Hue app is mostly irrelevant.

@claytonjn @infofiend

According to the Hue Developer Tool, /api//groups, I see:

{
“2”: {
“name”: “Dining Room Fixture”,
“lights”: [
“1”,
“2”,
“4”,
“5”,
“6”
],
“type”: “LightGroup”,
“recycle”: false,
“action”: {
“on”: false,
“bri”: 254,
“hue”: 16674,
“sat”: 70,
“effect”: “none”,
“xy”: [
0.4138,
0.3969
],
“ct”: 296,
“alert”: “none”,
“colormode”: “xy”
}
},
“4”: {
“name”: “Dining Room Switch”,
“lights”: [
“2”,
“6”,
“1”,
“5”,
“4”
],
“type”: “LightGroup”,
“recycle”: false,
“action”: {
“on”: false,
“bri”: 254,
“hue”: 16674,
“sat”: 70,
“effect”: “none”,
“xy”: [
0.4138,
0.3969
],
“ct”: 296,
“alert”: “none”,
“colormode”: “xy”
}
}
}

Therefore, it would appear the developer tool has exactly what I want the groups to see. I’m just not seeing this inside the HLGS SA.

John -

Using the Debug tool, run a GET on the Hue Hub to find the “porch” device. Then copy that info here so I can understand what’s going on.

Thanks,
Tony

Tony -

Has something happened to the tokens on the hue site? I have tried to group my master bedroom Hues but am unable to get it to generate a token. I just get the unauthorized user issue

See here: [OBSOLETE] Hue (Re)Connect - with scene handling - #221 by Lars

To resolve - just update the smartapp to the most recent version on github.

Tony,

Sure thing. I can do this tomorrow. However, not to sound silly but what’s the command? I don’t know how to do a get to search for a specific word. I only know how to look at the config and the groups based on reading the Developer tool docs. Do you know the URL I’m supposed to use to search for you?

Thanks!

Just remove “/groups” from the url – so that its just

/api/[YOUR TOKEN]

And then click “GET” to get a complete listing of all of the devices / sensors / etc. in your Hue hub. From there, it might be easier to copy all of the response into Word / text editor to search for “porch”.

Cool, Thanks! Just did it and there is no reference to ‘Porch’ anywhere other than one light I have, which is named ‘Porch Light

I’m guessing this is completely different than what the App is seeing as St shows Porch Light, the app, under lights, shows Porch Light however, under groups, it shows ‘Porch’.

@infofiend did you see my last PM?

Huh. Well the app must be pulling the information from somewhere off of your hub.

Maybe it’s an old group that got deleted, but the smartthings app still has it in the list? I’ve noticed none of the Hue apps delete any of the discovered items, just add to them.

I went ahead and ran the “Clean Rules and Groups” from the hue app. From there I then reconfigured the dimmer switch. At this point, there is only 1 group for the dimmer switch.

I removed the HLGS app from DT and re-added. From there, it is now working. HLGS sees only one group!

However, I’m worrying now on what’s going to happen when I add/modify/delete groups/lights/scenes as my smart lighting evolves? Is there a way to have the smart app re-poll or update the devices it sees when removed so it’s not cached in ST until the app is deleted?

I’m currently attempting to include functionality of being able to add / delete / modify Hue scenes & groups from the ST app itself.

Unfortunately struggling BIG time with getting stupid POST command authorized. So who knows…