Yet another query re motion + override with physical button

Hi,

I am trying to achieve a physical button override to motion detection for some lights (with SmartThings)

So far, I have created 2 rules (simplistically):

Rule 1:
If Motion changes to active
Turn light on

Rule 2:
If Motion stays inactive for N seconds
Turn light off

The light is also connected to a physical toggle switch, which has a “pressed” event for on and “held” event for off - this shows up against Button 1 in the ST app.

I would like to override the rule for motion inactivity turning the light off (for instance, leaving the porch light (usually turned on/off by motion) on until switched off).

I would like to handle keeping the light on (and effectively ignoring motion) before any motion detection occurs; Also by pressing the switch on during a motion detection rule being executed and currently active (say someone has come to the door and I want to be sure the light stays on until I turn it off in case they stand still!).

Would I use a third rule to set a variable for the physical switch state that could be used in Rule 2?

(Rule 1 becomes irrelevant because I am not checking whether the device is already on/off so it would still fire, but as Rule 2 is the one turning the lights off, it wouldn’t matter).

For reference, this is a Fibaro Motion Dimmer 2 with an Edge driver.

Many thanks.

I think you have 2 options, add to your current rules or create a 3rd rule that sets the variable.

Rule 1
Triggers for motion active and switch is pressed

If $context.event.device.MotionSensor
Then set $lightOnByMotion True
Else set $lightOnByMotion False
If motion active 
Then turn light on

Rule 2
Trigger motion inactive for N seconds

If motion inactive AND $lightOnByMotion is True
Then turn off light

I do similar but use Hubitat not SmartThings and also use the Fibaro Dimmer 2. In Hubitat it reports the event ‘on physical’ when the switch wired to the Dimmer 2 is used, as opposed to ‘on digital’. I have three rules:

  • the first is triggered by ‘on physical’ or ‘dim physical’ and sets a Boolean variable True
  • the second is triggered by ‘off physical’ and sets that same Boolean False
  • the third is my motion lighting rule and I’ve set that up so that on motion active the light comes on, waits x minutes and goes off. I use the value of the Boolean to stop the lights switching off.

When I walk into a room and the motion lighting switches the light on, I just need to use the switch to alter the dim level a fraction and that will flip the boolean True and the light will stay on indefinitely. When I switch it off via the switch it re enables the motion lighting after a 5 second delay (that allows me to clear the motion detector on my way out of the room after flipping the switch off)

Looking at @Terri example above, I do it in the opposite way I have lightPhysical set True/False by using the switch and use that as a condition in the motion lighting rule.

1 Like