PLEG, state of a trigger for some time

Hi all,

Is it possible to extend the state of a trigger for some time? (when a ping-trigger is true, can it hold on for say 1 hour?)

I have created a scene when both of us are at home, it depends on the ping state of our phones, but the occasions we are using them on the same time are little. So I like the trigger state to extend to an hour so that the overlap chance is greater.

My current settings are:

Triggers
Name Description
DThuis Ping Sensor D is Tripped
Ethuis Ping Sensor E is Tripped
IsNight Day or Night indicates Night time.

Schedules
Name Type Time Days Random On Delay Off After Type OA Time OA Days Random Off Delay
ScheduleOff1 Weekly 23:05:00 1,2,3,4,7 10:00 None None
ScheduleOff2 Weekly 02:00:00 6,7 None None None

Conditions
Name Expression
BothHome EThuis + DThuis + IsNight > 2
Off ScheduleOff1 OR ScheduleOff2

Actions
Actions for Condition: BothHome

Immediate
Device Action Arguments
KitchenLamp SetTarget newTargetValue=1

Delay 1:30:00
Device Action Arguments
KitchenLamp SetTarget newTargetValue=0

Actions for Condition: Off
Immediate
Device Action Arguments
KitchenLamp SetTarget newTargetValue=0

You could try using a sequence expression like:

EThuisX EThuis; Now < 1:00:00
DThuisX DThuis; Now < 1:00:00
BothHome EThuisX + DThuisX + IsNight > 2

EthuisX should be true for one hour after the last time Ethuis was true.

Hi RexBeckett,

Can it be that easy…
I tried this, but the Vera gives a Startup lua failed message at the top of my screen.

I will try it with a new instance of PLEG, maybe I had some lua in the old one (??)

Made a new one and this time no failure messages…

The setup with

EThuisX EThuis; Now < 1:00:00
DThuisX DThuis; Now < 1:00:00
BothHome EThuisX + DThuisX + IsNight > 2

Doesn’t work as expected, sometimes the light goes of after 10minutes, altough I set the offtime delay for 90min.
Wat can be wrong?

You could have overlapping Actions running.

You could start action: BothHome at 2:00PM and at 3:20 PM.
The light will go off at 3:30 PM because of the first trigger …at 4:40 it will get turned off again … but it’s already off.