So I’ve moved everything off SmartLighting onto Automations, and it all seemed fine except for an issue trying to turn off lights after motion stops. I have a spare room that’s shaped a little oddly, so I have two motion sensors.
I set this up to turn off lights after motion stops, but if I just slightly step into the room where one sensor picks up motion and the other doesn’t, it seems like the motion off automation will never fire, even though the other sensor would have already had no motion for more than 3 minutes. Any thoughts? Did I write this wrong or is what I’m trying to do just not supported in Automations at this point?
Edited to add: I’m on iOS if this is some weirdness with the new app update, or whatever.
Just in case no one else answers, which I hope is not the case, I just want to say that I’ve been trying to reply for over an hour and after all that time I still can’t get my head around what I’d expect that Automation to do, let alone tried testing it to find out what it does do.
Driven by the right pig’s ear Smart Lighting can make of multiple motion sensors, I tend to combine multiple motion sensors into a single virtual motion sensor and use that instead.
Did you try to remove the precondition?
Yep. It isn’t the precondition. It has to do with one motion sensor not getting any motion. If both detect motion, the light goes off as expected. If one doesn’t detect motion, it’s like it can’t tell that it’s been inactive the whole time.
Trying to go where ST is eventually planning to go, so avoiding anything that would require custom code. The idea is two automations to replace one SmartLighting one.
The first (not shown): Motion detected by either motion sensor, the light comes on. That one works fine.
The one shown above is basically “when motion stops for two minutes, turn off the light.” It doesn’t like to count the time without motion, unless it detects motion recently. Just trying to figure out if that’s intentional or if I’ve written something wrong or if it’s just a deficiency in the automations at this point.
Hopefully, that makes more sense. Not so great at explaining things sometimes…
And this is an actual automation, not in SmartLighting, in case that isn’t clear.
Oh I understood what you wanted. I just couldn’t decide what I’d expect your Automation to do.
I use Android and I have also changed from smart lighting, it worked very well, to automations and they are working well, but sometimes the shutdown has failed.
UPDATE: The shutdown fails less, if I remove “that does not detect movement in x time”
I have a light that is controlled with 3 motion sensors and I have:
-
An automation to turn on the light when movement is detected in any of the sensors, without any preconditions for light off.
-
An automation to turn off the light when all sensors do not detect movement, without any precondition of light on
In your shutdown automation, I seem to see what you have when any condition is met. It should be when all the conditions are met.
I would remove that the light is on, as a precondition, I think it does not add anything to the automation.
Automations are evaluated only when there is a change in the status of a device or event (Mode, Scheduled time, weather …), which is a condition.
The precondition is only evaluated to determine the execution of THEN part, when conditions are met
This is what I see in the event history for local automations.
When All conditions are met this means that your motion sensors total up to 6 minutes. Try removing one of your time delays. Or switching to an any condition. While these are not exactly what you have I included a couple of mine that are similar.
Ok, so I modified @orangebucket ‘s and @mhatley ‘s suggestions. I think the issue is that it’s not a total but an input issue. The sensor wasn’t registering that there was motion, so it could never say that it had no motion for x minutes. The virtual motion sensor wasn’t something I wanted to do, but I could set up a virtual switch to turn on with motion and turn off when there was no motion. Added two more automations to control it, but change from the sensors to the virtual switch off for two minutes for that room, and it works as expected now.
More convoluted than it probably needs to be, but it works for now, and I can refine it when I have more time to spend on it… Gotta start from somewhere.