Pretty much a novice on scripting on Vera but have been able to fumble my way thru one using the PLEG app. It monitors a change of status from one device - runs some LUA code - than turns on a light. Pretty simple. But I want the behavior to be that if it daytime do not turn on the light - but still run the LUA code. I’m assuming that he LUA code runs prior to turning on the light - so I was wondering is there a way to test for daytime in the LUA code - if it TRUE - than exit out completly so the "turn on light " part is not executed. I have this working now in the PLEG app but it starts out with 2 triggers - if status change AND daylight run LUA code - and it ends there - or another trigger that has status change AND nightime - and run LUA code plus the additional step to turn on light. I know there is a better way than doing it…
@REKEMP10, would suggest that you peruse the Program Logic Plugin section in the forum, I believe there are a number of examples that might help you with your PLEG enlightenment ;D
Have you thought of 2 action - 1 to execute the LUA, and 1 to turn on the light? You can use virtual or combination switches to offer the control you are looking for.