Simple motion turn on light for 2 minutes - new motion remain 2 mins

HI, I am searhcing over the forum but seem to not find an answer to my simple question. Pleg… how can I very simple turn a lamp on for 2 minutes when motion and if no motion wihin 2 minutes turn off, else keep on for 2 minutes after next motion…?

The sensor timeout would be a contributor in this, it would need to be short.
I would look at using the count function, something along the lines of if it’s been triggered twice in 2 mins then stay on.
Most of mine are on a auto off, so if you are using those then you need to work out another method of turning off.

Hi ZEd, thanks for the response.

Let met more clearly describe what I want.

I have a motion sensor. If it’s tripped it turns on a light for 2 minutes. It turns off after 2 minutes. But if any motion is detected within the 2 minutes it still turns off the light currently. I want to retrigger the 2 minutes if any motion is (again) detected within the first 2 minutes after the first motion.

Currently the light stays on and after 2 minutes turns off. I then indeed have to wait for the sensors untriptime which is 15 second by default for the FMGS-001 Fibaro. And when motion is detected it starts again for 2 minutes. I would like to start the 2 minutes period again if motion is detected again in the first 2 minutes after the first 15 seconds of that.

Got it?

Just like a normal motion sensors lamp would work like :slight_smile:

Edit: currently I use PLEG to detect motion and lightlevel and if those are met I fire an action to turn on the light and with a delay of 2 minutes to turn it off.

Sounds like you need the “Wasp in the Box”, I don’t believe anyone every designed a complete solution.
That immediate “off” is the problem after the 2nd. 2 min. interval is the problem.

Lot’s of close solutions but never a cigar.

I can see what you want, implementing it is more difficult as you need a trigger for when you leave and unless the sensor doesn’t have a timeout then you need a ???
Is a second or third sensor in an exit location(s) possible? That way you could use a sequence condition to turn the light off?

I really don’t know the solution and can see the head scratching and hair pulling your going through.

This would be easy if you used door sensors but not with motion sensors.

[quote=“zedrally, post:4, topic:199727”]Sounds like you need the “Wasp in the Box”, I don’t believe anyone every designed a complete solution.
That immediate “off” is the problem after the 2nd. 2 min. interval is the problem.

Lot’s of close solutions but never a cigar.

I can see what you want, implementing it is more difficult as you need a trigger for when you leave and unless the sensor doesn’t have a timeout then you need a ???
Is a second or third sensor in an exit location(s) possible? That way you could use a sequence condition to turn the light off?

I really don’t know the solution and can see the head scratching and hair pulling your going through.

This would be easy if you used door sensors but not with motion sensors.[/quote]

Haha, yes indeed is seems so simple.

But one more attempt due to I sense some mismatch in your response and my whish.

Using PLEG I want to turn on a light when motion for 2 minutes. If no more motion ,then turn off light (after those 2 minutes). If more motion is sensed in the time after the first then leave the light on for another 2 (additional) minutes. So as long as the motion detector senses motion keep the light on, else keep it on for another 2 minutes before turning off.

That should not be that hard isn’t it?

Wouldn’t be possible with battery powered sensors you would forever be changing batteries, you need a sensor that is always awake (and externally powered).

You could do it with a ZUNO, roll your own mains powered sensor.
Code it for 0 timeout, use it to trigger the initial 2 min. interval and then be the trigger for the exit.

[font=Verdana][/font]

I would look into the DelayLight plugin, http://forum.micasaverde.com/index.php/topic,60498.0.html / GitHub - toggledbits/DelayLight: A plugin for Vera home automation to provide off- and on-delay of controlled loads.. This plugin supports restarting a timer when the motion sensor gets re-tripped.

What’s wrong with creating a scene with a delayed action?

Scenes with delayed actions don’t reset the timer when the motion sensor gets tripped within the timer timeout…

[quote=“Sender, post:5, topic:199727”]Using PLEG I want to turn on a light when motion for 2 minutes. If no more motion ,then turn off light (after those 2 minutes). If more motion is sensed in the time after the first then leave the light on for another 2 (additional) minutes. So as long as the motion detector senses motion keep the light on, else keep it on for another 2 minutes before turning off.

