I’ve been tinkering with the Vera 3 (UI 1.5.622) and trying to schedule lights triggered by a motion sensor. The motion sensor is the Aeon Labs Aeotec Z-Wave Multi-Sensor (firmware 1.18)
What I’m trying to do:
If exterior motion sensor is tripped after sunset, then turn on outdoor lights.
At sunrise do not turn on the outdoor lights until sunset.
What I’ve done:
Checked my location settings and my town and latitude and longitude are correctly entered into Vera.
I created a scene to arm the sensor at sunset, another scene to turn on the lights when triggered by the sensor and a 3 minute delay to turn them off, and a third scene to bypass the sensor at sunrise. The result was that the light is triggered by the sensor and turns off after 3 minutes but the sunrise/sunset schedule is totally ignored, so the lights turn on whenever the sensor is tripped night and day. So I removed the two scenes that arm and bypass the sensor and modified the scene to turn on the lights when the sensor is tripped to include a schedule for a fixed time of day at 8:30PM, same 3 minute delay. I tested the the sensor at 8PM and the lights came on ??? I expected nothing to happen since the scene is not supposed to be active until 8:30PM so obviously I’m doing something wrong or something is going on with the Vera.
Any help to figure this out is appreciated.
another scene to turn on the lights when triggered by the sensor
You need to trigger for armed and tripped … that’s different then just tripped.
For other ways to automate your home see:
http://forum.micasaverde.com/index.php/topic,18679.0.html
or look into PLEG.
PLEG is a great tool and you will wind up using it for the next tricky scene you want to do.
But, for the scene you have described, you made it much more complicated than it needed to be and PLEG isn’t a requirement, yet. It probably will be when you decide to add another condition to the scene.
Instead of arm and disarm scenes, try this:
Leave the motion sensor armed, there’s no need to change that, at least for this scene.
Create a single scene that turns the light on when the motion sensor is tripped and off after a 3 minute delay.
Add the following line to the LUA page of the scene. It will cause the scene to run only after sunset and before sunrise.
return luup.is_night() == true
Z-Waver, thank you. The code worked perfectly. I still dont understand why such a simple scene should require a separate line of code.
Vera’s GUI scene logic only supports OR conditions e.g. if motion OR schedule then light. But Vera does not support AND conditions e.g. if motion AND schedule then light. That bit of code must be true for the scene to run, regardless of other conditions in the scene, essentially giving an AND condition.
The ability to easily perform AND conditions is just the first of many features that makes the PLEG plugin such powerful tool for Vera. It is a requirement for anything but the most basic Vera configuration, unless you are a LUA programmer. If you think of Vera as a Swiss Army knife, PLEG opens all of the blades.