Motion trigger example not working

I have a motion sensor i the Kitchen and using the “Simple Motion-Triggered Light example in the PLEGS Basics.pdf”.
For some reason the lights is turned of even if there are 6 people around the table and the light doesn’t turn on even if I stand in front of the motionsensor?!

I have attached the logic report.
I have several devices in this PLEG scene. The devices/conditions/actions that is connected to the kitchen is the ones starting with “Kok” (meaning kitchen in swedish…).

Also, need advice how to force the light of (meaning, to be able to be in the kitchen without having the lights on…)

Anyone?

I have comment on motion sensors for lights a lot before … I am getting tired of repeating myself …
If you use battery powered motion sensors … you can not start timing until they report “NO MOTION”
Do NOT strart timing when they report “MOTION”

You turn on lights when you get a “MOTION” request … you decode when to turn off the lights by waiting some amount of time after it reports “NO MOTION”

In a scenario with a lot of activity (kids, people …) you get a Motion request at 8:00 AM and not get the corresponding “NO MOTION” until many hours later.
It will NOT send another “MOTION” event until it sends a “NO MOTION” event.

[quote=“RichardTSchaefer, post:3, topic:195409”]If you use battery powered motion sensors … you can not start timing until they report “NO MOTION”
Do NOT strart timing when they report “MOTION”
You turn on lights when you get a “MOTION” request … you decode when to turn off the lights by waiting some amount of time after it reports “NO MOTION”

In a scenario with a lot of activity (kids, people …) you get a Motion request at 8:00 AM and not get the corresponding “NO MOTION” until many hours later.
It will NOT send another “MOTION” event until it sends a “NO MOTION” event.[/quote]
Tho this isn’t a problem I’m currently having, a quick thanks to those that do take the time to repeat the solution over and over to us struggling! I really wish there was a WIKI-FAQ repository where pearls of wisdom could be categorized by relevant gizmo so us noobs had somewhere to troll for info that MAY help! A quick search shows 9 pages of posts related to motion sensors… and that’s just in this sub-forum. If like a post of mine, it got started in another and didn’t move,… well searching can be overwhelming when it’s hard to pin-point what will refine the search without excluding the ‘solution’!

I for one have been pretty successful in the past with other tech finding what I need by forum searching, but this vera ecosystem I find it extremely difficult to get relevant hits on searches I do, and often don’t understand them when I do find them because of some logic nuance. I’m swedish, like the OP, but I don’t think it’s a language thing. I think under the hood of some tech, things are very regimented and regular but with VeraWorld there are a lot of separate systems integrating with various personalities that leave these common traps and mis-steps taken by us that are bootstrapping automation with PLEG.

I know if documented in a PLEGwikiPearls, it would be my first stop for troubleshooting a problem like this,… or dimmer switches,…my personal nemesis presently! a pain in my rumpa! (swedish for backside). Without such a place that can be, in part, maintained by the users to lighten the load on the ‘experts’ I do appreciate the pointers and help when it comes.

[quote=“RichardTSchaefer, post:3, topic:195409”]I have comment on motion sensors for lights a lot before … I am getting tired of repeating myself …
If you use battery powered motion sensors … you can not start timing until they report “NO MOTION”
Do NOT strart timing when they report “MOTION”

You turn on lights when you get a “MOTION” request … you decode when to turn off the lights by waiting some amount of time after it reports “NO MOTION”

In a scenario with a lot of activity (kids, people …) you get a Motion request at 8:00 AM and not get the corresponding “NO MOTION” until many hours later.
It will NOT send another “MOTION” event until it sends a “NO MOTION” event.[/quote]

Thanks for the answer.
I do NOT have battery operated motion sensors, they are all USB connected.
Also the parameter 3 is set to 10 seconds (Timeout period of no-motion after motion sensor trigger).
In this case, what do you suggest?

A USB connected is just a Battery device with an external power.

You need to learn how to turn down it’s MOTION window from 5+ minutes to a few seconds … so it acts like a wired motion sensor.

With a 5+ minute window … any motion during that 5 minutes extends the window. And as a result does not send any “NO MOTION”.

Try changing your timer start condition “Kok_KeepOn” to

(Kok_LightOn and (Kok_LightOn; !Kok_Motion))

Thus starting the timer when the lights are on and motion has stopped being sensed after the lights went on.

