Motion Automation off/off

I’m wondering as to how to write the automation for lights turning on/off based on the motion. I did try to create one. I have tow separate automatons. When motion is detected one automation turns the lights on and the other turns them off when no motion is detected. I used the delay option on the 2nd one. The problem is once the 2nd automation is triggered, there is no way to cancel it. So if someone walks into the room - even though the motion is detected again and the on automation triggers correctly, the off automation has already been triggered and it will shut off the lights when the time expires. Ideally, the scheduled off should be cancelled when the motion is seen again. I am guessing there is a better way of doing it, but i can’t seem to figure it out. Any thoughts? Thanks

You can do this all in one automation. In the THEN section you can chose to automatically shut the light off after X minutes. This might solve your problem.

i think i tried that too. But I don’t want to simply shut the lights off after 10 minutes - if someone is still in the room, the automation should be canceled. If I do it this way, I think it’s unconditional.
So in terms of order: motion detected - turn the lights on, motion not detected - turn them off after 10 minutes unless motion is detected within this interval. Thanks

As you have discovered, what you want to do is actually beyond basic general purpose ‘if … then …’ rules, such as the Automations use. I’ve never really looked to see if the Automations have had the required bespoke logic added in, but if they have someone will probably be along and explain how to do it.

There are two reasons I haven’t looked. One is the existence of webCoRE, a powerful, community written, general purpose rules engine with all sorts of extra tricks to handle thing like this.

The other is that there is a stock SmartApp named ‘Smart Lighting’ which was written with a limited set of rules that were tailored to the sort of things that are commonly done with lights and switches. That is what I would use to do the job. It also has the bonus that part of its ruleset is also implemented in the hub firmware enabling local execution of some of your lighting automations. If you haven’t already come across it, you should find it available for installation in the mobile app.

Right. Smart Lighting doesn’t quite do it either. I have not looked at webcore yet, but I will. Thanks

Have you found / established a solution?
I also look for a way to pause / mute a motion sensor automation if there is continued movement.

What exactly are you trying to do? Smart Lighting handles the classic scenario where you turn something on with motion and off again if there is no motion for a period of time, starting over if motion resumes. It is all handled in the one automation.

Sadly it doesn’t handle multiple motion sensors very sensibly (in my opinion).

1 Like

WebCore can do this. Turn on if motion, turn off after X minutes of no motion.

Thanks! How would that look like? I understand what WebCore is / can do in principle, but have no experience as yet. Would you be able to share a working solution which I can try to get started?

1 Like

Easiest way is just something like this. Turn on XX light with motion from YY. Once YY stops seeing motion, wait 10 minutes and turn off XX.

1 Like