SmartThings Community

Routine to turn on lights, set brightness, and set color

project_lighting

#1

Edit 02/08 2017: I figured out how to do this… see the posts below.

Why oh why can we not set up routines to control light brightness and color? Smartapps have the capability to do this with triggers, but I just need an app button… routine. I’ve used triggers where possible but I’d like to set color based on my mood not on a motion sensor.


(Paul) #2

This is possible. It just might require something like CoRE to accomplish it.

You could for example create a virtual switch (via the IDE) and then create a CoRE piston to set the scene when that switch is turned on.

Alternatively you could use a virtual remote like this:*

*note that the code for this is not in OP’s GitHub at present, a request has been made to see if it might still be available.


(Mr. Smith) #3

Yea unfortunately - and unbelievably - there’s no such thing as “scenes” in Smartthings. I’ve been practically begging them but so far they aren’t paying any attention to the lack of such basic features.


(Realy Living Dream) #4

Just wondering what type of sensor you use to determine your mood . This would really help, have an outdoor light set for different colors depending on the wife’s mood so I would be prepared before walking into a firestorm.


#5

Sometimes I want blue, green, or red light in my media room. I run red lights (to preserve night vision) on astronomy night configured with motion sensors… but this sucks. I don’t want that ALL of the time. Most nights I’d like normal lighting. I’m wondering if I can do this with modes. I’ll have to check on that.


#6

Okay, I’ve figured out how to do what i want:

I found a solution.

It’s running around the block to do it. But it doesn’t require a user to learn how to program this thing, install routines, and all the other things that can frustrate your average buyer. I shall continue to play with all the interesting programming stuff like Core but most users just can’t get there.

I went to the Smartthings IDE and set up a mode for my media room. I named it RED
Then I created a routine called Media Room Red that ONLY sets the mode to RED
Then I created a Smart lighting app called Media RED which turns on my media room lights, sets the color to red, and sets the light level to 10 percent.

I did it for colors I like and now they show up as routines. I press the button and my lights turn on to the color I want and at the correct luminance level. Amazon Alexa also picks these up as devices so I can tell Alexa to turn on when I say, “Alexa, turn on media room red.” Then if I want, I can tell Alexa to dim the light level to what seems appropriate.


#7

STEP BY STEP I hope this isn’t overly verbose, but I do try to include all the steps for someone who is unfamiliar with the process. PLEASE if anyone finds any errors here, let me know and I’ll update the procedure.

Here are specific steps to create a new mode:

  • Go to https://graph.api.smartthings.com/location/list
  • Click on the “Home” link in the upper left and in the menu bar
  • Look down the list of stuff and you’ll see Modes, with a link to create a new mode
  • Click on the “Create New” link.
  • Enter the name of your mode. Remember, you can name this anything you want. To control the scene, I’ve used the name of my room and color. So… mine is “Media Red”
  • Click on the Create Button

Here are the specific steps to create a SmartApp from the SmartThings App on your IOS or Android device:

  • At the bottom of your screen, you’ll see a little button at the bottom of your screen. It looks like a circle with a check mark in it. It’s the one in the middle. Select it.

  • Then at the top of the screen, under the “Automation” banner, select “SmartApps.”

  • If “Smart Lighting” is not in your list, you’ll need to add it. If it’s there, skip the next step.

  • Click on "Add a SmartApp at the bottom of the screen. Select “Lights and Switches” from the list. Then select “Smart Lights” from the list. Go back to the list of smart apps.

  • Select Smart Lighting

  • Select “New Lighting Automation” at the bottom of the list

  • Tap to set the lights you want to control

  • Click on “Turn On” under “What do you want to do.” This is where you will…

  • Select “Turn On & Select Color.”

  • Select “Done” in the upper right of the screen.

  • Select “Color” and choose what you want. Then select “Done.”

  • Select “Dimmer Level” and select what you want. Then select “Done.”

  • Select “Tap to Set” under “How do you want to trigger the action?”

  • Scroll to the bottom of the list and select “Mode Changes” Then select “Done.”

  • Select "Tap to Set’ under “Turn on & set color when mode changes to”

  • Select the mode you created from the steps above. In this example, it would be “Media Red.” Then select, “Done.”

  • Select “Next”

  • Turn the button on next to “Edit automatic name”

  • Click the link under “Enter custom name” It should show “Lighting Automation” but it will only show this the first time through. If you some how mess up it will be a lengthy description of the entire process. Name it whatever you want and select “Done”

  • Select done

To create a new routine

  • Go back to the app, select the middle button at the bottom, then select “Routines” at the top of the screen under “Automation.”
  • Scroll down and select “Add a Routine”
  • Give the routine a name. In this example I named mine “Media Room Red” Then, Select “Next”
  • Scroll down and select “Change the mode to”
  • Select the mode. In this case, I chose “Media Red” Then, select “Done”

Now you have a button that will turn on your lights, set luminance level, and color.

For Alexa Users, open your app, and you can now discover your new “device.” In my case, it should be “Media Room Red”

Please note: You are changing the mode for your system. If you have any other triggers that depend on the mode, make sure you set it back after you change your lights. Also… I have found that the setting for brightness does not work reliably, if at all. This is a huge kludge and I do wish the SmartThings folks would give this capability in a simple routine.

I haven’t performed the Alexa step yet… it should work… my bandwidth is so bad, I can’t open the Amazon Alexa app right now.


(Ben Ventura) #8

you sir. Just saved me a whole lot of digging and reading.
This works wonders for me. Much appreciated. please keep up the good work.


(Michael Palmer) #9

Awesome post. This is exactly what I want to do. Thank you sir!


(Lewis) #10

Its all good but I cannot enter the colour code. I am limited to only 11 colour options. Any way I can add the colour code as well as brightness code, saturation code and temperature code?


(William Chang) #11

Continuing the discussion from Routine to turn on lights, set brightness, and set color:

Detailed and accurate instructions. Very helpful indeed. Thank you.