How to detect lingering in an area?

There’s useful information in the order in which sensors trip, but I can’t figure out how to turn this into something I can use as a trigger.

Scenario 1: kitchen motion sensor trips, kitchen door sensor trips, and now there’s been no motion on any sensor in the house for awhile. My phone has also just left the wifi network. Inference: I have left the house.

Scenario 2: stairs sensor tripped, upstairs hallways sensor tripped, it’s night, and now there’s no motion for awhile, my phone is still connected to wifi. Inference - I’ve gone into one of the upstairs rooms and I’m staying there. Probably I’ve gone to bed.

Scenario #1 is pretty useful because it could potentially improve on the accuracy of a rule that turns on an alarm when I leave: Only assume that if an indoor sensor tripped, followed by a door, followed by my phone leaving the network. If my phone left the network WITHOUT any door sensor being tripped–it’s probably just off.

Scenario #2 may be less reliable, but it’s potentially a better way of controlling climate than just assuming no motion at night = sleeping. Sometimes I stay up late and get frozen watching TV because the furnace got turned off for no motion, e.g.

So–any suggestions on how to create a trigger based on ordering of sensor hits, followed by an appropriate delay?

You should be able to do it now we have, wait for trigger.

Scenario 1:
Trigger an automation on on the first sensor (kitchen movement on)
Wait for the second sensor (kitchen door on), timeout -> do not continue.
Wait for the third trigger (phone tracker away), timeout -> do not continue.
Arm alarm.

Scenario 2:
Trigger an automation on on the first sensor (stair movement on)
Wait for the second sensor (hallway movement on), timeout -> do not continue.
Wait for the third trigger (group all movement sensors, off for x seconds), timeout -> do not continue.
Condition, (phone tracker home).
Do your in bed actions.

1 Like