In Motion Lighting, I had been utilizing the feature mentioned in the subject (found in the ML Off Options) to prevent my lights from turning off. I was using a virtual motion sensor that was set as active motion via a user app I've been creating. In this setup, when the virtual sensor was later set as inactive, the motion lighting routine would then apply the timeout timing (3 minutes in my case). If the primary motion sensor stayed inactive that long, then the lights would turn off.
Recently I noticed the options in ML had expanded (it's possible they were already expanded and I never noticed it, or maybe it's something that was added recently) to include switches as another means of preventing ML from turning off. I decided to try and change the setup to use a virtual switch instead of a virtual sensor. Now that I've done that, I've noticed that when the virtual switch turns off, motion lighting does not automatically initiate the 3-minute timeout period. Without physically re-triggering the real motion sensor, the light just remains on indefinitely.
Is this the intended functionality, or was it rolling over to the timeout before because it was utilizing a sensor device type for the prevention, or should motion lighting be kicking off that timeout period when the switch turns off and it's a bug?
The switches to disable turning off only do that, their turning on or off does not cause the lights to turn off. The basic thing that causes lights to turn off is motion inactive. So this is quite different than additional motion sensors that prevent the lights turning off if active, as when these go inactive, that event does trigger the timed off. The core functionality of Motion Lighting is driven by motion active/inactive.
1 Like
Thanks Bruce.
I was originally running into trouble figuring out how to make the virtual sensor active or inactive in the groovy app coding (I can't recall why now). I ended up making that virtual switch turn on or off, and then that triggered an RM rule to activate or inactivate the sensor. When I saw switches were an option, I figured I'd try to reduce the complexity. I guess I'll put it back (unless you know the code to change the sensor active / inactive state directly?).
One easy way to do this would be to create a Hub Variable of type Boolean, and create a Connector for it of type motion sensor. Then a rule can set the variable to true for motion active, and false for motion inactive. That motion sensor connector could be used in Motion Lighting.
To do this in a Groovy app, with a Virtual Motion Sensor (skipping all of the above), you just use
myMotionDevice.active()
and
MyMotionDevice.inactive()
To cause the Virtual Motion sensor to take those two states. The Virtual Motion sensor driver exposes those two commands for just a purpose such as this.
2 Likes
Guess I have some playing around to do.
Thank you again.