Circadian lighting with SharpTools rules

I’m setting up some rules for circadian lighting.

Say I want all of these bulbs to be 4000K if time is between an hour before sunrise and sunset, whether they are already switched on or not. Do I still use a time trigger, that will set the correct color temperature also for lights that are off?

What if I change the color temperature manually, then there is no way to trigger color temperature to be set whenever the light is switched on the next time? For example always being 4000K when it’s switched on during the day. Although that takes away the possibility to override the color temperature.

I thought my IKEA bulb could only use set color temperatures at 2200K, 2700K and 4000K. But it seems like it can actually be set to values in between as well.

How would you set up Circadian lighting using SharpTools rules? Only use 2700K during the golden hour of sunrise and after sunset and 4000K from sunrise to sunset? Or gradual values in between? Or using fadeLevel to gradually change level over time?

I’m using SmartThings and there are Edge drivers that can simulate Circadian lighting. But I’d rather have some more control of it myself in this way.

Depends on the light or which driver its using. Sometimes setting the temperature will automatically turn the light on too.

If you change the temperature manually you could still have rules in sharptools that are aware of that. Just depends on what you are trying to do. You could react to the light coming on and change the temp then but it will at least temporarily be at the old temp before the rule kicks in.

Yeah, setting color temperature for lights that are off didn’t work (either they are switched on or color temperature isn’t changed the next time they are switched on).

Basically, what I try to achieve is having one rule for all lights, to get a better overview.

In SmartThings I would need three routines for each individual light (and I can’t copy and paste…). Triggered when the light is switched on it changes the color temperature depending on time period.

Can I do this on one rule for all lights in Sharptools without having to use an if statement for each light?

But it should be triggered either by a light being switched on or time if light is already on… So I guess an alternative would be a rule for each light, that I can copy and paste.

You can use a variable that changes at the times you want different colours, then for every bulb, let it check the desired temperature when switching on and set it to the variable.


Great suggestion! And then also run checks for lamps that are already on with time triggers.

1 Like

Even better would be if this color temp variable could be calculated, in order to have a range of values rather than a few fixed ones. I guess something like that is actually better suited for a device handler in SmartThings, though. And currently maths with variables in SharpTools isn’t possible anyway.

The Math with Variables feature request is working its way toward the top of the list. :slight_smile:

1 Like

Could you explain with little more details how to make this work.
I’m a sharptools newbie :confused:

Not sure where to start. Under your account, there is a button Manage resources. Under there is a variables tab.
Here you can create possible variables, in which you can store all kinds of information. There is true/false, numeric or text.

In this example, he needed a second light to know which colour temperature to turn to when turned on. So in your rule set, you create the rule for turning the first light in a particular colour at the set time and set the variable to the same value.
Then you can create a rule, triggered by turning on of the second light, if variable is 2700, set light to variable value 2700. That way it follows the state of the first light.

Personally I use this for my garage doors. I have 2 cars and I have a variable I can switch on and off on my dashboard. When on, that’s my Mazda, when off, that’s my Ford.
So when I come into the garage, a rule triggers by a contact sensor. Then it checks what status the variable is. If the variable is on, then the Mazda door opens. If it’s off, the Ford door opens.

Thanks alot for quick answer. Is it possible to create Circadian rhythm or similar with free account? I haven’t yet purchased the premium.

I’m afraid not, you don’t have access to the variables.

In this case, you can work around that by instead of using a variable, you use a virtual switch to hold the value you want. But don’t tell them I told you that :rofl:

How to make a virtual switch :confused: nevermind i found out How to do the switch

1 Like