so I ended up using the program logic event generator application which is available on the
me casa verde App Store you create an instance of that application to do a specific task so to use
the program logic event generator you first set up some inputs and that's where you define what
events and parameters you're interested in so I have some triggers here that do things like
detect motion or no motion they detect daytime or nighttime and then they also detect whether lights
have been turned on and off either manually or automatically and then next some device properties
this is where I pick up the humidity sensor the light level and temperature I'm currently only
using the light level and then next you define some conditions and this is B logic that you
want to use to control the various devices in this case I'm only have the lights working so with the
unit I wanted to get the automated fan the logic was that the Theia fell ceiling light came on
with any motion and the four wat night light was on all night I wanted to improve on that so that
that ceiling light only came on in the daytime and when it was not sufficiently bright enough to see
without it and I wanted the night light which was swapped for the half watt LED to only come on at
night with motion so I have conditions to define if it's dim and then separate logic for day and
night when motion is detected then there's logic to turn off lights after no motion is detected
for some period of time I have that set for five minutes if it was automatically triggered and 15
minutes if the light were non manually so this is based upon the code example that I found in
the v-ray user forum but I've adapted it to my needs and I can fine-tune the times and levels
as needed so there's much more flexibility here than the automated fan I wanted to buy currently
I don't have the exhaust fan hooked up or any of that logic in place but i'll add that here
and then finally the way everything works this is your logic then you have actions set up such that
when a condition is met then an action happens and there's not a lot here for instance auto on
light one when that condition is met and i'll just turn on the control you can see it turns on the
bathroom nightlight so this program logic event generator as the name implies is all event-driven
so all of these actions and conditions only run when a trigger or input comes in you get the input
comes in runs through these conditions and if a condition expression is met that cuts off one of
these actions and then everything just sits and waits for something else to happen like no motion
is detected so after a certain time delay with no motion and the light is turned off like down here
if the light was automatically turned on and then you had first motion and then no motion meaning
it was triggered by motion and it's been no motion for more than five minutes turn the light off and
then for manual control i added a four-way z-wave wall switch this is the wireless switch or key pad
controller that I used in this project in the next video I'll show you how it's integrated into the
system to provide manual control over the ceiling lights and fan so stay tuned for that video