Have a SonOff motion sensor in the kitchen to turn the lights on IF the time is between sunrise and 9:59 PM and stay on as long as there is motion and if no motion is detected for 30 minutes, the lights turn off.
The lights turn on as programmed, but the lights turn off long before the 30 minutes has elapsed. We can be sitting at the kitchen table 5 feet from the sensor and the lights will go out.
I heard her mutter under her breath “I wish we could go back to regular bulbs and switches”.
Have you gone through all your long-forgotten automations just in case you forgot one that turns off the lights for some other reason? Any other mischevous people in the house who may be using a dashboard control to wind you up? My grandson tried that one with me, using a Nest Hub in another room.
This is correct. I would use a "Wait for events: Elapsed time" instead, since that will be automatically cancelled on retrigger. (You can get effectively this behavior with a delay, too, but it's a few extra clicks since you have to make it cancelable and then use the "Cancel Delayed Actions" action.) I believe that is the problem with this rule, as well. Though I a biased fan of LoMP myself.
For the sake of clarity: a wait being cancelled means both it and everything after it--so a re-trigger while on "Wait for event: motion inactive" just makes everything start over again. (There is still the above problem if it's re-triggered after that give that delays and waits behave differently.)
As you learn your way around Rule Machine, be sure to keep WAF high. Use Basic Rules for this simple use case. You can always start small, then explore more complex use cases using Rule Machine, later...
Here is what your Basic Rule would look like for your use case.
Motion Lighting would have been simpler, or even Basic Rules.
Lights On Motion Plus community app is nice as you get a warning that the lights are going to turn out because they dim before off. You can then retrigger the lights instead of having everything suddenly go dark. I wish that the built-in apps did this.
Question, Is 9:59 significant to you? Or are you using that number as always beyond sunset?
I used to use sunrise and sunset but was never happy. Now I use an Hue outdoor motion sensor which has a luminence sensor built in. After a little trial and error I've dialed it into the amount of light that I do not want my lights on. At that point simple light automation works beautifully.
Additionally I have it in my garage next to the window to see as much light as possible, but the real treat here is unlike most motion sensors this one isn't affected by temperature. So now I have dependable motion sensing in the garage.
Should be noted in my setup it does not really track outdoor luminence as a scientifically relevant number as it is in my garage, but that's where the trial and error comes in. Couple sunrises, sunsets, and overcast/rainy days and you will have your baseline to build your restrictions for your automations. It's economical because that one sensor handles all my luminence needs.
One thing I haven't dealt with yet is when the garage lights are on in the night, but I'm rarely it there, guess I could throw in a restriction based on the garage lights status.
#Unicorn...AKA a myth or impossibility, at least in my house.
My wife would come up with some reason or situation where she would WANT to be sitting in the dark, and be frustrated that the rule (and me by association) could not read her mind at that exact moment and respond accordingly.
I agree with BobbyD though in that you should first use one of the lighting apps instead of RM. I did this to automate my Fan and lights in one room for when I was working remotely at home. Most of my lighting is handled by other apps.
First rule of home automation club is don't talk about home automation club..
Sadly I've found it is better to beg for forgiveness then ask for permission and/or have a "discussion". The good news is my wife is usually tolerant of what I am doing as long as it's not too disruptive. It has also forced me to think hard about how things get integrated into our house/lifestyle.