Change Color With Time (SmartApp Request)

(David) #1

I’ve been trying for the past couple of days to fork the Garden Hue SmartApp to work a little differently, but I am having no luck with the getting my code to work (I am having issues just setting up the menu for the install)

So I think it is time to ask for help on making the SmartApp from someone that knows the language better than myself.

What I am looking for is a SmartApp that does the following:

Pick one or more ColorControl lights as input

Pick two or more colors to change the lights to
- if no colors are chosen the app will randomly change to the available colors

Pick how often you want to cycle through the colors (the standard 5 minute,10 minute,15 minute,30 minute,1 hour, 3 hour)

Schedule on Time
- Can either:
~A set time
~Sunrise/sunset (with offset)

Schedule off Time
- Can either:
~A set time
~Sunrise/sunset (with offset)

My idea is the default will be change light every X minute/hour randomly but during holidays/occasions you can pick the colors you want to show (eg Christmas: Red/green, 4th of July Red/White/Blue)

I will keep tinkering with mine, but the learning curve is steep for this SmartApp

This is what i have so far:

(David) #2

Cool, I got the menu working and I got it to change the lights one color at a set time.

(Bobby) #3

It is sad, just sad what this community has become. Not too long ago, if someone would post an app question would have gotten 100 ideas within an hour. I wonder if we will ever get back to helping each other. If I didn’t have to chase my tail troubleshooting ST this weekend, I would have helped. If you still need help by Monday, I’ll take a look.

(David) #4

Thank you for the offer, I plan on working when I have time (which isn’t too much a few hours every other day) but you have time and want to take a peek please do.’

Where I need the most help is the time base user picked color cycle or random cycle if none or selected.

(Sal Marano) #5

Not sure CoRe may be able to this and do it random some sort.

(David) #6

Thanks for the suggestion, I post over in the peer assistance thread asking if CoRE can do it.

Being able to choose the colors is important so I can use it properly during the holidays.

(Jason "The Enabler" as deemed so by @Smart) #7

Hi David, I responded in a couple of other spots, but I’m doing so here as well so as many folks as possible can see it.

This is my holiday lights piston. It changes colors every right seconds using the lights. You can modify it as needed. It works great.

It does use a virtual switch.

(Tony - SmartThings Unpublished Contributor ) #8

Here’s one I use for my Osram Gardenspot Mini lights.

I have another Piston that controls the @gardenLightsOn variable.

Note: I had to add a setHue() and a setSaturation() commands to the DTH so that I could use the “Adjust Hue” command.

Note 2: none of the “Set Hue”, “Adjust Hue”, or “Fade to Hue” CoRE commands allow for use of a variable, so I haven’t been able to randomize the colors just yet (the “Transition to Color” command does accept variables, but I can’t get that command to work and I haven’t received a response from anyone who has).

(Tony - SmartThings Unpublished Contributor ) #9

Following up on this-

In order to have my lights loop through random colors, added a setRandomHue() command to my DTH, which just contains

def rHue = new Random().nextInt(100) + 1

My random color loop Piston is now super simple:

(JimMay3) #10

Anyone still working this? Looking for an app to change a few light colors based on holiday theme.

(David) #11

I ended up using CoRE. I works super well and while it has an initial learning curve, it is an amazing addition to SmartThings.

Here is the link to CoRE:

Here is a YouTube Video of the lights changing (sped up a little bit):

And here is a picture of my CoRE Piston: