Timed Lights on with Motion; Lights off with no motion

I have PLTS working for my kitchen lights that does this:

At night time (Based on day/night switch) turn the lights on for 5 minutes when there is motion. Turn off when no motion for 5 minutes.

I would like to add a separate function:

When the light is switched on from the wall switch (at any time of day), keep the lights on for 8 minutes and then turn off if there is no motion.

Would I create a separate PLTS for this? Or add the light switch on as a second trigger and 8 minutes as the second interval?

If I create a second PLTS for this, will the two conflict?

Ok since I am snowed in I went ahead and tried this.

I created a new PLTS for these conditions.

Problem is the lights in question are on a dimmer.

Vera shows the dimming level but does not show explicitly On or Off. The conditions I have in PLTS are only On or Off (not load > 0).

So under the status for the “light turned on” trigger in PLTS it says false, even though lights are on 75% load.

Any ideas?

My two triggers are: lights turned on and Motion detected.

Thanks

So under the status for the "light turned on" trigger in PLTS it says false, even though lights are on 75% load.

Any ideas?

Create a Device Property for the dimmer’s LoadLevelStatus. Then you can use a numerical comparison in your Condition expression:

Device Properties
LightLevel Dimmer LoadLevelStatus

Conditions
Trigger and LightLevel > 0

Awesome. That did it. Thanks so much.

I’m going to try this tomorrow… I have had weird results with the smart switch working for one time the stopping. I wanna be a PLEGger!

I wanna be a PLEGger!

And so you shall be. And you will look back and wonder how your automation worked before PLEG. And the answer will be: sometimes… ;D

So say you turn on the light at the switch, then 8 mins go by and the lights go off… if you want to turn them on again, you have to hit the switch twice? Curious as to how this works.

Vera sends a Z-wave command for the switch for it to turn off. With both types of switches that I own (Leviton and GE Jasco) this is analogous to turning it off at the switch manually so hitting it twice to turn back on is not needed. The statement I use for exactly this use case is as follows:

TurnKithenLightOff = KitchenLightIsOn and NoKitchenMotion and (NoKitchenMotion;NOW>30:00) and (KitchenLightIsOn;NOW>30:00)

This is a passive monitor that detects when the light has been forgotten on and turns it off for us. It does not interfere at all with manual switch operation whatsoever.

Cheers!

PD

Why not depend on the switch at all for motion timeout?

Without using PLEG, I have three scenes for ‘Day Sync On’ and ‘Night Sync On’ as well as and ‘Sync Off’. Sync On turns on the Kitchen TV, Audio, and the pendant light over the sink to varying levels at night or in the day.

Day and Night Sync On scenes have two triggers, ‘Switch On’ and ‘Motion On while armed’. I use LuuP IsNight code to decide to fire the day/night trigger…which only lets one scene fire On. Day for example doesn’t turn the overhead lights on as there is plenty of natural light.

Sync Off scene fires on No Motion (configurable timeout on my Z-Wave motion detector) or on Switch Off. I found that 10 minutes in the kitchen worked well.

Basically, why not use your motion detectors timeout of no motion?

My Motion Timeouts if helpful:

  • Hallways - 3 Minutes
  • Bedrooms - 15 Minutes (with a scene controller to enable/disable motion sensor) - Use TV notifications to remind light is going off in 1 minute in LR Master Bedroom to avoid surprised darkness.
  • Living Room - 15 Minutes (with a scene controller to enable/disable motion sensor) - Use TV notifications to remind light is going off in 1 minute in LR to avoid surprised darkness.
  • Bathrooms - 5 Minutes with Door Open, 30 Minutes with door closed (using pleg timer to extend for no motion when your in the shower).
  • Garage and Closets - No Motion - Door Open = Light On and vice versa.

PS - I have to use scenes as I need custom Luup code to fire.

I find that using WIRED motion sensors attached to an alarm works better for lighting.
These have very short Trigger/Reset intervals … because they do not need to save on batteries …

I can differentiate between walking through a room (Light On based on time of day and Natural Lighting/ Short Light out Delay) and significant activity in the room (Light On based on time of day/ Longer Light out Delay, extendable based on # of motion events)

I have two sets of lights in my bedroom. If I manually turn one off late at night it indicates it’s bedtime/lights out … then after 30 seconds it automatically turn all lights off in the house, verifies the doors are locked, and the Alarm is on. Currently I also disable the motion sensors in the bedrooms. But you can leave them on with a very low lighting level and short off delay for those that need to get up for what ever reason n the middle of the night.

Of course … all controlled with PLEG

How do you code to change the interval of timeout based on activity? This is an idea I never thought of and could potentially put me back in good graces with wifey.

It uses a feature I have not released yet.
I will do a post and example when I release it.

But the strategy assumes you can see many motion events. Battery operated motion detectors might give you one event all day for a really busy room.
But for Battery Operated Motion Sensor all you know is that there was at least 1 motion during it’s polling interval … i.e. 1 event in the last N minutes where N is typically 5.

The EZMotion+ 3-in-1 Sensor Z-Wave motion sensor (battery capable, but hardwired so it’s alwas on) has the ability to fire a motion event once a minute if motion is detected.

You can do this by setting configuration variable “2-On Time” to “0” (always fire). With this “0” always fire setting, it will never send a no motion signal…unlike the 1+ minute settings.