Just recently started playing with PLEG and trying to apply to a specific scenario. I have a Vera Edge.
I have outdoor GoControl ZWave floods and a basic scene that turns the floods on at sunset and turns them off in +3 hours. This simple scene is (as one might expect) fine.
I recently added an Aeotec Trisensor, to be used primarily for detecting motion.
I wanted the following scenario:
From sunset until +3 hours, have the floods on regardless of motion
After +3 hours until sunrise, turn the floods on when motion is detected; turn off floods after 5 min
To test out floodlight control with a motion trigger, I used PLEG to set up a trigger, and then a condition on that motion trigger. Finally a Logic Action to toggle the state of the floodlights with an interval delay of 2 min (just for testing purposes; in normal operation the interval would be 5 min).
When armed, the motion detector turns on the floods as expected, but the lights do not turn off after the interval prescribed. After a few more minutes, triggering the motion sensor causes the lights to be turned off (presumably because the light state is toggled).
Question: Is there anything I ought to be doing differently to ensure that the lights duly turn off as expected?
Question: Since the trisensor also includes a light sensor, would it make sense to extend the condition to include an AND test to check the light level - i.e., if motion is detected AND the light level is less than 10 lux, for example?
Many thanks for your guidance. Greatly appreciated.
I agree, a status report. Are you looking when the sensor no longer detects motion? If the sensor sends that signal after 5 minutes, then a simple condition to turn off the lights when motion stops should work. Otherwise you may have to use a timer for the 5 minutes interval. But the status report will tell us a lot about what you trying to do.
In installed the Day or Night plugin, but I can’t see a device when I try to create a trigger. I restarted my controller just to be sure. The device created shows up in the list of devices, but not seeing it when trying to create a trigger.
And that is how you gain experience with PLEG and then you can build upon that experience to make your automation grow. Glad to see you playing and learning.
There are a couple of ways to do the deck lights only at night. The easiest without the Day/Night plugin (which I do not use), is to create a schedule. The schedule can be true if after sunset and before sunrise (which would be Night), and you add that schedule to your condition with an AND operator.
And the schedule can be fine tuned - after sunset but not after 11 pm.
Or after sunset and after 11 pm, turn on lights at 50%. All kinds of options.
in PLEG debugging, it sometimes helps to convert triggers into conditions.
Then you can see in the Status Report if the triggers are evaluating correctly.
Not saying this is the problem but it’s another way to debug.