Off topic, but what motion detectors do you have that are USB powered?

Here is one … there are others…

http://www.homecontrols.com/aeon-labs-aeotec-z-wave-multi-sensor-6

[quote=“FilthyBeast, post:7, topic:195409”]Try changing your timer start condition “Kok_KeepOn” to

(Kok_LightOn and (Kok_LightOn; !Kok_Motion))

Thus starting the timer when the lights are on and motion has stopped being sensed after the lights went on.[/quote]
Thanks for the try, but I get error: PLEG - Auto Lyse[668] : (Kok_LightOn and (Kok_LightOn; !Kok_Motion)): Invalid Expression Operator: ! in:Kok_LightOn; !Kok_Motion

Any ideas?
Also, I would be very happy if someone provide a solution of how to force the lights off (duboe click on the switch or something similar)?

Not sure might be a syntax issue. When I use it I format it slightly different. like this without the extra (). Also make sure there is not a space between ! and Kok_motion.

Kok_LightOn and (Kok_LightOn ; !Kok_Motion)

[quote=“FilthyBeast, post:11, topic:195409”]Not sure might be a syntax issue. When I use it I format it slightly different. like this without the extra (). Also make sure there is not a space between ! and Kok_motion.

Kok_LightOn and (Kok_LightOn ; !Kok_Motion)[/quote]

I didn’t get the error when I removed the surrounding ().
I will give it a try during the evening.

Do you also use the forced “switch off” I mention earlier above?
Sometimes, it is annoying if I can’t turn of the lights in the kitchen while beeing there :slight_smile:

What are the lights and how are they controlled. IE: Regular bulbs with z-wave wall, hue bulbs or something else?

I have built-in switches (Qubino - Flush 2 Relay).
I tried with the latest change: Kok_LightOn and (Kok_LightOn ; !Kok_Motion)

I did a test:

  1. I went into the kitchen 16:30
  2. I went into the kitchen 16:33

However, now the lights turn off after 5 minutes (16:35)…
“Kok_Timer” (type: Self Retrigger) doesn’t seems to start when I enter the room the second time?

What am I missing?
All lights and switches are Z-wave Plus.

Try simplifying the start of the timer further

!Kok_Motion and Kok_LightOn

No lights at all? or ability to turn them off after auto on and have then stay off for x period of time.

To be able to say in advance, do not turn on lights when I walk in, you’d need another switch that is not controlled by the motion sensor. You could go physical or virtual. I use a virtual button in Vera and control it in a cell phone app to do something like that to keep my front door unlocked for an hour.

When I use: Kok_Motion and Kok_LightOn
Then the Kok_Timer is self-retriggered as it should. But but what will I miss by simplifying as I just did?

More testing. During the dinner, the lights was ON until suddenly it was turned off automatically…
Kok_Timer is false and was last true 6 minutes ago.

Why?

Your turning the timer on when it sense motion and not when it no longer does. use the NOT operator or ! on the motion trigger. the simple one just make sure that the lights are on and motion stopped.

The expanded one make sure that lights are on(true) and motion stopped(false) after lights on went true.

The simple one will start the timer if you turn on the lights via a remote app and no one has entered the kitchen to trip the motion sensor because the motion sensor is already false.

I pasted in haste. I would change the order to lights on and nomotion.

Kok_LightOn AND !Kok_Motion

I still think below should work, maybe you need to add the “> 10”

Kok_LightOn and (Kok_LightOn ; !Kok_Motion > 10)

This say the lights are on and lights on went true more than 10 seconds before the motion sensor went false

I will try this for a while and see what happens: Kok_LightOn and (Kok_LightOn ; !Kok_Motion > 10)

Just to clarify, I now use this line for the “Kok_KeepOn” condition.
For the Kok_AutoOn I have the following: !Kok_LightOn and Kok_ItsNight and Kok_Motion and (!Kok_LightOn; Kok_Motion > 10)

I noticed that it doesn’t work to copy the code from the example you provided, I needed to replace ! and ; with the same characters, then it worked, don’t know why…

After testing during valentine’s day, I can say: It doesn’t work…

  1. the lights goes on
  2. Then it is turned off
  3. After a while it is turned on again…

No one else with the same needs?
I only want the lights to stay on in the kitchen if there is motion…