Hello, i’m trying to understand the use off PLEG.
First I build an expression to put on the lights in the evening when the door is open or if there is movement. This only when the lightlevel is below 100 lux.
That worked.
In the morning when I come into the room a want the lights to go on untill the lightlevel is above 100lux.
Above 100lux the lights have to stay out.
Below you will find my PLEG:
At night it works when the lightlevel is below 100lux.
But at day when the lightlevel is above 100lux the lights are turned on when the door is open and there is movement.
When the door is closed the lights won’t go on. What am I missing?
Inputs:
itsdark Licht Woonkamer brightness reach 100
dooropened Deur Woonkamer armed is tripped
movement Pir Woonkamer armed is tripped
nomovement Pir Woonkamer armed is not tripped
doorclosed Deur Woonkamer armed is not tripped
itslight Licht Woonkamer brightness reach 100
Conditions:
lighton itsdark and dooropened and movement
lightoff itslight or (doorclosed or nomovement)
Action: (this starts/stops the lights)
lighton 5
lightoff 5
lighton 5
I even wonder whe I can find the right expression formats
Looks like the same input for ItsDark and ItsLight.
I am not sure what your Triggers are for this device relative to light level.
You might want to change the triggers to a Device Property i.e. a variable called LightLevel.
You can also get rid of a couple other inputs. In your scenario there is no value to having inputs with the opposite state.
Then your logic:
LightOn (LightLevel < 100) and dooropened and movement
LightOff Not LightON
You have to know that I have my Vera lite since 2 weeks, and there is a lot to learn for me. 
I am using a Aeon Labs 4in1 Multi-sensor to get the LightLevel
I gues i’m thinking to difficult, making inputs with the opposite state.
I have deleted them for now.
So, I can asume that I only have to set a value true, otherwise it will always be false
For now have changed the PLEG to this:
Inputs:
Triggers:
dooropened Description: Door Livingroom armed is tripped
movement Description: Pir Livingroom armed is tripped
Device Properties:
Name Device Name Device Variable Current Value
LightLevel1 Lightlevel livingroom CurrentLevel 2
Conditions:
lightOn (LightLevel1< 100) and dooropened and movement
lightOff Not LightOn
Actions:
lightOn 5
lightOff 5
For the Conditions:
lightOn (LightLevel1< 100) and dooropened and movement
I want the lights only to be ON when there is movement or the door is opened (only when the lightlevel is <100lux.)
As far I understand the argument ‘and’, this means that the door must be open end there must be movement.
Can I change ‘and’ into ‘or’ ?
Like this:
lightOn (LightLevel1< 100) and dooropened or movement
Yep,
But I would use parenthesis to group evaluation properly:
(LightLevel1< 100) and (dooropened or movement)
Oke!
Thanks for the advice!
;D
I will let you know tommorow if it works
I think this is very similar to a problem i have, trying to create day or night by creating a trigger with light level below or above 100. I could not get that to work either. The suggestion with creating the lightlevel in device properties sounds very good. I tried, only problem is when i click on device properties (in the input section), nothing happens. Somehow i cannot get to it. I can select my aeon multi sensor (light) in triggers, but thats not what i want. I can open schedules, but not device properties
If you continue to have a problem … PM me … We can do a Goto Meeting and share desktops …
I can help you sort through the problems.
Which time zone are you in ? I am on London time, i could pm you about 19:00 gmt ?
I have got the device options, it is working now. But i dont know what to do with it. At the moment just for testing purposes, I am trying to switch a virtual switch on if lightlevel is below 2000 (so that the virtual switch should definetely be on if it works), but it does not do anything. I guess there is something wrong or missing
Assuming your action is correct - which I can’t see - it should do something. Remember, though, that the condition and associated action will only fire when the state changes. This often means that a new PLEG will only work correctly after the inputs have been through a complete cycle. In your case, shining light onto the sensor and then covering it should make things happen.
If it still doesn’t work, post the PLEG Report.
ok that might explain it, i just programmed it, so it has not changed state. will wait until dusk, then it might switch. thanks
mikee123,
after reinstalling de 4in1 sensor, I wanted to reset PLEG.
Now I have the same problem:
I can’t use the Device properties TAB.
How did you solve that?
I am not sure which action actually solved the problem. I deleted the pleg, then i reloaded the page, then i could reinstall another pleg device, i reloaded the page again, and it all worked. I think first of all reload the page, see if that solves the problem. If it doesnt, reload the browser page
I thought i had cracked it, only for me to walk up to the house tonight, in the dark, motion sensor triggers (i can see the red light come on), but lights staying off… i have attached the pleg report
Light level as reported by the 4 in 1 sensor was 2, so well below the 80 i have specified
Reloading the page or browser wasn’t working.
Reinstalling the PLEG App did.
I can access the device ‘properties tab’ ;D
I am sure that PLEG will handle this situation properly.
I am not sure your 4in1 sensor will behave as you might expect.
Many of the battery powered sensors do not report motion events if they happen
quick enough.
Do you see the changes on the Dashboard status for the Light Level and Motion.
If the Dashboard changes than PLEG should also respond.
If the dashboard changes and PLEG does NOT than please do the following:
1: Turn on Debug in the Advanced Tab … set Debug to 1 then Save
Start capturing your log file:
http://YourVeraIPAddress/cgi-bin/cmh/log.sh?Device=LuaUPnP
Than walk around where the Dashboard triggers and PLEG does NOT.
Send me the log file.
I have created a combination switch, with the same settings, and that triggers. The motion sensor goes red also. Will try to capture the log now and be back heer in a few mins
@mikee123
I have one of these beasts and, while it is by no means perfect, it does detect motion and I do use it with a PLTS. Check the following Multisensor configuration settings (In the Motion Detector device, Device Options tab): Variable 4 = 1, Variable 5 = 2. With these settings I get instant PLTS trigger when motion is detected.
I don’t use the light sensor in my logic. I use the DayorNight plugin. I also set the motion timeout (Variable 3) to ten seconds and use the PLTS to control how long my lights stay on. It is a lot easier to change the timer in PLTS than it is trying to change the timeout on a battery-operated device that doesn’t wake up very often.
Also make sure that the PLEG is armed … other wise it will not fire the actions.
I cannot post it here, its too long. How do i get that log to you best ?