New Hubitat user and trying to make the transition. I currently mostly run Lutron devices. I have a few Lutron Motion Sensors (Caseta not RA Select) which have worked without issue in Lutron App. Having done some reading I believe the Caseta Motion Sensor is not supported via TelNet. My experience seems to suggest this as well as both of my motion sensors have blank logs despite them working to turn lights on and off in the Lutron App.
Now I realize the long-term solution is to replace these sensors with something else and make a simple rule in "Motion and Mode Lighting Apps". but I realize that this will not work with my current sensor.
But... Given that I'm trying to learn the Hubitat Apps better I'm trying to understand if there is a way to get around this. Mostly for my own learning. Is there a way to Trigger some sort of timer every time the light "SHOULD" be triggered. Then reset it each time the light "SHOULD" be triggered. I think I can make a timer that would start when the light is actually turned on but it would turn the light off after X amount of time regardless of whether there is any additional motion. I'd like to avoid that by resetting the timer every time the light should be turned on.
Again, I realize this isn't the right way to do it but it's more about learning the possibilities of the system.
The restriction is an artificial one imposed by Lutron. Motion sensors can only trigger a lutron device. There are some workarounds, but you have to be willing to accept the limitations.
You join the motion sensor to the room where the device is in the Lutron app and set it to control the device. If you don't want it to actually trigger that Lutron device, you can unplug the device (pretty much only applies to plug-in dimmers) and the motion sensor will continue to trigger the device in the Lutron app. Hubitat cannot see the motion sensor triggering, but it can see the device turning on and off. Link that to a virtual motion sensor with a rule and you're good to go.
If you want to trigger a lutron device, but also trigger non-lutron devices, you can do that too. Same as above, just trigger a virtual motion sensor when the lutron device triggers.
I use the first method for a Lutron motion sensor I have.
Yes, you can have the Lutron motion sensor trigger a Lutron switch or dimmer then use the Hubitat Mirror app to mirror that action to a non-Lutron device that is controlled by Hubitat.
I my shop I have a ceiling light controlled by a Caseta dimmer. I have a Lutron motion (Occupancy) sensor set to turn on that dimmer when motion (occupancy) is detected. I also have a series of LED light bars (similar form factor to 4 foot florescent tubes) that I almost always want on because of my old eyes. The LED bars are plugged into a Zooz Zen06 Z-Wave outlet. In Hubitat I have established a Mirror rule so when the Lutron Dimmer is switched on, the ZEN06 is also switched on. In this way the Lutron motion (occupancy) sensor is controlling the Z-Wave ZEN06.
Ok so this one is very interesting to me. Here's what I want to do.
I have a Lutron Motion sensor in my Laundry room that triggers the light. The minimum delay to turn off using Lutron App and native hardware is 5 minutes. I'd like to lower this to 1 min using a version of your suggestion.
Here's what I've laid out (Not currently working)
Created a Virtual Motion Sensor with a 1 minute Auto Inactivate timer.
Copied your rule laid out here
When Laundry Lights are triggered Virtual Motion sensor is tripped and its status goes to active (Works as intended)
One minute later Virtual Motion sensor times out as expected but doesn't turn out the laundry room lights because it isn't linked in any way (I know this is wrong I just don't know how to fix it)
How can I trigger Laundry Room lights off when the Virtual Switch Auto Offs?
I learned a lot from following your example and so I tried to adjust the IF Statement as such.
Now this turns off the Laundry Room light after 1 minute but causes two issues.
It goes off after one minute even if the motion sensor is triggered again. I thought if I retriggered this script before the delay of one minute was done the line "Cancel Delayed Actions" would be able to wipe the previous rounds delayed actions but I presume this isn't how it actually works.
Once the Light is turned off this triggers Lutron's built in cooldown of 5 minutes and the motion sensor won't turn the light back on within that period. I need it to go off by "auto-off" function to avoid the cool down period.
Here's what I'd suggest since it's a brief activity area. Change the Lutron motion sensor to 1 minute timeout. Yes, it does that. I missed it myself until someone (I think it might have been @Eric.C.Miller) pointed out that it does have a 1 minute timeout setting.
1-Minute Timeout (For use in areas that experience brief activity; hallways, laundry rooms, etc.)
Press and hold the timeout button for 10 seconds until all
3 LEDs begin flashing rapidly.
Press and hold the timeout button until all 3 LEDs turn on solid,
indicating the 1-minute timeout has been saved.
For the virtual motion sensor, I would keep that as a separate rule. You might have noticed I have a little gear icon at the end of my rule name. I use that as a way to quickly look at my rules and see that this particular rule is a mechanism in the greater part. Won't mean the same to everyone, but I know what it is.
Build a separate rule for any non-Caséta lights you want to control, but for only controlling Caseata lights, you don't actually need a rule. Just set the sensor to a 1 minute timeout.
In case you decide 1 minute is too short and you don't want to go to 5 minutes on the sensor itself, then you can create a separate rule that has the exact delay time you want. It will be triggered by the virtual motion sensor, which is activated and deactivated by a separate rule just like I posted, so the Caséta dimmer can trigger the virtual motion sensor, and that virtual motion sensor can then be used easily in other rules to trigger other lights and devices if you want.
*Trigger Event*
Laundry Room Virtual Motion Detector *changed*
*Actions to run*
IF (Laundry Room Virtual Motion Detector active(F) THEN
Cancel Delayed Actions
On: Laundry Room Main Lights
ELSE
Off: Laundry Room Main Lights --> delayed: 0:04:00 (cancelable)
END-IF
And of course, there's always more than one approach you can take. @bravenel show me this technique and I use it a lot.
*Trigger Event*
Laundry Room Virtual Motion Detector *changed*
*Actions to run*
IF (Laundry Room Virtual Motion Detector active(F) THEN
On: Laundry Room Main Lights
Wait for condition: Laundry Room Virtual Motion Detector inactive TRUE
Wait for event: --> elapsed time: 0:04:00
Off: Laundry Room Main Lights
END-IF
Thank you for this info. For my purposes using the one-minute built-in timer is going to be the way to go. That said, for my own learning, I need to see this virtual motion detector to its full potential.
So I've implemented rules just as you've laid out. I turn it on, wait the allotted time (2min), and it turns off the switch as intended.
The one issue that remains is that because I've turned off the switch and not allowed it to time out with this
Off: Laundry Room Main Lights
the physical Lutron Motion sensor still goes into a 5-minute lockdown and won't retrigger until after that 5 minutes is up.
I'll probably get a lot of for this but, sometimes I think its easier and cheaper to just replace a switch like the one you are talking about with an old fashion motion sensor switch. eg https://www.amazon.com/White-Motion-Sensor-Light-Switch/dp/B07CN63H6S/
If all you want is light on when someone is in the room then light off when they leave, do you really need a motion sensor connected to a hub and a bunch of code?
Don't get me wrong, I love playing with all my smarthome toys and figuring out how to get them to do what I want but...
I completely get what you are saying. A few points though.
the wall I'd mount it on faces the wrong direction and therefore it would never get retriggered.
@SmartHomePrimer has already solved the actual issue by adjusting the built in timer to 1min.
My ongoing troubleshooting here is really an exercise for me. I'm brand new to hubitat and figuring out this is just a way to learn the intricacies of the system.