Keeping lights on...

I have the following:

TurnButlerPantryLightOn No !ButlerPantryLightOn and ButlerPantryMotionTripped and (!ButlerPantryLightOn; ButlerPantryMotionTripped > 10) KeepButlerPantryLightOn No (ButlerPantryLightOn and ButlerPantryMotionTripped and (ButlerPantryLightOn; ButlerPantryMotionTripped)) or TurnButlerPantryLightOn TurnButlerPantryLightOff No ButlerPantryLightOn and !TimerButlerPantry and (ButlerPantryLightOn; !TimerButlerPantry) and (!ButlerPantryLightOn; ButlerPantryLightOn > 10)

Now, the lights turn on, and the timer keeps them on for 30 seconds. But continued motion (using the RSC200) doesn’t keep them on. I am guessing that it is because the motion sensor isn’t updating Vera… but that seems odd given that I get almost instant on when motion is detected the first time. Wondering if there’s a logic issue with the KeepButlerPantryLightOn line.

How long does your motion sensor stay tripped after it detects motion? If it is more than 30 seconds then it will not re-trigger your logic before the timer completes.

I ran into a similar problem with a scene I was developing, with the problem being that the motion was only tripped when it first started detecting motion, and didn’t trip again until it stopped detecting motion. So if you stopped moving and then started again, the motion sensor would trip again and the time would restart as desired. However, if the motion sensor was continually detecting motion, it would only trip once (when it first detected motion), and so the timeout period would expire while there was still motion. The solution, in my case, was to trigger the timer on the motion sensor no longer detecting motion rather than expecting the tripped time to be updated, and simply stop the timer when it is tripped. So the workflow was roughly like:

When motion is tripped, stop timer (if running) and turn on light
When motion STOPS being tripped, start timer
when timer expires, turn off light.

I used an actual timer to make the logic make more sense to me, but I’m sure you could write it all into a PLEG condition as well fairly easily.

Interesting!

So I wonder then, how to convert that logic into PLEG?

AutoOn !ButlerPantryLightOn and ButlerPantryMotionTripped
AutoOff ButlerPantryLightOn and !ButlerPantryMotionTripped

Put the light off action on AutoOff (then the implicit timer length is defined by the ON time of your motion detector).
[hr]
If you want a longer ON time then rename AutoOff to be something like StartTimer and use it to start a timer that is the additional minutes you want the light to stay on.

AutoOff ButlerPantryLightOn and (ButlerPantryLightOn; DelayedOffTimer)

Right. Just make sure that if you do need the timer (as I did, since my motion sensor goes off the second it stops detecting motion) you make sure to stop the timer if you start detecting motion again before the timer fires. Otherwise you might still end up with the light shutting off while there is still motion. :slight_smile:

In PLEG with a retriggerable timer … restarting the timer extends the timer.

Correct, but my point is that if you have started the timer (due to no motion) and then you detect motion again before the timer fires, this also needs to stop the timer. Consider the situation where the timer is set for 30 seconds, and gets triggered due to no motion (say you walked out of the room for a moment to grab the phone). You then come back in before the timer expires and continue moving around for more than 30 seconds. Since the motion doesn’t stop, the timer doesn’t get restarted (since the timer only restarts when the motion stops), and therefore can still fire and turn off the light. You can run into the same problem even if you restart the timer when you detect motion, because again if motion continues nothing will trigger an additional extension (the whole problem that started this thread). Thus the reason you need to stop the timer when you detect motion, and start/restart the timer when you don’t.

I think lot of us think about it the opposite way - we start the timer when the motion happens. And restart it every time there is subsequent motion. No need to ever stop the timer - whenever it finally runs out we turn off the light. Hence use of Self ReTrigger timers.

I think you envision a motion detector that stays on indefinitely, but I haven’t seen one do that.

@wilme2
Most of the battery operated motion detectors have a 5 minute timer.
And that timer is a built-in re-triggered timer!

If your kids get up and move around a little more than once every 5 minutes … (and a lot of kids do!)
You will get one tripped event when they wake up … and an untripped event when they stop!

So yes, the motion event can be on a long time … in this case it’s best to turn lights off AFTER the untripped event.

Oh, I see. My EnOcean solar-powered occupancy sensors report every 60 seconds when motion is present, and then a final non-motion 120 seconds after the last motion, so I haven’t run into anything like a 5 minute report of motion without intermediate motion timestamps along the way . And my alarm motions are every few seconds…

I have a hatred of battery powered z-wave devices, so other than my door locks, I avoid them entirely…

