Newbie help :(

I was wondering if some of you kind gentlemen and ladies could assist me. Here is what im trying to accomplish with PLEG.

Outside Motionsensor1 and outside Motionsensor2. Have very short timeout of 10seconds. (just go with this for now please…)

I want my scenes to trip as soon as both detected motion. This I have done:


AeonMotion and ecoMotion and morn

not too hard. .

now the hard part, so i’m sure its quite obvious to see my scenes goes off every ten seconds when there is movement… i want to get rid of this. i want a short timeout of my 10seconds, but need to have some logic where if it went off from the first condition and is within say 5 minutes dont trigger again, only trigger if last condition was true after 5 minutes. But then still allow me to retrigger after 5 mins on the first run through again. I think I need to use some sort of timer to start and stop, but i’m lost :confused:

So movement from both–Boom Trigger
Movement within 5 mins? dont trigger.
Movement has been outside of 5 mins, you can trigger once again

i’ve played with it until my head hurts and i’m sure this has been done before, so i’m hoping one of you fine folks have seen this before :slight_smile:

I would appreciate any advice!

Something like this should do it:

Timer5M OnType: SelfTrigger, OffType: Interval 00:05:00

DoLights AeonMotion and ecoMotion and morn and !Timer5M

DoLights PLEG StartTimer timerName=Timer5M
… turn on lights …

Thanks for the reply!

one thing i dont understand is the actions.

is this what I should place in?

PLEG StartTimer timerName=Timer5M
luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”,“RunScene”,{ SceneNum=“24” }, 0)

should PLEG starttimer be in the action text block? as when i did try to implement it such as this. i get this error:

outside logic[51] : Invalid LUA Action:c2

Actually do i need to use the Program Logic Timer switch for this to work?

Ignore that, i found where to start the timer. its under the Immediate section. i’m testing it now!

thanks again!

[quote=“deathtech, post:4, topic:187687”]Ignore that, i found where to start the timer. its under the Immediate section. i’m testing it now!

thanks again![/quote]

If you haven’t already seen it, you might find PLEG Basics helpful.

Your code worked out great, thanks again for the help!