Linking Triggers

I was hoping to get some assistance in linking triggers. For example I would like a light to turn on when motion is detected between 10pm and 10am. The issue I am having is I can have the light turn on due to it being within the time frame OR motion but I want the event to be run only when both conditions are fulfilled. Can anyone point me in the right direction?
Thank you!

Making triggers based on the intersection of two events like this isn’t supported by the basic Vera UI. It’s one of the reasons why the third-party Program Logic plugins were developed. Search the forum for “PLEG”.

Or if you want to do this in LUA see:,18679.0.html

Thanks for the responses! I tinkered a bit with PLEG but has some difficulty getting scenes to reliably activate under the conditions I had imposed. I just began playing with the LUUP code this morning and it seems to get the job done but the activation of lights based on motion results in a delay of about 2 seconds which feels a bit rugged to me. I will continue to test!

Chances are you are not used yo the trigger model with battery powered motion sensors.

You do not get multiple events for continued motion.
If you put a motion detector in a busy office you would see one motion detected event at the beginning of the day and a motion not detected at the end of the day.

You should not turn off lights until it reports no motion.

PLEG handles this nicely with two conditions

AutoOn Night and Motion
AutoOff Not AutoOn

Turn the lights on autoon and off on autooff.