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

Justin -

The device types are able to invoke the “colorloop” function on hue lights - but that loops through all colors rather than two colors of your choosing.

Perhaps a modified version of the “Gentle Wake Up” app (one that looks through color instead of level) would work for you.

Gotcha… thanks. I will try that, it would be neat if someone could create this.

My Hue setup with this SmartApp has almost completely stopped working and I’m thinking the breakdown coincides with a hub update that I recently took. My Philips Hue app stopped working and I was forced to install a new one that has a completely different interface. Is anyone locked into the new update and still having success with this SmartApp?

If you reset your hue hub then you will need to reset the ST smartapp, as it is no longer able to access the hue hub.

The new hue hub update by itself does not require any changes to your ST setup.

Hi! I’m having the same issue as described here, only several months after it has been “fixed” by Samsung. Getting very little in the way of help from Support either. Is there a new fix for this?

What issue?

Sorry - the issue is that I removed the Hue hub, and now the smartapp can’t find it… I’ve emailed support but their answer to restart everything hasn’t solved the problem.

The smartapp is tied to the particular instance of the hue hub in your SmartThings environment. So the smartapp will not work anymore because you have removed the connection between the smartapp and the hue bulbs.

When you created the smartapp, the hue hub provided SmartThings with an oauth password that allowed it to control your hue bulbs. By deleting the hub, the smartapp no longer has the ability to control the bulbs. This is true even if you reinstall the hue hub - because the new hub doesn’t contain the info from the old one.

Unfortunately, You need to uninstall the smartapp (and all bulbs) and start over.

In the “Use” section it says:
4. The Scenes have a “setScene” function that can be used via other SmartApps. The parameter for the setScene() function is “groupID” - which is the number that your Hue Hub assigned to that group. Use 0 for all lights. So, if you wanted to apply a scene you set up called “Movies” and only have it applied to the group you set up with id of 1 (maybe named “Living Room”), then you would call Movies.setScene(1). If you wanted that scene’s settings to apply to all lights in the scene, then you would call Movies.setScene(0).

But i can’t get it to work. neither can i find a funtion in the app or device handler. I’m trying to set a scene from another app (to restore a scene after a moting event) but can’t get it to work. Switching to a scene works manually from the app but not automated from another. I am obviously missing something. Any suggestions?

Code:

def motionStoppedHandler(evt) {
log.debug "motionStoppedHandler called: $evt"
runIn(seconds, checkMotion)
}

def checkMotion() {
log.debug "In checkMotion scheduled method"
def motionState = themotion.currentState(“motion”)
if (motionState.value == “inactive”) {
// get the time elapsed between now and when the motion reported inactive
def elapsed = now() - motionState.date.time

    // elapsed time is in milliseconds, so the threshold must be converted to milliseconds too - correction with a second, obviously latency problems or sth
    def threshold = 1000 * seconds - 1000

    if (elapsed >= threshold) {
        log.debug "Motion has stayed inactive long enough since last check ($elapsed ms):  restoring scene"

// Day.setScene(0)

    } else {
        log.debug "Motion has not stayed inactive long enough since last check ($elapsed ms):  doing nothing"
    }
} else {
    // Motion active; just log it and do nothing
    log.debug "Motion is active, do nothing and wait for inactive"
}

}

as you can see, I commented out "Day.setScene(0) … now I can see the right message in the log. With Day.setScene(0), the correspnding message doesnt show up at all in the log and obviously it crashes gracefully.

I seem to be having problems linking my Hue hub to this SmartApp.

I removed ALL lights and my hue hub from ST and then installed the service manager and 5 device types in the IDE.

Now, the app seems to discover my hue hub but when I try to link it and press the button on my hue bridge it just spins forever and doesn’t actually link up. I tried rebooting my hue hub and nothing is happening.

Any ideas?

Edit: hellllpppp

Update: I deleted all device types and the service manager and I even deauthorized all 3rd party apps from the bridge and it still won’t link. I don’t know what I could possibly be doing wrong.

Is there a way to delete multiple scenes at once? I’m cleaning up my system, and it appears there are ~100 scenes logged in the HUE Bridge when you include all the records / variants of a single scene. Using the Hue Debug API works, but it will take several hours to clean my entire scene list if I need to delete each scene individually.

I don’t know of one. In your case, perhaps it’s better to just do a factory reset and start from scratch?

