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

I’ve installed your smartapp, which does what it says on the tin… But it’s not picking up any new scenes or any scenes ive renamed? Any suggestions

Cheers

I should add a note here… I am about to release an update for my hue groups! I now have better control of the groups updating the lights and vise-versa not to mention a TON of code cleanup! I have been working to standardize all of the code to make it more friendly to work with.

:slight_smile:

I am also working on a section of the code to allow you to read from the hue dimmer switch :slight_smile:

I like the idea of the scenes and I will have to dig into the code later!

I would also be down for merging the two into a new GitHub repo. Feel free to message me

2 Likes

ROfu-

When you say that its not picking up any new scenes - do you mean scenes that you created via the Hue hub after installing my SmartApp? Just making sure, as I see such new scenes here.

Tony

Hey infofiend,

It has picked up newly created scenes from the hub (I just hadn’t given it enough time) the Change in names for scenes on the other hand, which i believe just creates another scene - they didn’t show up no matter how long i waited.
I’m going to factory reset my bridge tonight, just to make it all clean again. And see what happens

Cheers for the response.

Sign me up for testing help, if you like - I have a couple of Hue Beyonds which show up in the Hue app as groups :smiley:

1 Like

Hi, thanks for creating such a great Smartapp. I am having a problem getting it installed, however. As I go through the installation process, everything goes smoothly until the end when the app asks me to select Scenes. Regardless of whether I check off any scenes or leave it blank, when I click Done, I get a red error message which states: “Failed to save page: Scene Discovery.”

What’s especially weird is that I went into the Hue API and deleted all of my scenes thinking that might fix the problem. I then started over with the SmartApp’s installation process, but it still finds three scenes for my Hue Beyond (Hue Beyond Down 1, Hue Beyond Up and Hue Beyond 1). The app identifies these as Scenes, but the API shows them as Groups (which I cannot uninstall for some reason). I rechecked the API and confirmed that there are no Scenes in the Bridge. I also uninstalled and reinstalled the SmartApp and all devices, but I still got the same error message.

Any advice?

Rob

Just wanted to say thank you so much for the app and all your hard work!

I do have one small issue that I searched forums and here for, but couldn’t find anyone having this issue. (I’m a 1 week old Smartthings user, so please take it easy on me) ;0)

Everything is working as stated and all my scenes / lights and groups made it but I seem to have an issue with the color wheel for any given light.

When you change color with color wheel, it shuts hue bulb off, then you have to use slider to bring the bulb back on and then the color changes.

I can pull logs or whatever you might need, but I might honestly have to have a little handholding when it even comes to that. Very new to all this but have some code background so hopefully won’t be too painful.

Thank you again for all your work!!!

1 Like

Rob-

Can you go to the IDE log and tell me what specific error occurs when the “Failed to save page: Scene Discovery.” message appears on your device?

Thanks,
Tony

4loveofpunk-

That’s very weird. I am unable to replicate that problem on my device. Logs would be very helpful.

In general, open the IDE logs on a computer while you are using the device. Try to identify the errors (if any) and/or the events that show up when you are using the color wheel. Let me know what you find. Also - are you using iOS or Android?

Thanks,
Tony

Hi Tony. I will get you that information tonight. I will need to uninstall the current Hue Connect app I am using and all devices and reinstall your Smartapp and devices. Anything else I should do to reinstall on a clean slate?

I have the exact same issue as 4loveofpunk.

I use an iPhone (iOS 9.2.1) in case that matters. Also, I am using a first gen Hue bridge and second gen ST.

I don’t know where to find the logs to share though. Here is the list of events and event details of changing the color, if that is what you need.

