Motion Lighting Rule Not Behaving

I have a motion lighting rule for my bedroom lights (dimmer and color temp per mode, if that matters) that turns on the nightstand lights, and then if there is no motion turns them off after a few minutes. When it turns them off, I want it to also turn off the ceiling fan light and the ceiling fan, in case those are on for some reason. I accomplish this by having it press a virtual button, that then turns those off. I then want the whole thing to be de-activated if my virtual peoplesleeping switch is on.

What seems to be happening is that the virtual switch is preventing the rule from turning on the nightstand lights, but looking at the logs, it is still pressing the virtual button AND sending the command to turn off the nightstand lights (this is not part of the virtual button command) after the set period of inactivity.

So ultimately what is happening is bedroom fan is turning off at night if there is no motion, and I only want that to happen during the day.

@jrau272 It's always a good idea to post a screenshot of your config page so we can see if there is anything obvious that needs to be changed.

Sure thing. Tell me if i’m missing something.

We probably need @bravenel help here but how is the peoplesleeping switch being reenabled? It will disable the "on" function but not the "off" function...so this will still occur. I had a similar issue a while back but forgot how Bruce had me resolve this.

I think this is what you need.
Switch to disable on : people sleeping
Disable Turning Off Light : people sleeping

The same switch should be used to disable both on and off. See my test example below. Give it a shot and let us know.

Good call. I didn’t see that there was a separate setting to disable both on and off.

Thanks

Yeah, it can get a bit confusing, especially since the wording is a but different with both options.