Help Turning Hallway Lights On After Pincode PLEG

I’m trying to use the PLEG plugin to turn my hallway lights on at night when a pincode is entered into my kwikset zwave lock. So far I have it working with some issues:

  1. I only have one Pincode, and it is set as index #1. When I use pincode index 1 as an input in PLEG, the input does not work. I have to use * instead? Not a big issue, but wondering why setting pincode 1 won’t work.

  2. I have conditions set as:

TurnLightsOn = PinCode and Night and DiningOff and MainHallOff

This works and I thought I was in the clear, but later that evening when we turned out all the lights, the hallway lights came right back on, and would keep turning on until I bypassed the PLEG. Do I have to add some kind of timer to “PinCode” so that it resets itself? I know the other conditions are met when we turn the lights out but I did not know that PinCode sticks also?

Thanks in advance!

Try the following:

(PinCode; NOW < 1:00) and Night and DiningOff and MainHallOff

[quote=“RichardTSchaefer, post:2, topic:174632”]Try the following:

(PinCode; NOW < 1:00) and Night and DiningOff and MainHallOff[/quote]

Thanks Richard,

Does that translate into pincode entered less than a minute or an hour ago? Still learning the logic flow, I love your plugins!

That’s 1 minute.
So if you turn your lights off right away … they will still come back on … if done in 1 minute.

Another way to do it is to turn them on unconditionally:

TurnLightsOn = PinCode and Night

Doesn’t hurt to turn them on if they are already on.