Trigger event depending on which linear direction one passes by two motion sensors

Hi!
I wish to turn on a light on my porch when i have passed by two motion sensors in sequence. That is: parking my car on the driveway and walking towards my front door. There must be a way to do this but I’m not really at home with homey logic, tags, variables and scripting yet. Anybody?

I don’t know how long your driveway is but maybe a simple flow already works for you:

I’d start by testing whether each sensor triggers reliably in sequence. I.e. sensor 1 before sensor 2 going out and sensor 2 before 1 coming in. If you can’t rely on the sensors triggering in sequence, you can’t use them to determine the direction of motion.

To do that, create two simple flows:

  • One triggered by movement detected by sensor 1 that uses a Then timeline card to send the name of the sensor to the timeline
  • The other doing the same for sensor 2.

You can then experiment with walking past the sensors to see if they fire in the right sequence.

If they do, you can use the Chronograph app to detect if one fires within, say, two seconds of the other.

Having said that, I think you’d get a more reliable result detecting the presence/absence of your mobile phone using, for example, the Smart Presence app.

Andy

Many ways lead to Rome with Homey. :wink:

Assumption is the same: your motion sensor stays active for long enough so you can walk through to the next zone. My motion sensors stay active for 20 sec so that should be enough. If not you can create a an advanced virtual device where you set the motion duration when triggered by your sensor.

I prefer working with zones: you can add/remove motion sensors and lights as needed without changing the flow.

Another option is a motion sensor device in the < group > app. Place both or more sensors in a group and settings as follows:
image

Example flows: the first two are with zones and the last one is with a motion group.