Motion lighting scenario

I'm probably just not thinking clearly, but need some help.

I have motion lighting partly working for a room that has a somewhat odd switch location (smart switch; not smart bulbs), which led me to this question. The switch location is about 16" ahead of where entry into the room trips the motion sensor. If I positioned the sensor somewhere else, it would turn on every time someone walked past the entry door.

I used the option to run the motion lighting if a switch was pressed, and set it to use the same switch that it's turning on if the "trigger" was motion. What I noticed was, if I press the switch, but end up not entering the room (let's say, if I was a child and got distracted :wink:) the light goes on, but because the motion sensor never trips the app doesn't turn the light off.

Is there some way to adjust the motion lighting to still turn the light off when it reaches the timeout period? Any other automation suggestions if nothing in the app can do it?

If I understand you correctly, if the motion sensor is never activated but the lights are turned on manually, you want them to shut off after a set period?

I guess within the motion lighting app the countdown timer starts after motion is no longer detected but if motion is never detected in the first place it never starts the countdown timer even if the light is turned on manually? Never really tested it but sounds like that's how it works.

You could do something with simple automation that just shut the lights off X min after the lights were turned on. But that might end up causing a situation where the lights would turn off after X min if they were turned on by motion and you were still in the room.

RM allows you to set a trigger on whether a switch is turned on physically or digitally. You could write a simple rule that triggers on the switch being turned on physically, then waits for a preset amount of time, and turns the switch off. You might end up conflicting with the motion app if you turn the switch on physically and start the countdown timer but then move around in the room and activate motion. Some fiddling might be necessary. Or maybe you could ditch the motion lighting app altogether and do it all from within RM? Wouldn't be my first choice but it certainly could be done.

Your interpretation is correct. I presumed the option to also activate via switch would start the countdown like the sensor does, but I'm not seeing that happening.

I had gone to motion lighting because I just wasn't understanding the programming around doing the equivalent using RM (and now I have some added complexity where a virtual switch keeps the lights on until that switch turns off, which wasn't part of the original criteria).

I was hoping to avoid going back to it, but if I do an RM solution, I think you're correct that it could get confused if it's hybrid. I'd likely try to go back to RM for the whole thing, and drop motion lighting.

That could be complex... but it would certainly be a great opportunity to learn RM! There are a couple of community-supported motion lighting apps that do more than what the built-in app does, but I don't have any experience with them. Might be worth a quick look before you launch into the world of RM. If you still want to give it a try you'll find plenty of folks to help.

I wondered if there was any way to press the switch that could simulate motion for the sensor? I had previously seen in RM that I could set a virtual motion sensor as active or inactive state, but when I tried to do it with the real one yesterday, it only showed an option to refresh the sensor.

Thanks for the suggestion about

I'll look into that, too.

I was thinking exactly the same thing. Could the switch somehow turn "on" the motion sensor...? But no... I just tried the same thing. I also briefly checked the community-supported lighting app I was thinking about and it doesn't look like it has the functionality you want.

But here's something that might work in addition to your existing motion lighting app...

This would get triggered if the switch was physically on and then wait 5 minutes to see if there was any motion in the room. If it timed out and there was still no motion in the room it would turn off the light.

I have not tried it so I'm not sure if it would actually work the way I think it would. But it is probably not a bad place to start.

I would check the switch to see if it it can distinguish between physical vs digital triggers. Then setup a rule in RM that simply triggers with the physical switch. Then it would just have a delay and turn off with motion on that sensor. Make sure the delay is cancelable. Then if motion is detected it just cancels it doesn't do anything. If motion isn't detected then the delay would complete and initiate the off command.

I wonder if you could use this?

You could turn on this virtual timer switch under 1 of two conditions, the physical switch is turned on or motion becomes inactive.

When the virtual timer switch turns off, turn off the physical switch only if motion is inactive at that time.

That way the timer will count down from pressing the physical switch, but if you trigger motion and it is still active when the timer runs out, it won't turn off the switch, but will set / reset the timer when motion becomes inactive.


1 Like

I was thinking of a more complicated (maybe too much so) way to do this compared to the other suggestions.

I was thinking that you could create a virtual motion sensor. When you flip the physical switch, use a rule to set it to motion active. And the same for inactive.

Then use the virtual motion, and the physical motion in a motion aggregation (Zone Motion) so that if either the physical or virtual were active, you would end up with a combined active.

Then use that Zone Motion output to run Motion Lighting.

There is probably a different way to do this with Rule Machine, but to me, this would be the most straightforward to implement.

1 Like

I had been thinking exactly the same thing, really only baulked at it on semantics, i.e. using a motion sensor to represent the flicking of the physical switch. It was only that a post for the timer came up that got me thinking about my suggestion.

1 Like

I don't think there is a right or wrong way to do this. It is just a matter getting something that works!

1 Like

Definitely, certainly not looking to claim any superiority, in the end it is about what works best for the setup and the individual.

One benefit of the zone motion option is that it does open up many more option in the motion lighting app, compared to RM rules which I expect you would need for mine.


Wow! These are all amazing ideas. Sorry to post and bail (long day tying things up before the 4th of July holiday).

I'm going to have to reread and play around with these.

I think this thread is a good example of the versatility of HE and showed that there are multiple ways to come up with viable solutions.

Thank you!