How to override a routine with another routine?

Basically, I have an existing routine on my motion sensor which will turn on my lights for a specific amount of time (when a virtual switch ‘Override routine’ is off). BUT if my virtual switch is turned on, I would like to disable the previous routine and re-enable it when the virtual switch is off.

I have currently tried setting the routine for my motion sensor to only trigger the routine if the virtual switch (Override routine) is off. One issue with this setup is that if the routine is triggered before the virtual switch is turned on, the previous routine will continue to run.

Any advice is appreciated.

Is the virtual switch manually turned on/off or controlled by a Routine? If a Routine, what are the triggers for that Routine and what are the actions? What is the exact behavior you are attempting to create with the existing Routine and the virtual switch?

The virtual switch is manually turned on either via my ST Station button/manually turning them on in the app. It would then turn my staircase lights on and set them to a specific temperature + brightness.

The virtual switch acts as an override to my motion sensor’s routine.

What the routine for my motion sensor does: Between a specific time and if the virtual switch is off, turn the lights on for 1:30 mins.

What I’m hoping to accomplish:
On: Lights remain at a pre-determined temperature + brightness while ensuring that they do not automatically turn off (based on the previous routine)
Off: Lights turned off + resuming the routine of my motion sensor

So, I would change the motion sensor Routine to be:

Staircase light is off (precondition)
Virtual switch is off (precondition)
Time range (precondition)
If motion detected
   then
Turn on staircase light with auto-off 1:30

Since your virtual switch override Routine turns on the staircase light, the motion sensor Routine will not trigger when the precondition (current state) is not met.

1 Like

That’s the thing, the suggested programming still doesn’t solve the issue when the virtual switch is triggered after the motion sensor’s routine is executed. The lights will still go off once before the virtual switch routine is obeyed.

So, thinking about this a little more, I’m not sure there is a way to stop the light from turning off once the motion Routine starts to run if you are using the auto-off feature. You might consider creating a separate Routine to turn off the light so that you can include the virtual switch as a precondition to evaluate before turning off the light. So two Routines something like:

Staircase light is off (precondition)
Virtual switch is off (precondition)
Time range (precondition)
If motion detected
   then
Turn on staircase light
Virtual switch is off (precondition)
No motion (precondition)
Time range (precondition)
If Staircase light is on for 1:30
   then
Turn off staircase light

or

Virtual switch is off (precondition)
Time range (precondition)
If no motion for 1:30
   then
Turn off staircase light
2 Likes

This is something I roughly need. I still have certain elements to tinker with like reverting the light temperature + brightness to its previous state (following a scene/circadian lighting). Thanks for your help!

Ps: I noticed as I was replying to you that you’ve added another condition: If there is no motion for 1:30. It would help in the future when I get a better sensor that supports lower cooldown periods. Unfortunately, the Ikea TRADFRI has hardcoded the timeout to 3 mins so it would definitely extend the time when the lights turn off to 4:30. Anyway, I still appreciate you going the extra mile.

Yes, you might need to tinker with my suggestions based on your devices. Also, since my suggestions were sort of “quick, top of mind” recommendations, you will certainly want to adjust them based on your experience with them :slight_smile:

2 Likes

Hey @h0ckeysk8er! Sorry to bother you again. I was wondering if you have any solution for my current issue: I have the motion sensor routine based on a specific timeframe which should turn the lights on + set it to a specific brightness. The bulb does turn on but the brightness does not change according to the implementation. I have 2 of these routines. The only difference is the light brightness for different time slots


Couple of things to look at here. First, some switches have a setting for what dimmer level is set when the device is turned on. My GE/Enbrighten motion dimmers have the notion of a “default dim level” which is what is set when the device is turned on and then can be adjusted by the Routine.

Another thing to try is simply removing the “Turn on” action and just set the dim level. Since the implementation of Edge, simply setting the dimmer level will both turn on the device and set the dim level. You remove the “Turn on” action by clicking on it and the radio button should be “unhighlighted”.

2 Likes

Only setting the brightness does work. Thanks!

2 Likes