Beginner PLEG User

First off, I’m a brand new user to PLEG, but I’m really loving the capabilities of PLEG and its uses. Still learning all the programming language, etc. but it is fun to learn.

My question is this, I have 2 separate PLEGs in question that turn on lights if certain conditions are met. That part is working just fine. The part I’m struggling with, is if we try to manually turn off the light that was activated, it turns right back on because the conditions are still being met as part of the PLEG.

For example, I have a living room lamp turn on if it is Night, the light level is under 30 according to the Fibaro sensor, and there is motion detected. The light comes on, but then won’t go off if we turn it off manually. To try to remedy this a bit, I have created a re-trigger timer that only allows this scene to work every 20 min. That seems to have helped this situation, but I was wondering if there was a better way to do this or any other suggestions?

The second scenario I have is if the light level is less than 10, and the garage door is opened up, a living room lamp comes on. This is great when getting home in the dark, but as long as the garage door is up, I can’t manually turn off this lamp until I close the garage door.

Just curious what steps I could take to change things around, if any. I can live with it the way it is, because it’s awesome, but I’m guessing there is something I’m missing that would only make the garage door scene work once maybe and not constantly look at the conditions?

Thanks for your help/suggestions!

Say you have a
TurnOnLightAtNigth. Night and LightIsOff

If you turn off the light at night it will come back on.

If you only want the light to turn on when Night first happens then use a sequence expression.

TurnOnLightAtNight. Night and LightsOff and (LightsOff; Night)

The last expression is only true if the events happen in the specified order. If you turn the lights off after dark it will return false, keeping the lights from being turned on again.

Awesome! Thank you very much - I will give that a shot in the next few days when I have a chance and see what happens!