Problem with overlapping actions

Here is my situation. I have a smartapp that turns on lights when there is motion and then turns them off 5 minutes after not motion is detected. So there was motion and the light goes on. Before the trigger to turn the light off fires, I have a routine to turn the light on for a few hours at sunset. The routine fires and then light is still on. But then the no motion trigger takes place and now the light is off when it should be on for a few hours. Anyone have any idea how to resolve this? It has happened in other scenarios with detecting presence also.


You can do that in webCore instead of the app.

Basically, you would set the light on a 5 minute time upon motion. You would also set the light to come on at sunset.

I think I’d probably set a variable that indicates if the light is on because it hit sunset and then check that variable before turning off the light that was turned on as a result of motion.

You didn’t state what app you are using, but apps are typically not that complex and may not be able to handle your situation.

1 Like

Are you Smart Lighting? If yes, you can click on More Options at the bottom of the screen and choose only at a certain time. For the motion rule, you can have it start at the end time the other rule stops and have it end at the start time for the other rule.

1 Like

You could also uses modes for this. Set your mode to Evening when the sunset driven rule is triggered (and trigger the light change off that mode change too) and then not trigger the Off in the first rule if the mode is Evening.

As others have said, it depends which SmartApp you are using. If Smart Lighting, and using the “also turn off” feature, you may have to split your one rule into two.

1 Like