PLEG Trigger vs. Device Properties

I wondered if you guys could provide a little assistance getting a simple (I think) scenario working properly… I’ve searched and read a lot of topics, but for some reason I can’t get this to work right.

I’m trying to use PLEG to setup a scenario where, when the house’s lock (Schlage Z-wave deadbolt) is unlocked, it will turn a couple lights on to a given setting. This was working fine using built-in scenes, but I wanted to add in some logic where if the given light was already turned on, it would not be adjusted (i.e. if some one is in the kitchen with the lights on to a certain dim level, it won’t do anything… or if someone is in the living room watching a moving with the lights on dim, it won’t turn them up)…

I think the issue surrounds wanting the lock to be the only “trigger” for the scene, but wanting the conditions to evaluate based on the state of the lights. This seems like it should be doable but I haven’t figured it out. Everything I’ve tried has either not worked, or worked for the lock, but then will not allow me to manually turn off the lights. (The lights go off but the logic is re-triggered and they are quickly turned back on). So I think the key here is I only want the scene triggered at the time the door is being unlocked, not when a light is changed while the door happens to be unlocked…

I’ve included the information from my latest attempt’s report below. Any recommendations would be appreciated!

Name Description
Door_unlocked Lock - Unit 1 - Backdoor is opened

Name Type Time Days

Device Properties
Name Device Name Device Variable
LivingRoomLampsStatus Lighting - Living Room - Lamps LoadLevelStatus
LivingRoomLampsTarget Lighting - Living Room - Lamps LoadLevelTarget
KitchenLightsStatus Lighting - Undercabinet Status

Name Expression
Unlocked Door_unlocked
c1 (KitchenLightsStatus == 0) and Unlocked
c2 (LivingRoomLampsStatus == 0) AND (LivingRoomLampsTarget == 0) and Unlocked


Actions for Condition: c2
Device Action Arguments
Lighting - Living Room - Lamps SetLoadLevelTarget newLoadlevelTarget=100

Actions for Condition: c1
Device Action Arguments
Lighting - Undercabinet SetTarget newTargetValue=1

Try the following:

c1 (KitchenLightsStatus == 0) and (Unlocked; Now < 1:00)
c2 (LivingRoomLampsStatus == 0) AND (LivingRoomLampsTarget == 0) and (Unlocked; Now < 1:00)

The sequence expression (Unlocked; Now < 1:00) will only be true for one minute after the door is unlocked.


c1 (KitchenLightsStatus == 0) and (KitchenLightsStatus; Unlocked)
c2 (LivingRoomLampsStatus == 0) and (LivingRoomLampsStatus; Unlocked)

Thanks guys, I’ll try these when I get home tonight. I think this is starting to make sense…

Thanks for all the assistance, much appreciated!