Sensing direction of movement

Why might you ask?

I have a front door sensor and PLEG programed to Turn on the interior lights when the front door is tripped AND it’s Night, works well.
However, the scenario only works as you arrive home it doesn’t take into account exiting the house which trips the PLEG and turns on the lights again. Endless loop…as I discovered when I had the neighbours feed the resident moggie while I was away.
I have a 4 in 1 facing up the passage, so I was wondering if there was a method of using this to sense direction, so the PLEG triggers conditions as you walk towards it (exits) and away (entry).
I was thinking something along the lines of Open Door (from outside) to turn on inside lights and Open door (from outside) to turn on the Outside lights, using a PLEG to differentiate which trigger fires first.
However, as the PLEG is continually monitoring the state of the conditions, I’m not sure how to handle it as it needs a time delay (2 secs) to differentiate direction of travel. ie OpenDoor AND (2sec delay) MotionTrip would indicate exiting the house, and MotionTrip (2sec delay)AND OpenDoor.the reverse.

Thoughts?

It needs 1 second delay to differentiate …

You have sequence expressions to determine order:
X;Y
Is true if Y happens at the same time or later than X.

And:
Y;X
Is true if X happens at the same time or later than Y.

I could modify the time stamps I use and try to increase the resolution to milli-seconds.
I need to verify I can get milli-second resolution through the socket interface … since LUA nominally only supports 1 second resolution. Then there would be a transition problem where the new Status command would not report the date properly for older (Pre-Milli Second) stamps.

So, is that a yes for v4.5?

It would certainly make the PLEG an extremely powerful addition (more so than what it is already).
:slight_smile:

I can commit it to 4.5 since I just tested it.
I loose the locale format for time in the Status Report

Here is how timestamps will be reported for everyone now:
2013-07-10 20:53:29.172

While awaiting the release of v4.5, I thought I’d put the new Status feature to work with the X;Y Y;X expression.

For the life of me I can’t see why I’m getting a true condition, when both Triggers are False?

FrontDoorOpen Front Door Sensor armed is tripped 12/7/2013 18:01:40 false
FrontDoorClosed Front Door Sensor armed is not tripped 12/7/2013 18:01:45 true
MotionTrip Front 4 in 1 Sensor armed is tripped 13/7/2013 06:35:13 false

West MotionTrip;FrontDoorOpen 0 false
East FrontDoorOpen;MotionTrip 0 true

X;Y has nothing to do with the state of X or Y … only the time when X became true relative to when Y became true.

If time needs to be introduced, how do I go about introducing it into the statement?

I do not understand the question … There are lots of examples of Sequence expressions.

^^^

Where?

Unfortunately, this is a major problem confronting people who want to use these Plug In’s.

The information is scattered about, often in obscure locations which you may or may not stumble across.

What is required is a wiki.

Richard, with the greatest respect, I’m not even able to open your pages to see if there is a documented case.
The next greatest enemy in these email exchanges is also the intent of the question.
More often than not, the answer is in fact not the answer to the question due to misunderstanding due to geographical boundaries.

Where are you located ?
I have blocked parts of the world because of excessive probes on my servers looking for vulnerabilities.

Search PLEG and Timeout
That’s a key use for sequence expressions.

Seriously, I search for that and I get Plug and timeout with references to Pledges.

Using wiki, it only gets worse…with Plague and Timeout and nothing to do with the subject matter at all.

Richard, I’d love to learn more about this, but I keep hitting brick walls, I’ll only do this for so long before I crash and burn and junk the lot.

As for blocking, is Australia considered a 3rd world country that attacks servers?

I think not…