Smart lighting and sunrise/sunset

With all of the SmartLighting issues since the move to drivers, I ditched SmartLighting and started using a Sun Posiotion driver. Sun rise and set is presence sensor. Civil twilight is a motion sensor and astronomical twilight is a vibration sensor. There are also sun position variables that I use to open and close shades.


Done with Routines.

Switch 2 controls Switch 1

If Switch 1 is off (precondition)
Switch 2 turns on
Turn on Switch 1

If Switch 1 is on (precondition)
Switch 2 turns off
Turn off Switch 1

And you’d need another set of Routines for Switch 1 controlling Switch 2. You need the preconditions to prevent a race condition from occurring.

I haven’t played around with trying to sync dim levels in the app. The problem is there is no “if this changes” trigger. There is only “if goes from this state to another state”. Sharptools does support “something” changed as a trigger so that’s your best bet for doing it. There is a writeup about it on the Sharptools site, but I can’t find out right now. @joshua_lyon?

I’ve also seen discussions that it might be able to be done with the Rules API, but I haven’t investigated it.

I use sunrise and sunset in Routines and haven’t had a problem.

1 Like

Ah. Ok. I had that working, I think. But it started looping on me one night so I got rid of it. May give it another go as I’m not 100% positive I set the preconditions.

1 Like

You could use Context Variables to copy the event value into the setLevel() command for your target devices. It would look something like this:

My screenshot is using the new ‘changes’ trigger available in beta which make this easier as you can have the rule trigger any time your source level changes.


Without that, you would need to setup the trigger for ‘and is greater than or equal to 0’ so it triggered anytime the level updated (any value 0-100).


1 Like