PLEG / PLTS / timed off ...

I want to create a logic that does the following :

  1. Door sensor (DSENSE) is triggered : Turn on light
    • start a timer of 10 minutes; If within this period DSENSE is triggered again, turn light off.

I am using PLEG to accomplish nr. 1. - this works fine. What is the best way to accomplish nr. 2 ? PLEG or PLTS ?

I was thinking about something like this in PLTS :

Input

Triggers
DSENSE

Conditions

Delayed Toggle
Interval : 10:00
Reset : DSENSE

Actions
Reset : turn light off

Will that work ?

Thanks,
Martin

Hmm…maybe PLTS is not the best way to go; In this case the problem is that in PLEG it turns on the light when DSENSE is triggered; It then starts the timer, but as soon as the door is opened within the timer period, it turns off the light - but PLEG turns it on again (as it should according to the logic) …

Well - I’ll try this instead; Should work - but is there a better way ?

PLEG

Inputs

Triggers
DSENSE

Conditions

LIGHT_OFF DSENSE AND (LIGHT_ON;NOW < 10:00) AND (LIGHT_OFF;LIGHT_ON;DSENSE)
LIGHT_ON DSENSE AND (LIGHT_OFF;DSENSE)

Actions

LIGHT_OFF turn light off
LIGHT_ON turn light on