Change light color based on time when light is off?


I have been using Webcore to successfully control a color changing light by executing the following every 5 minutes.

The reason I executed it so often is I needed an offline light (physically off) to appropriately change colors when it came back online. It worked.

5:30 AM to 6:00 AM color Orange
6:01 AM to 7:30 PM color Yellow
7:31 PM to 5:29 AM color Blue

How do I do this with Routines? I want local control if possible.

If the light goes offline (physically switched off) during the Orange period and the time changes to the Blue period, how do I get the light to change to the Blue color when it comes online (physically switched on)?

Webcore, I’m going to miss you.


Just a small terminology note: on the smartthings platform, “off-line“ has a specific meaning, essentially the same as “unreachable.“ You can’t change anything with a device which is truly off-line because it can’t receive messages from the network.

What you’re describing is just a light which is “off,“ that is common, not giving off any illumination, but it is still capable of being reached by network messages, so we still consider it “online.”

Also, can you tell us the brand and model of the light? This is easier with some brands than others. :thinking:. I know you’ve already been doing it with webcore, I just wanted to get the details in case it did make a difference in the other options.

You can change light colors at specific times, without turning them on, and also you can change colors in time periods when you turn them on

When light is turned on

Light stay off

You will need 6 routines for your 3 time periods

Hi @Dindin @milandjurovic71

With routines and zigbee bulbs you can’t set a color without turning the bulb on, even if the turn On action is unchecked, since the default handlers send a MoveToHueAndSaturation command which generates an on command as well.

You would have to use a driver with a custom handler for setColor command that does not send the “On” command


Thank you @Mariano_Colmenarejo for pointing on this issue. He could turn that light off 1 second later

Hi @JDRoberts and thanks for your response.

The light is a Sengled Multicolor 60 watt LED.

You are right, the bulb is Offline (not powered because the lamp’s physical electrical switch is off) and thus cannot accept commands.

I worked around this by having Webcore send the appropriate changes bulb based on the time period, EVERY 5 minutes. This way, the commands would execute within 5 minutes of the bulb coming Online (lamp powered on by physical switch).

Is there a way to ensure the bulb is the correct color when it come online such as sending the commands repeatedly?

I’m open to alternatives to get this working again.


1 Like

1 Like

The two routines you suggested are working, thanks!



It is generally not recommended to repeatedly remove power from smart devices.

@JDRoberts can explain why. Or google it.

I have two Sengled bulbs in bedroom lamps, the discontinued model that has a button on the side of the bulb. I removed the twist knobs from those lamps.

Generally true, but the first rule of home automation applies: “the model number matters.“

Sengled has specifically designed most of their smart bulbs to be managed like dumb bulbs, and they are OK to turn on and off with a regular switch. (One downside is that They don’t act as Zigbee repeaters because of this design, intentionally, so that you don’t lose a repeater if you kill the power to the bulb.)

It’s an engineering decision on the part of the manufacturer.

Of course, if you turn the power off at the wall switch, you have to turn it back on at the wall switch before it can hear the next network command, but a lot of people are OK with that. I think most of those people want a smart bulb in order to get the color changing capabilities, not so much for If/Then automation control.

Anyway, since this particular smart device is from Sengled, I think it’s OK. :thinking:

1 Like

Thanks, @JDRoberts! I always learn something from your posts!

1 Like