Actually the no-motion event is filled in by the EnOcean plug-in and is a configurable period. The sensors themselves just positively report motion every 60 seconds while it is present…

[quote=“wilme2, post:9, topic:185489”]I think lot of us think about it the opposite way - we start the timer when the motion happens. And restart it every time there is subsequent motion. No need to ever stop the timer - whenever it finally runs out we turn off the light. Hence use of Self ReTrigger timers.

I think you envision a motion detector that stays on indefinitely, but I haven’t seen one do that.[/quote]
In my case, the motion sensor is connected to my security system. I get one notification when it starts sensing motion, and another when it stops sensing motion. That’s it - nothing in between to re-triger a timer, regardless of how long the motion goes on.

NOTE: There are different behaviors for different motion sensors … Battery powered motions sensors have unique protocol that are designed to minimize battery power sending Z-Wave commands (which uses a lot of power).

This is a lot different from powered motion detectors that may be attached to your alarm system. In this case you get an Untripped event in a few seconds.
Followed my another tripped event if motion happens in the follow minute.

Strategies on how to use these are different as a result!

[quote=“RichardTSchaefer, post:5, topic:185489”]AutoOn !ButlerPantryLightOn and ButlerPantryMotionTripped
AutoOff ButlerPantryLightOn and !ButlerPantryMotionTripped

Put the light off action on AutoOff (then the implicit timer length is defined by the ON time of your motion detector).
[hr]
If you want a longer ON time then rename AutoOff to be something like StartTimer and use it to start a timer that is the additional minutes you want the light to stay on.

AutoOff ButlerPantryLightOn and (ButlerPantryLightOn; DelayedOffTimer)[/quote]

So in my case:

[code]TurnButlerPantryLightOn No !ButlerPantryLightOn and ButlerPantryMotionTripped and (!ButlerPantryLightOn; ButlerPantryMotionTripped > 10)
KeepButlerPantryLightOn No (ButlerPantryLightOn and ButlerPantryMotionTripped and (ButlerPantryLightOn; ButlerPantryMotionTripped)) or TurnButlerPantryLightOn
TurnButlerPantryLightOff No ButlerPantryLightOn and !TimerButlerPantry and (ButlerPantryLightOn; !TimerButlerPantry) and (!ButlerPantryLightOn; ButlerPantryLightOn > 10)

[/code]

Shouldn’t the ButlerPantryMotionTripped fire each time that there’s motion? Before I go about re-programming all of my system I kind of want to see if there a better option.

Not necessarily. As RichardTSchaefer pointed out, many z-wave motion sensors have an extended on-time before they re-triger - so you will only get the ButlerPantryMotionTripped fired once per period, potentially as much as five minutes, even if motion stops and resumes in that period. In the case of the security system motion detectors I have, the motion tripped only fires if motion stops and restarts - so if it starts detecting motion, and then continues detecting motion (as is usually the case if someone is moving around in the area), there is no re-fire of the motion tripped trigger. It all depends on your sensors and how they are configured.

But for the Schlage RS200, there’s a 5 second motion reset time: http://cache-m2.smarthome.com/manuals/51213-ins.pdf

I just don’t see that working in practice.

See 8.c in the manual you referenced!

8.c states:

“When motion is detected, a message is sent to the Nexia Bridge and the Sensor remains in an active state until no further motion occurs for a period of 4 minutes. Any motion detected before 4 minutes will cause the timer to reset for another 4 minutes. (Motion reset time may be changed for test purposes. See Maintenance for more information.”

  • Jumper on both pins of the TEST connector for five second motion reset time

ibrewster seems to say that I should only be getting one fire, whre the manual suggests that any motion will cause the timer to reset (the example says 4 mins, but I have the jumper set to 5 seconds. I would set it to the 4 mins setting, but I have lights that I want to turn off if no motion in 30 - 45 seconds. 4 minutes would be overkill.

The Z-Wave device sends a TRIP message when the first motion happens.

The timer is internal to the Z-Wave device … it does NOT send a NOT-TRIPPED message until the 4 minute internal timer completes.

The reason for the timer is two fold:
1) Without a Z-Wave controller, where you are using associations … this is the on time for Lights.
2) In the case of lots of activity, (in this case as long as there is 1 motion in less than 4 minutes) the Z-Wave device saves
on battery by NOT having to send multiple Tripped/NotTripped messages. Sending a Z-Wave message is the biggest power consuming component of the device.

With most devices you can shorten the 4-5 minute timer … but then battery life goes down. This detector is NOT made by Schlage … you need to get the original manual for details on how to shorten it. It’s not typically done … that’s why its not in the Schlage manual.