Help! WAF is tanking

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”.

Here is the rule :

Any ideas what I am missing?

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.


Just guessin here but could the Delay clock start tickin a lot sooner than you expect due to the Wait for Event: being canceled by ANY subsequent listed trigger events, steps first, kitchen second?

Looking at the rule, I'm not seeing that the delay is cancelable, this would make it that after the first motion the delay will turn it off even if motion is detected (at least if I remember right).

Now I use Ligths on Motion Plus, great app that can even dim the lights before turning them off so you have time to react (wave your arms in the air like a moron).


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. :slight_smile:

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.)


RED ALERT on the WAF!!!!!

I had to approach this using Webcore...couldn't figure out how to get it working with the Hubitat tools...I do something similar with an fan on my Lanai...two pistons:

1 Like

Don't let that happen again! :slight_smile:

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.

Set-up time: 1 min
WAF: 100%


Did you get it going in webCoRE? Here's what I came up with. Just change the variables to fit your needs. You can put multiple triggers in the same piston. No need to separate into two...

1 Like

I would concur using Basic Rules as much as possible. I transferred over 90% of my automations to Basic Rules and have found my system to be much more stable, reliable and 'family-friendly'. :grin:


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. :wink:

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.


This isn't exactly what you are doing, but close enough and something I use all the time. You just need to adjust the trigger events to add your times. Just ignore the if tatements for fan speed.

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.

Yes. At 10:00 the kitchen lights do not come on when motion is detected. Only the under counter lights come on to 30%

I stagger times because in the past when multiple commands were executed at once, some commands were skipped. Just made ot a habit to space them apart.

Just installed that and paused all apps relating to those lights.

Will report back but this looks a lot better than my rule.


First rule of home automation club is don't talk about home automation club..
:man: :boxing_glove: :woman:

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.


haha, yes, all of that is so true!

1 Like