So - I have a Bathroom Motion sensor and a Bathroom Light. I have a Simple Automation Rule that says…
When the Bathroom Motion sensor is active, turn on the Bathroom Light. The rule also says that when the Bathroom Motion sensor is inactive for 1 minute then turn off the Bathroom Light.
The problem is (as you can see from the logs) the 1 minute timer (initiated by the Bathroom Motion sensor being inactive) is NOT cancelled/interrupted when the Bathroom Motion sensor becomes active.
I would have expected the 1 minute timer to have been cancelled once the Bathroom Motion sensor becomes active.
What it now means is that as soon as the Bathroom Sensor becomes inactive the light will inevitably turn off, regardless of the fact the Bathroom Sensor continues to detect activity.
How do I resolve this? This seems a pretty obvious and basic flaw with the Simple Automation Rules. If necessary I could write a separate rule using the Rules Machine, but this seems like overkill as surely the scenario I’m trying to automate is exactly what the Simple Automation Rules feature was designed for?
From completeness here are the details of the devices involved: -
As a newbie it would appear that I cannot add pictures or links in my posts (??) and therefore I cannot send screenshots or post links to my screenshots.
Any help would be VERY much appreciated. Like I said I'm new to Hubitat, but am a fast learner
I hadn't realised there was another App ("Motion and Mode Lighting App") which I've now started using, and that is behaving in the way I would expect it to.
Sorry to have bothered you all (in my defence I did confess that I am a newbie)
Yep, Motion Lighting is a better fit for your use case. I would have recommended you try it, but you found it before I had a chance to do so.
In theory Simple Automations should work too, but it is (on purpose) very simple. The logic behind S.A. isn't nearly as customizable or as comprehensive as the slightly more complicated Motion Lighting.
I decided to give the "Motion and Mode Lighting App" a try before taking the plunge with RM4, and so far it's all looking very good - behaviour is exactly as one would expect (the inactivity timer is successfully interrupted and reset when detecting further motion).
The OP hasn't been around since 2022, so you probably unlikely to get a response.
Since then "Motion and Mode Lighting" apps have been superseded by Room Lighting. The documentation should get you on your way. If not, create a new thread with more details of your automation.
i had it first with rule machine, but someone recommend the room lighting , because on rule machine I had a trigger when the sensor change its status, i had if motion, then turn on, if lights where off, else if inactive, wait 5 min and turn off.
But the issue there it was that during that time of 5 min, if motion was detected, it will continuo counting the 5 min and turn it off even when i was there and motion was detected and immediately as it was off if i still was there and detected motion it will go back on...
so i dont know if basic rules will avoid that issue
That is what the last line in my screenshot above addresses. Wait until motion stays inactive for (time).
For example:
The motion sensor goes inactive, you have it set to watch for motion for 5 minutes. Within 1 minute, someone enters the room. The motion re-triggers the rule because it hasn't been 5 minutes. The rule will re-trigger and watch for motion to again stop for 5 minutes, therefore the light stays on until motion is stopped for 5 minutes in a row. If someone is in the room (presumably triggering motion) for 30 minutes, the lights should stay on for 30 minutes + 5 of wait until motion inactive time.
On the other hand, someone enters the room at 6 minutes. The light has been off for one minute because nobody entered the room before the 5 minute timer expired. When they enter, the light will turn back on and wait for no motion.
You can use Room Lighting to do the same thing, it is a tiny bit more complex, however it gives you a lot more options. It all depends upon how complicated your needs are.