Date Source Type Name Value User Displayed Text Changed
2016-02-23 12:06:17.275 PM EST moments ago COMMAND off off command was sent to Al’s Room true
2016-02-23 12:06:17.237 PM EST moments ago DEVICE switch off Al’s Room switch is off true
2016-02-23 12:06:10.412 PM EST moments ago COMMAND setLevel setLevel(44) command was sent to Al’s Room true
2016-02-23 12:06:10.379 PM EST moments ago DEVICE level 44 Al’s Room level is 44 true
2016-02-23 12:05:45.688 PM EST moments ago COMMAND setAdjustedColor setAdjustedColor({“red”:255,“level”:100,“hex”:"#ff4901",“blue”:1,“saturation”:99.6078431372549,“hue”:4.724409448818897,“green”… true
2016-02-23 12:05:45.614 PM EST moments ago DEVICE color #ff4901 Al’s Room color is #ff4901 true
2016-02-23 12:05:36.107 PM EST moments ago COMMAND on on command was sent to Al’s Room true

Name Value
archivable true
commandId 519504
date 2016-02-23 12:05:45.688 PM EST (2016-02-23T17:05:45.688Z)
description setAdjustedColor({“red”:255,“level”:100,“hex”:"#ff4901",“blue”:1,“saturation”:99.6078431372549,“hue”:4.724409448818897,“green”:73,“alpha”:1}) command was sent to Al’s Room
deviceId a11811b3-4e36-40ce-ad5f-5d87bd7f1fec
displayed false
eventSource COMMAND
groupId 8b40afd5-56c7-4703-b247-c2dbf62ca8ed
hubId dbf2c784-9ce4-487e-ad45-870d00fe8624
id adbe7580-da4f-11e5-8e2d-22000b4e0638
isStateChange true
isVirtualHub false
linkText setAdjustedColor({“red”:255,“level”:100,“hex”:"#ff4901",“blue”:1,“saturation”:99.6078431372549,“hue”:4.724409448818897,“green”:73,“alpha”:1})
locationId 7d6f5bd9-6d97-4d74-8be5-0bd421d1511b
rawDescription setAdjustedColor
translatable false
unixTime 1456247145688
value setAdjustedColor
viewed false

Rob-

It sounds like you might have identified the problem - you need to install all of the device types used by the smartapp (and remove the original Hue Connect app). Let me know how it goes.

Tony

Hello @infofiend and thank you for quick response. Here’s my info below and same with @jcarrano I am on IOS 9.2.1

LOGS:

10:46:18 PM: trace NON-HUE EVENT devicetype:04, mac:90724005C331, networkAddress:0A000103, deviceAddress:0050, stringCount:04, ssdpPath:/description.xml, ssdpUSN:uuid:2f402f80-da50-11e1-9b23-001788216132::upnp:rootdevice, ssdpTerm:, ssdpNTS:ssdp:alive 2a4e1127-e2c2-4401-aa20-f1f467665a7b 10:46:18 PM: info LOCATION HANDLER: devicetype:04, mac:90724005C331, networkAddress:0A000103, deviceAddress:0050, stringCount:04, ssdpPath:/description.xml, ssdpUSN:uuid:2f402f80-da50-11e1-9b23-001788216132::upnp:rootdevice, ssdpTerm:, ssdpNTS:ssdp:alive d773df05-8e2a-4d9c-b847-88a6fb19d9b4 10:45:49 PM: error groovy.json.JsonException: Expected a value on line: 1, column: 2. But got an unterminated array. @ line 773 ce634b41-660b-4129-afd4-e2192364a51a 10:45:48 PM: debug Executing 'setLevel' d773df05-8e2a-4d9c-b847-88a6fb19d9b4 10:45:45 PM: error groovy.json.JsonException: Expected a value on line: 1, column: 2. But got an unterminated array. @ line 773 d773df05-8e2a-4d9c-b847-88a6fb19d9b4 10:45:45 PM: trace HUE BRIDGE, OTHER ce634b41-660b-4129-afd4-e2192364a51a 10:45:45 PM: debug setColor: [red:255, level:null, hex:#ff793c, blue:60, saturation:76.47058823529412, hue:5.213675213675212, green:121, alpha:1] ce634b41-660b-4129-afd4-e2192364a51a 10:45:45 PM: info percent: 5.213675213675212, adjusted: 5.213675213675212 ce634b41-660b-4129-afd4-e2192364a51a 10:45:45 PM: debug setAdjustedColor: [red:255, level:100, hex:#ff793c, blue:60, saturation:76.47058823529412, hue:5.213675213675212, green:121, alpha:1] 17da3074-a63f-40c1-938a-38e84fd8ed5b 10:45:34 PM: debug getChildDevices(true), children=1

Json Exception popped up twice. Let me know if this helps or have any advice.

J

Okay, I started from scratch last night and deleted/reinstalled the app and the various device types. I am still getting the same error message at the end of the installation process – “Failed to save page: Scene Discovery.”

I checked the logs in IDE and the only error message I see (multiple times) is:

0c51f42f-b5a7-4f66-bdb7-f9ba6c45b4c9 8:02:01 AM: error java.lang.StringIndexOutOfBoundsException: String index out of range: 248 @ line 771

On another failed attempt to install the app, I saw the following error message:

8901d2fc-7b53-4b6b-8374-e4197d648024 7:59:35 AM: error java.lang.ArrayIndexOutOfBoundsException

By the way, I deleted all scenes from the bridge just in case one the scenes was causing a problem.

Any thoughts?

Thanks,
Rob

Is anyone using this with Friends of Hue products (i.e. Lightstrips, Hue Go, etc.)? With the standard SmartThings device type, the colors of the Friends of Hue products don’t match the colors of the regular hue bulbs when set with the same HSB using setColor. Just wondering if this has the same issue before I spend the time removing everything and switching it over. Thanks!

1 Like

It will have the same problem because they will use the same devicetype. It’s not an easy problem to solve because the regular bulbs can’t reproduce the same gamut of colors as the Friends of Hue products; but the first step would be a different devicetype for regular bulbs and other Hue products that use the wider color gamut.

Hue gets around this by mainly using the x,y coordinates for sending color to the bulbs, so they will always match unless the selection is outside the range that the bulbs can produce and in that case the x,y automatically selects the closest match.

The hue/saturation combo that ST uses is much easier to implement across multiple products and particularly when a color wheel selector isn’t available; but it relies on calibration at the devicetype level and there isn’t a reference for that calibration.

2 Likes

@claytonjn I’m just personally using the standard 3 pack hue color bulbs that came in the hub deal, so nothing really extravagant yet. Most of my devices are just zwave at this point so the “branching out” is all brand new :wink:

I’m also having the exact same problem. I get the “Scene Discover” error message. I tried uninstalling the SmartApp and Device Handlers and then reinstalling, but still got the same error. I’m wondering if we have to hard reset the Hue Hub. I don’t really want to do this though because it will delete all of the scenes and I’ll have an angry wife if I do this (it took months to get Hue to an acceptable WAF and I’m finally there).

1 Like

I had the same problems that i saw everyone had in the thread above and fixed them. Here is what you need to do. If you can not get your lights to respond after installing then change code at line 1106 so that it looks like this:

/** def bodyJSON = new groovy.json.JsonBuilder(body).toString()
def length = bodyJSON.getBytes().size().toString()
/
log.debug "PUT: $uri"
log.debug “BODY: ${body}”
/
* log.debug “BODY: ${bodyJSON}”

sendHubCommand(new physicalgraph.device.HubAction("""PUT $uri HTTP/1.1

HOST: ${selectedHue}
Content-Length: ${length}
${bodyJSON}
""", physicalgraph.device.Protocol.LAN, “${selectedHue}”))
*/

sendHubCommand(new physicalgraph.device.HubAction([
method: “PUT”,
path: uri,
headers: [
HOST: selectedHue
],
body: body], “${selectedHue}”))

If you are having problems with the scene discover error it is because line 485 should look like this:

			d = addChildDevice("info_fiend", "AP Hue Group", dni, newHueGroup?.value.hub, ["label":newHueGroup?.value.name, "groupID":newHueGroup?.value.id])

The reason it works for other people is because they installed the zpriddy device handlers in the past so it would be picking up his device handler and not the one we just installed.

1 Like