Simple coming home screne

I am using PLEG for a few weeks now, but recently I noticed there was something strange about my setup.
I have a scene switch inside my door door lock to check if im home or not. I have also installed the Night&Day pluging to use in PLEG.
This is my PLEG setup:

Triggers:
FrontDoorUnlocked	 Voordeur: scene number 0 is activated

Conditions
FrontDoorUnlocked AND Night

Actions for FrontDoorUnlocked 
Dimmer eettafel	SetLoadLevelTarget	 newLoadlevelTarget=50

This should turn on the light at 50% only when its night. The problem currently is when im home (door unlocked) and it becomes dark, the light will also turn on.

How can I only turn the light on when the scene switch (front door) is unlocked?

You could use a sequence expression so that the Condition only fires if the door is unlocked after it becomes night:

FrontDoorUnlocked AND Night and (Night; FrontDoorUnlocked)

Nice, thanks!

What does the semi-colon do? I cannot find it in PDF manual.

[quote=“clandmeter, post:3, topic:179064”]Nice, thanks!

What does the semi-colon do? I cannot find it in PDF manual.[/quote]
You will find it in the section on Sequence Expressions - page 11.

Thanks found it.

Its a bit hard to understand at first reading, but I think i got it now.

In the example:

FrontDoorUnlocked AND Night and (Night; FrontDoorUnlocked)

means that if the FrontDoorUnlocked and Night are both true
AND
Night becomes true, followed by FrontDoorUnlocked becoming true, then the action will fire.

If the FrontDoorUnlocked becomes true first, and then Night, this action will not fire.

It is a bit tricky at first, but it becomes 2nd nature after a while. Think of the first part as all of the things that have to be true first, and then the stuff in parentheses is the order in which they have to happen.