I read through the entire thread and apologize if I missed this. I really like this SmartApp, it installed flawlessly, found all of my scenes, lights, groups and hub easily. The scenes work from the button. But what I am looking for is a way to schedule a scene. For example… When mode changes to “Evening” turn on lights to “evening” scene. I set this up using Smart Lighting but it did not trigger with the mode change.

I guess the biggest reason I’m looking for something like this is because if I am not home, I don’t want Hue turning on my lights. What I am doing now is triggering the color changes from the Official Hue app one minute after mode changes in the ST app.

So I’m asking if there is a way to trigger scenes?

Thanks, Stacy.

You should have a momentary switch for each scene. You should be able turn on that switch in your routines.

Another thing to try is CoRE. It provides a tremendous amount of flexibility as to when a device is controlled, and has the ability to push momentary switches.

You could set up a CoRE Piston (what a rule is called within CoRE) that pushes a first scene switch IF you are home AND time is between Noon and sunset, a second scene switch IF you are home AND time is between sunset and 11pm, a third scene switch… and so on.

Hi Infofiend!

Thanks for the reply! First I want to say thanks for all the hard work you (and others) put into this smartapp. It’s steller. I’ve tried a few others and they were good but this gave me functionality (other then figuring out scene scheduling) off the bat! So thank you!!!

I noticed they (scenes) were momentary switches and wondered why the routine didn’t trigger. I’ll have to try again. Though I was using Smart Lighting and creating a rule in there. I contemplated using virtual switches, but realized the momentary button should work. May just be a case of give it another go.

I’ve kept an eye on the CoRE thread and have been contemplating moving to it now that I have a host of new things to automate, including Hue, Sonos, etc. So I may have a look at that in the next few weeks as time presents itself.

I’ll continue to play around to see if triggering the scenes via smart lighting works. I also found an older post of yours (from 2014) that I was thinking of looking at that … or is it either depreciated or not needed at this point? https://community.smartthings.com/t/how-i-created-automated-lighting-scenes-for-hue-lights-regular-switches/6627

Thanks for the reply!

I haven’t updated that code in a long time, so I don’t know if it still works.

If you do end up trying out CoRE and have questions related to controlling Hue Scenes, let me know.

I tried again to get the scenes scheduled … no bueno. Did get the strips to turn on, but just to the last color they were at, which I know isn’t normal behavior. I noticed that my “evening” scene wasn’t triggering manually either. Which was odd because it had been the day before.

Right now I’m using Smart Lighting to trigger rule so I think i’ll be looking into CoRE this weekend.Thanks for the offer! If I run into anything I’ll shoot you a PM.

I don’t see why Smart lighting doesn’t have the capability of triggering a momentary button, unless I’m having some other issues that I’m not aware of.

On a whim in the IDE the scenes have a device type called “Hue Scenes” I’m going to try to flip them to virtual momentary button and see if that helps.

I’ll report back over the weekend.

Well good news!

The test rule within Smart Lighting worked today! HOORAY! I set it up that my presence (mobile) will trigger the Hallway Group of lights to turn on and turn pink. I set switch to Hallway group and Hue Scene. It worked! Wonderful.

Now I’ll test the other two scenes I have tonight and move the changing of the color out of the official Hue app. Also need to troubleshoot my “Evening” scene.

I tried deleting the app and setting it up again but I still get the “Failed to save page: sceneDiscovery”

11:38:40 AM: error physicalgraph.app.exception.UnknownDeviceTypeException: Device type 'AP Hue Bridge' in namespace 'info_fiend' not found. 11:38:40 AM: debug INITIALIZE 11:38:40 AM: trace Installed with settings: [selectedHue:0A00001A:0050, selectedBulbs:[8a8147de-7ea7-4ec7-8409-935737cab140/3, 8a8147de-7ea7-4ec7-8409-935737cab140/2, 8a8147de-7ea7-4ec7-8409-935737cab140/1], selectedGroups:[8a8147de-7ea7-4ec7-8409-935737cab140/2g, 8a8147de-7ea7-4ec7-8409-935737cab140/1g]] 11:38:39 AM: trace Bridge: 0A00001A:0050 - Host: null 11:38:39 AM: debug HUE SCENES: 11:38:36 AM: trace Bridge: 0A00001A:0050 - Host: null 11:38:36 AM: debug HUE SCENES: