Variable Rule depending on whether motion activated or button pushed

Using Lutron Caseta switches. I have a few basic rules in 'transition' areas ... so for example if motion is detected in a hallway, HE turns on the lights, and then turns them off again after 1-2 minutes of no motion detected. These work great.

What I'm looking for is to keep these rules BUT if the physical button is pushed to leave the light on for 15-20 minutes of no motion.

The logs do show differently;

Switch Pushed: Office Light was turned on [physical]
Motion Activated: Office Light is on [digital]

Any ideas/examples? I've searched through the forums can can't find a good solution. I tried using the "Only when not disabled by" but that doesn't seem to work ... the rule is already triggered when I hit the switch, and so therefore turns off after the 1-2 minutes as it should. Maybe that would work if I could get to the switch without first triggering the motion detector, but that would be tough!

It might help if you posted screenshots of your existing rules, but going from what you wrote:

This might work:

Motion sensor rule:
Required expression: private boolean is true
Select option for "Cancel pending actions when RE becomes false"
Trigger: Motion
Actions:

  • Turn on light
  • Wait for motion inactive and stays inactive for 2 minutes
  • Turn off light

Second rule:
Trigger: switch turns on
Actions:

  • Set private boolean false, motion rule
  • Turn on light (in case motion didn't fire)
  • Wait for motion inactive and stays for 20 minutes
  • Turn off light
  • Set private boolean true, motion rule

When the second rule sets the motion rule's PB to false, the required expression becomes false, and that should cancel the 'wait for motion inactive for 2 minutes'

1 Like

The placement of the motion sensor is going to be a problem. Iā€™m pretty sure that Lutron does not respond to another tap if it is already on. For this to work, you need to be able to turn the switch on manually before the motion sensor goes active.

If that is not possible, you might need to rethink this plan.

Thanks tried this, but unfortunately it doesnā€™t seem to work as such when the light has already been triggered by the motion detector ā€¦

Yes thatā€™s what Iā€™m running in to ā€¦ I canā€™t hit the switch without triggering the motion detector.

I do have ā€œ1700ā€™s Modeā€ that basically disables ALL automations, but was hoping for a more specific solution here.

Based on what @JB10 said, the best you might be able to do is to turn the switch off and back on again using rules similar to what I suggested.

Edit: re-reading what I wrote, I realize I might not have been clear. With the rules I suggested, if you trip the motion sensor, then manually turn the switch off and on again (while standing relatively still :smile: ) it should keep the light on for 20 minutes.

If you have two triggers for your rule, motion and switch (physical), the variable %device% will capture which one triggered it. You can then use that in IF-THEN logic to determine how long to keep the light on. It's been a while since I've use this and I don't remember if you need to put %device% in a local variable but it shouldn't be too hard to figure out.

3 Likes