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.