That should not be that hard isn’t it?[/quote]

It isn’t hard. First a condition so that when the motion is tripped, start 2 minute timer (AKA schedule). That 2 minute timer should be a self-re-trigger, and Repeat should be on for this motion condition so it will continue to trip and restart the 2 minute timer. Next the “On” condition - if the light is off and the timer is on, turn on the lamp. Finally the “Off” condition - if the light is on and the timer has now stopped, turn off the lamp.

All of my PLEGs have more complicated logic - multiple motions and/or door sensors, plus a check to make sure the light was not manually turned on. But attached is my logic for my front yard, back yard, and garage lights. Also note, there the “Example ? Simple Motion-Triggered Light” in the PLEG Basics document. But I refuse to use NOW due to overhead, and so I can’t recommend it…

Wilme 2, ok thank you.

the reason for not answering that long is I have been puzzling A LOT. But I give up…

I have intensively read your advise from above and your PDF. But I can’t get it working in my situation.

I think the problem is I cannot get the “timer started in PLEG” according to what you were saying: “First a condition so that when the motion is tripped, start 2 minute timer (AKA schedule).”. In your PDF you have used “device: Outside Light PLEG” for this. But what is that for sort of device? I can’t seem to find the “referenced devices” in your PDF.

Attached what I have currently tried and built but not working due to the fact I cannot trigger the timer…?

:wink: That is the PLEG itself. Meaning to start a timer, the target of the Action is the PLEG itself. You actually pick the PLEG from drop-down list of devices when building the Logic Action, and then select StartTimer as the Action you want to take on the PLEG device, and then type in the name you gave to your timer…

I apologize about the PLEG format - I didn’t realize the status I posted was the old PLC 7 version from my previous UI5 installation. Here is the same PLEG in the latest PLEG version…

Yes, got it working… will monitor further. Thanks!

bump. Back to the drawing board. It all works welll… BUT

When I now turn on the light manually PLEG turns them off immediately:
((onL > 0) or (onR > 0)) and not timer (as expected).

I cannot seem to find to only turn off the lights upon “no motion” (and lightlevel below 150) detected anymore and timer passed.

Can you please help me in the logic syntax? Status report attached.

Thank you :slight_smile:

[quote=“Sender, post:14, topic:199727”]When I now turn on the light manually PLEG turns them off immediately:

I cannot seem to find to only turn off the lights upon “no motion” (and lightlevel below 150) detected anymore and timer passed.[/quote]

I would recommend starting the timer regardless of LightLevel. As it is right now, it would be expected that if you manually turned on the lights at LightLevel>=150 the lights should turn off even if motion - you didn’t start the timer due to the high LightLevel. I would similarly recommend turning them off regardless of LightLevel (which you are doing already). Just check LightLevel in the determination to turn them “on”…

As far as determining manual operation, that is a bit trickier. If you look at my PLEG, I essentially would check if “onL” had happened within 30 seconds of “on”. So if the light turned on, was it due to the fact our on condition fired? If not, assume manual operation and start a timer to decide when we can go back to automated functionality. I would build “onL” as a trigger instead of a property, but it should work as a property.

Do you have it working as desired now?

No… everything works but not the “was the light on” part :frowning:

Post an updated status and can advise on how to add in that part…

Post an updated status and can advise on how to add in that part…[/quote]

Wilm2 thank you. attached.

I still think you need a trigger on the on/off state of onL and onR.

But from what you have now, a manual override could look like this:

Create Condition “AutomaticOperation”.
Logic Expression “(onL>1 and (on; onL < 30)) OR (onL=0 and (off; onL < 30))”

So breaking down the first part: (onL>1 and (on; onL < 30))
That says: the light is on and it came on within 30 seconds of the condition firing to make it turn on.

Breaking down the sequence expression: (on; onL < 30))
That says: the on condition became true [timestamp], then the onL property updated [timestamp], within 30 seconds and in that order.

Then for a simple implementation, you can add to both conditions on and off “AND NOT AutomaticOperation”.

With further refinement we would want to change this around so we can start a timer when manually operated, and then take back automatic control when that time expires…