Sure could use some help here, can't get my head around this use case
I tell Alexa goodnight and she sets the mode to Sleep and turns on the bathroom light - works perfect
The bathroom motion may or may not be active when the mode changes to sleep, however we always go into the bathroom at some point
What I would like is for the light to remain on and then once motion is detected, use the inactive motion to turn off after 1 min of inactivity. (The light should never turn on during sleep mode)
The reason why I'm trying to set this up using RM is the Motion Lighting doesn't allow to just turn off a light if it's already on and Simple Automation isn't consistent. Sometimes the light goes off after the inactive delay, other times it turns off when we are still in the bathroom moving around
Look forward to some ideas
Maybe I'm misunderstanding but it seems just as simple as letting the motion rule run normally. If the light is on and motion is detected turning the light on again isn't going to hurt anything then the normal 'no motion' portion should work as intended and turn the light off.
@toy4rick I agree you're trying to make it much more complicated by sticking it all in one rule.
If I understand you correctly you don't want the light to go off until after it detects some activity and then wait for inactivity to turn it off. You could use a wait for condition in RM.
Once the light turns on, then set the wait for condition motion activity.
The rule will pause until motion is detected.
Do you mean that you don't want ML to turn on the light normally if it's not already on but to turn it off after motion stops anyway? If so, it can do this: the "Additional switches to turn off when turned off" does exactly that. If not, SAR should work too, but I'm not sure what the problem you had with that was. I agree with the above that a rule, while it may work, is probably more complicated that you need for this (and isn't likely to help if there's an unrelated problem preventing any of these ideas from working properly in the first place).
You can actually use motion lighting to only turn off. I do this all the time.
For instance this rule will turn off my hall light at almost any time. I would just restrict the rule to turn on the light to a condition that is “Never” and have the turn off rule when mode is sleep.”
Since the mode is now in Sleep, we don't want the lights to come on at all b/c my wife gets up to use the bathroom a couple times during the night.
Unless I'm missing something, there is no way to tell ML to only turn it on this once then off for the duration of the sleep mode
I wish ML could just turn off a light with motion rather than on then off
Is this what you are thinking?
Sometimes the light is already on when mode goes to sleep if my wife is in the bathroom as I shut down the house, other times the light is not on and the sleep command turns the light on
Hey bertabcd1234, is this what you were thinking? If so, clear as mud to me, I don't understand what is happening here
I tried this, motion active/inactive works fine, however once the light turns off, it turns back on again with motion which I don't want it to do when in sleep mode (i'm using Home mode for this test)
Guess I don't understand what you mean by "I would just restrict the rule to turn on the light to a condition that is “Never” and have the turn off rule when mode is sleep." when using ML
To all the great ideas, I don't have a preference to what app is used, just looking to have it be consistent and cover the use case
You will need to set the modes to enable the light turning on to keep the Motion lighting rule from turning the light back on..
In this rule I would change wait for condition to wait for event.
I was thinking wait for it to go active. If I understood what you wanted. You tell Alexa goodnight and either someone will be in the bathroom or will be shortly. So don't start waiting for inactivity until it first senses activity. You would probably want to put a timeout on the wait for activity condition.
Then set the light to go out after the activity condition is met after however much inactivity you deem necessary.
Although I don't understand as others mentioned why the motion lighting app does not work for you. With that it should stay on as long as activity is detected.
Ah, ok I gotcha. I haven't used the specific motion rule so I don't if you can add conditions to it so maybe this is doable. If possible then use the motion rule to pause itself when it is turned off the first time (light off then pause rule). Then unpause the rule when you turn off sleep mode in the morning or if you don't need it during the day unpause it using your sleep routine. If that's possible then the motion turn on/off will only run once.
Another option would be to create a virtual switch, this would be the one used in your motion rule. This switch would then be the trigger for another rule to control the actual light. Within this rule you can put all conditions you want on that light.
Alexa 'Sleep' - Turn on the light and set mode to Sleep
Motion rule - Turn on / off this virtual switch normally, w/o any restrictions or conditions.
Light Control rule - Trigger on this virtual switch change. If switch is 'on' and not sleep mode then turn the light on. If switch is off then turn the light off. You can add any additional conditions you want in this rule.
I played with a RM Rule using Virtual devices and so far, it seems to work.
Let me know your thoughts
There are so many different solutions that there is no right or wrong way to do it. If this works the way you want then you've done a great job.
Here is another idea for you..
i have a similiar rule that turns on light with motion by front door only when dark.. with a caveat that if the light was turned on manually dont apply the rule at all..
it works fine..