Switching on lights using motion sensors

I have a MOES zigbee light switch and frient motion pro sensor.

My question is around which is the best app to use to perform the following logic:

once motion is detected in the evening or night the zigbee light switch should turn on the lights. As long as there is motion the lights should stay on

After a set period of time if no motion is detected during the evening or night the lights should should switch off automatically

during the day the lights should remain off unless I manually switch them on or via alex

I am not asking for help on how to add these devices and I am not asking someone to create the rules for me. I am asking for help please on which app I should be used. I tried using basic rules but it doesn’t seem to include if then else feature.

Note: my motion sensors have an iluminance feature so once it gets dark AND motion is detected THEN the lights can come one

I use Rule Machine for just about everything. Here's a Rule Machine rule I just made to do basically what you're asking for:

Look no further than Basic Rules. It has all you need to perform this automation.

Bonus: you would want to set up Mode Manager so you can take advantage of whole home night, evening and daytime restrictions. Check out these documents:



My general advice is to go as simple as possible, especially at first. Basic rules will probably do what you want, at least from what parameters you outlined above.

Here are two examples, the first is a restriction by time of day, the second has a restriction by modes. I think that last section is what you are asking for when you say you want an "else"?

The more sophisicated you want to get, the more complex and therefore harder to use apps come into play.

Basic Rule is easiest, then the retired (but I think still available for new users?) Motion Lighting, then Room Lighting, and finally Rule Machine is how I would rank these as far as complexity and ease of use.

I wouldn't (and don't use) Rule Machine for most things, it is over the top for most uses, especially something simple like motion sensors activating a light.


I'm surprised no one is suggesting the Zone Motion Controller.

I use one motion sensor per room, and one Zone Motion Controller (built in app) per room. I can then adjust the timeout.

When the Zone Motion Controller say active, lights on. When the Zone Motion Controller goes inactive, lights off.

Trigger on change.

Download the Hubitat app