Basic Scene with Motion Sensor

I have a very basic scene I am trying to get working and having trouble getting PLEG to do. I currently have the following:

Input NoKitchenMotion = Kitchen Motion Sensor is not tripped
Condition c4 = NoKitchenMotion;NOW>30:00
Action c4 = turn off kitchen light

Seems simple enough, but light turned off while I was cooking dinner. I was in the kitchen and definitely within range of the sensor. Any ideas why this would not work? Using Schlage motion sensor and Leviton dimmer.

Also, how would I make c4 only true if the light is already on?

Thanks!

PD

Try this:

Triggers
NoKitchenMotion Kitchen Motion Sensor is not tripped
KitchenLightOn Kitchen Light is turned on

Conditions
c4 KitchenLightOn and NoKitchenMotion and (NoKitchenMotion;NOW>30:00)

Actions
c4 turn off kitchen light

Hey thanks for the recommendation. Made the change and will see…

Cheers!

PD

OK, when I changed the logic to:

[i]Triggers
NoKitchenMotion Kitchen Motion Sensor is not tripped
KitchenLightOn Kitchen Light is turned on

Conditions
c4 KitchenLightOn and NoKitchenMotion and (NoKitchenMotion;NOW>30:00)

Actions
c4 turn off kitchen light[/i]

The light never turned off…

I am struggling with two things here:

(1) If KitchenLightOn is a trigger then wouldn’t it only trigger at the instant when the light is turned on and be FALSE at any subsequent time? Shouldn’t this come from the device state or is this understanding built in?

(2) The documentation states that the sequence condition “TRIGGER;NOW>mm:ss” should work for the use case I am truing to use. Any idea why it seems to not work? Why would I need to say “TRIGGER and TRIGGER;NOW>mm:ss” instead?

(3) Can “NOW” be used as a variable in an expression? For example, I have a device property “KitchenLastTrip” = KitchenMotion sensor LastTrip. I would like to build a contition that evaluates to TRUE when:

(Now - KitchenLastTrip > 1800)

I tried to use this, but it did not seem to work.

Anyway, thanks for the help… I’m a fairly good programmer, but having difficulty nailing the syntax for PLEG…

Thanks!

PD

The light never turned off...
Turn on the light and stay away from the motion-sensor for at least 30 minutes. Then take the PLEG [u]Status[/u] report and post it here.
If KitchenLightOn is a trigger then wouldn't it only trigger at the instant when the light is turned on and be FALSE at any subsequent time? Shouldn't this come from the device state or is this understanding built in?
Triggers continuously reflect the state of the device to which they are associated. It is Conditions that only fire when their state has changed (unless they have the underscore prefix). Device Properties work the same as Triggers but convey variable values rather than simple true/false states.
The documentation states that the sequence condition "TRIGGER;NOW>mm:ss" should work for the use case I am truing to use. Any idea why it seems to not work? Why would I need to say "TRIGGER and TRIGGER;NOW>mm:ss" instead?
The expression [i]TRIGGER and (TRIGGER;NOW>mm:ss)[/i] means: [i]TRIGGER is true, and has been true for over mm:ss[/i]. If you just use [i]TRIGGER;NOW>mm:ss[/i] it will be true even if TRIGGER is false provided it was once true (more than hh:mm ago). The Status report should show us why it isn't working.
Can "NOW" be used as a variable in an expression? For example, I have a device property "KitchenLastTrip" = KitchenMotion sensor LastTrip. I would like to build a contition that evaluates to TRUE when:

(Now - KitchenLastTrip > 1800)


NOW cannot be used as a variable. It is effectively a built-in, one-minute interval timer. You can do what you want with a sequence expression, though:

(KitchenLastTrip; NOW > 30:00)

This doesn’t use the value of KitchenLastTrip but uses the time that it last changed - which should be the same within a second.

Thank you for all of your clarifications. Here is the report… There are two conditions, this one and one that turns on my bar light and turns off after five minutes, this is the other. The bar light is working fine even though the status report has trouble. I am getting undefined errors when I pull the status report.

[i]Program Logic Event Generator

Device ID: 1292013-12-28 10:27:35.831 PLC Version: 5.5


Triggers

Name

Description

Last Trigger

State

KitchenLightIsOn KitchenLight is turned on 0 false
NoKitchenMotion KitchenMotion is not tripped undefined undefined
BarMotion Bar Motion Sensor is tripped undefined undefined


Conditions

Name

Expression

Last True

State

c1 KitchenLightIsOn and NoKitchenMotion and (NoKitchenMotion;NOW>10:00) 0 false
c2 BarMotion undefined undefined


Actions

Actions for Condition: c1

Immediate

Device

Action

Arguments

KitchenLight SetLoadLevelTarget newLoadlevelTarget=0

Actions for Condition: c2

Immediate

Device

Action

Arguments

Bar Light SetLoadLevelTarget newLoadlevelTarget=100

Delay 05:00

Device

Action

Arguments

Bar Light SetLoadLevelTarget newLoadlevelTarget=0

[/i]

Unfortunately the report is missing the timing information necessary to diagnose the problem. It needs to be the Status report from PLEG. Please print it as a PDF and attach that.

Errors when displaying a Status report can often be resolved by refreshing the browser page and/or displaying the Report first.

I was able to get it working. Thanks for your help.

Your recommendation is now working. Not exactly sure why it did not work previously.

Cheers!

PD