Brand new and requesting help with an idea for Philips Hue lighting "scenes"

I’m brand new to Smartthings (and sadly, I’m an absolute novice when it comes to this sort of technology/coding/etc.). I’m trying to discover if what I’m looking to do already exists as a SmartApp; if not, I’m hoping to ask just how difficult it would be for me to build.

What I’d like to do is create different lighting “scenes” (as Hue calls them) that will be able to be triggered by actions of my choosing. In the Activity Feed, I see 5 “states” reporting for each bulb, i.e.:

Living Room - Globe Light
Switch Is On
Level Is 18
Color Is #86B648
Hue Is 24
Saturation Is 43

It seems like what I want is to have “triggers” and “effects”. I suppose I create a number of virtual switches, or virtual buttons, or whatever they are called, that will each be used to trigger its own specific states for certain bulbs. And then I can create the actions that flip that trigger (such as, enter into the geofence area, say a phrase to Amazon echo, time of day, etc.).

Does something like this already exist, that will go down into the Hue, Saturation, Color, and Level of individual bulbs? I had hoped that was what SmartRules would allow me to do, but after getting it, I found that it only seems to have on/off choices for my lights.

Could I ask someone to point me in the direction I should go? If it doesn’t already exist, is it something I could write?

Thank you all for any help you can offer!

YOu could even use the IFTTT intergration for this which will trigger real Hue Scenes from the Hue cloud.

Virtual switch is triggered based on X (switched on) that switch is monitored by IFTTT and when it is “On” IFTTT then tell Hue Cloud to run Scene X.

However, there are a number of other ways to do what you are asking, lighting with Hue is one of the big selling points in my opinion with Smartthings.

Thank you, Dean.

I may well be missing something, but when I use Hue in IFTTT, it doesn’t give me access to my scenes. It will allow me to change color OR dim lights OR turn them on/off, but not all the choices at once. If there is a way to access my pre-made scenes, or even to control all those states at once, on each bulb, that would definitely be the simplest way.

Unfortunately firing Hue scenes via IFTTT is not available action. However, setting CSS hex color values is. @Sebastian, I have been dragging my feet on writing an app that does exactly what you want, but didn’t get a chance. The closest app you can find right now within ST universe, is this:

@smart, correct me if I am wrong, but I don’t think there is a different app that can achieve what Sebastian wants, right?

As far as I know… None! @Sticks18 has been working lately on new stuff. Right? I typically create scenes with third party apps and when ST triggers the lights, they will of course pick up that scene… Or I use the Philips dimmer remotes to activate a scene or the old taps. But nothing in the ST world that I have used. I like OnSwitch app on iOS which has several holiday related as well as other themes.

1 Like

Thank you, Bobby,

I saw that one and saw that it came close, but from what little I understand, I worried a bit about how it recycles scenes.

I guess one follow up question I have is this: is what I’m hoping to do super complex? I don’t want it to poll what states the bulbs are already in, or only have them stay on for 5 minutes, or anything like that. But since I don’t know anything about coding, I don’t know if I’m asking for something super simple or super complex. I had imagined it would look like this:

{fancy technical code stuff
name of scene: Afternoon Light

{device: Living Room-Fan
set switch: on
set color to: C58ABwhatever
set level to: 44
set saturation to: 15
set hue to: 22

{device: Living Room-Desk
set switch: off

{more fancy code stuff that tells SmartThings to do its stuff, that it did a good job, and that it gets a cookie

And then I could take that, copy and paste the bulb code for whatever other bulbs I wanted in that scene, change the values to which ones I want soft light and which ones bright white and which ones blue, and save it as “Afternoon Light”. And then copy and paste the whole thing to make different scenes just like that one, but using different lights and different settings.

I know it will take me a lot of time to do that, but I was hoping the building blocks might already exist somewhere and then I could do the legwork.

It’s not complex at all, I think no one cared enough about it. I actually spent some time this weekend decoding Hue API, because I wanted to get the scene values to try to replicate them in ST. This is definitely my next ST project :smile:

Tagging Bruce @bravenel to see if he would be interested in expending the new Trigr app to allow setting color, hue and saturation for individual bulbs…

1 Like

Thanks, Bobby!
And when you’re done, if you feel like sharing what you write, know that it will be appreciated! :smile:

1 Like

It’s already there. …

Technically I believe it’s the Hue API that recycles the scenes. It’s just the way Hue set it up because the bulbs can only hold so many scenes. @CyrilPeponnet just pulls them in from Hue.

This type of app is not too tough to build, but it’s hard to make it user friendly. That’s a lot to input for a user and most of the values won’t mean anything to a user. I haven’t done much with scenes because of this. That said, it has been tackled in various forms.

Here’s one based on triggering scenes from a button controller that could be adapted to use virtual momentary buttons instead:

There’s also this great scene app that grabs the current state of the selected devices and stores it as a scene that can be recalled. That way you can fine tune the colors/dim levels in the environment, then easily recreate it.

1 Like

Not quite there yet :slight_smile: What I was thinking is to allow inputs for individual values (color, hue, saturation) not predefined color schemes. But like @Sticks18 said:

Are you meaning the hex value for a color? That would be doable, but would it be useful?

Bobby, I think that’s ideally what I would like. Rather than hard-coding the values in (color, hue, saturation, and I’d include level), I’d prefer a field where I can tweak them later through the interface, rather than directly in the code. But… I assumed that would be more complex. And as a novice, I worry that the more complex a code, the more chance of it breaking and becoming unsupported when the author has moved on to a new system, etc.

And Scott,
that’s kind of my feelings on those you offered. They both look like they’d come very close to doing exactly what I want, and I’m so glad you shared them! They may be my best choice. But I still worry that if I choose a complex solution for a simple need, I’m running more of a risk of things breaking that I can’t fix.

It would most certainly be, to “some” of us, who’d like to replicate Hue scenes directly in ST. You already have the color capabilities, just need to allow users to pass through the “hueColor” and “saturation” variables…

We could really use the ability to access the Color Wheel from the SmartApp input screens. I’m actually not a fan of the color wheel because of fat-finger syndrome; but I can’t think of a better way to select a color.

Hi Sebastian, Bobby is talking about a field to input those values in the SmartApp. Creating input fields in SmartApps is actually very easy, and they can be dynamic, so you can use the same code input with different values for each bulb if you get a little creative.

I think I can put this in as an alternate “Bulb color?” selection, an HREF to a page that lets you set the hex color and saturation. I’ll poke at that…


That would be awesome…

Ahh, thanks Scott! And yeah, that sounds perfect. I spent a lot of time making scenes that do beautiful things, and being able to recreate them so they can be triggered in other ways will be wonderful!

Did you find a quick way to get the settings for the scenes you’ve created on Hue hub? The API route is possible, but is not clean…

The only way I would know to do it is to set a scene through the Hue app, wait for SmartThings to poll the status of my devices, and use the information it gives me. Then do it again for my second scene, third, and all the rest. Is that the API route?