Need Help Understanding Sequences...

I’m struggling with how sequences work and cannot find info it. Thx for the help!

For instance…

difference between:
(GuestSecureON; !GuestSecureON; NOW > 2:00)
&
(GuestSecureON; !GuestSecureON > 2:00)

I thought there would be a difference between the following but both evaluate as TRUE when VacationON = FALSE (its normal state)
I want it to evaluate as TRUE only at the moment VacationON changes from True to False.

(VacationON; !VacationON)
&
!VacationON

In a sequence expression with a time constraint:

(Term1; Term2; … TermN > 1:23)

The time constraint test is applied on the time between the oldest and newest timestamps of all the terms. As this is an ordered sequence expression (using semicolons) the timestamps of the terms must also be in order so this would mean that the test is applied between Term1 and TermN.

(GuestSecureON; !GuestSecureON > 2:00) will be true when GuestSecureON last became false at least two minutes after it last became true - whenever that was.

(GuestSecureON; !GuestSecureON; NOW > 2:00) will be true when GuestSecureON is false and it is at least two minutes since it was last true. In practice the time constraint is 2:01 - 3:00 due to NOW occuring once per minute.

(VacationON; !VacationON) will be true when VacationOn last became false after it last became true. So this is exactly the same as !VacationON.

I want it to evaluate as TRUE only at the moment VacationON changes from True to False.

PulseOn !VacationON and (PulseOn; !VacationON)

The following expressions are logically equivalent:

[ul][li](XXXX; !XXXX)
and
!XXXX[/li]
[li](!XXXX; XXXX)
and
XXXX[/li]
[li]XXXX and (XXXX; NOW > YYY < ZZZ)
and
(!XXXX; XXXX; NOW > YYY < ZZZ)[/li]
[li]!XXXX and (!XXXX; NOW > YYY < ZZZ)
and
(XXXX; !XXXX; NOW > YYY < ZZZ)[/li][/ul]

The first two give some insight to the behavior of the second two.

The reference guide for PLEG/PLTS/PLC systax is:
Program Logic Core - Vera Plugin
And is linked to from many places on the UI.

thanks guys, very helpful. I read the Syntax docs several times but the way you both explained it here is much more to the point on how those statements work. For example, I did not know or see on that page…

PulseOn !VacationON and (PulseOn; !VacationON)

… this is very helpful!

I’m struggling with my “Returning Home” condition…

Aaron AND (!Aaron; Aaron < 2:00)

… I want the Condition = TRUE when I return Home (Aaron is TRUE) but have been Away (Aaron is FALSE) and only the first 2 minutes of my return. I basically need a condition to detect when I have just returned home so it will disable the alarm… but I don’t want it triggering when I have a momentary issue (Aaron becomes FALSE accidentally or phone PING fails for a few pings.)

Is this correct? Any better way to do this?

thx!

This part will be tough with the Aaron<2:00 part because PLEG won’t know if your device erroneously did not respond. If you are using a condition like this (pseudo)

NoAaron = !Ping and (!Ping;NOW>5:00)

where your timeout/retry for the Ping Sensor is less than 5:00. It should be a sturdier test for presence, but then you cannot use times less than 5:00 in Aaron<2:00

Perhaps you can come up with a time pair that works better if you are open to make the 2:00 a bit longer.

Don’t worry about Ping - it is already factored in since it is included in a separate Condition that sets ‘Aaron’ to TRUE/FALSE

The Condition I’m concerned with is what happens after Aaron is set (Ping or Manual Button Press)

Will this condition…
Aaron AND (!Aaron; Aaron < 2:00)

… be TRUE when I’m Home now, was Away, but have only been Home for less than 2 minutes?
and
… be FALSE after I’ve been home loner than 2 minutes?

YES…
But you only need:

  (!Aaron; Aaron < 2:00)

So it should be working, but it is not.

The full Condition is…
(!Aaron; Aaron < 2:00) AND (AwayON or StaySecureON or GuestSecureON or VacationON)

As you can see from the attached logs (and snippet below), at about 16:00 I arrived back home. AwayON is True and Aaron changed from False to True… but the Condition did not fire?

Wed Apr 16 16:05:40.642 - EvalConditions:Condition:AaronReturning Trigger:Aaron Result:false Wed Apr 16 16:05:40.648 - EvalConditions:Condition:RobynReturning Trigger:Aaron Result:false Wed Apr 16 16:05:40.650 - EvalConditions:Condition:Away Trigger:Aaron Result:true Wed Apr 16 16:05:40.656 - EvalConditions:Condition:Stay Trigger:Aaron Result:false Wed Apr 16 16:05:40.661 - EvalConditions:Condition:StaySecure Trigger:Aaron Result:false Wed Apr 16 16:05:40.665 - EvalConditions:Condition:Sleep Trigger:Aaron Result:false Wed Apr 16 16:05:40.667 - EvalConditions:Condition:Vacation Trigger:Aaron Result:false Wed Apr 16 16:05:40.670 - EvalConditions:Condition:NoVacation Trigger:Aaron Result:true Wed Apr 16 16:05:40.671 - EvalConditions:Condition:Guest Trigger:Aaron Result:false Wed Apr 16 16:05:40.673 - EvalConditions:Condition:GuestSecure Trigger:Aaron Result:false Wed Apr 16 16:05:40.675 - EvalConditions:Condition:GuestLeaving Trigger:Aaron Result:true

I mis-understood your use case;

(!Aaron; Aaron < 2:00)
Failed because your returned more than 2 Minutes after you left … You returned 3:49:41 after you left.

Aaron 

Is true when your are home;

 Aaron; XXXX < 2:00

Will be true if XXXX was less that 2 Minutes from when you were home.
I am not sure what the XXX is in your use case.

Id you want AaronReturning to become false 2 minutes later …
Then XXXX can be NOW. But then it will not be true until NOW fires upto 1 minute later.

I take you want it to fire right away … but there is some problem with just using:
Aaron and (AwayOn or … VacationOn)

I do not see any logic that is depended on AaronReturning being false … You have a high degree of coupling to other logic that is not visible in the PLEG report.
I guess there is coupling between your Scene 90 and some of the other variables in this condition … It’s pretty difficult to understand your logic.

I was using…
Aaron and (AwayOn or … VacationOn)
… but when I moved from 5.9 + Variable Containers to 6.5 + MultiSwitch - it stopped working.

I suspect, the sister PLEG device, Occupancy Logic (report attached), was reacting so quickly to Aaron becoming TRUE, and changing the house modes (AwayOn or … VacationOn) before this PLEG device, Security Logic, could evaluate the Conditions again. Thus, the house modes were already FALSE and the Condition was then FALSE.

I need Aaron to be TRUE when the House Modes are FALSE.

should try a time delay tactic for the house modes too?
and/or would it be better to combine the PLEG devices?

thanks for the help, I think this is the last part that is not working since my move from 5.9 to 6.x

There were no changes from 5.9 to 6.x that should have effected this.
But if you are depending on timing for events running in parallel than you will have a fragile design.

You can split this into two conditions:
c1 (AwayOn or … VacationOn)
Put a repeat on this.
c2] Aaron and (c1; Aaron)

Then c2 will only be true if you arrive after previously getting a timestamp for c1.
This assumes c1 will get a timestamp when you leave.