Turn on action only if motion did not change in last 5 minutes?

Hi All,

I am migrating my last rule over to hubitat from ST.

Here's what i'm trying to do

TRIGGER:
If motion sensor A turns to Active
ACTION:
if Motion sensor B did not change in last 5 minutes
Turn on button x
wait 10 seconds
turn off button x
END IF

The reason for last 5 mins is because motion sensor B could go inactive for a bit between movement. I don't want button x to turn on unless it's been 5 minutes of inactive for Motion sensor b.

hope this makes sense. I think my only option is to ensure i leave motion sensor B active for 5 minutes itself. (it's virtual so I can). but the only trigger is an endpoint from a camera.

right now i have the motion sensor x rule (sep the one above) setup as follows
trigger:
Local endpoint
action:
On: Motion sensor x
Off: Motion sensor x --> delayed: 0:00:30

END-IF

I'd have to have off cancel is the endpoint re triggers but not sure how to do that

thanks

I'm a little confused. How is motion triggered on sensor B? By the camera?

You could have a rule just for sensor B... maybe set a switch that shows that B has been off for 5 minutes... something like:

Trigger:
  sensor B changed

Action:
  If sensor B inactive then
    Delay 0:05:00 (cancelable)
    Turn on B inactive switch
  Else
    Cancel delayed actions
    Turn off B inactive switch
  end-if

Then your other rule could be something like:

Trigger:
  Sensor A active

Action:
  If B inactive switch on then
    Turn on button x
    wait 10 seconds
    turn off button x
  end-if
1 Like

Yeah that could work.

Motion sensor B is a virtual motion with switch. When camera senses a rule (sighthound) it calls an end point. That end point turns the switch on that virtual motion sensor.

But I like your solution that will work thank you !

Glad I could help!