Don’t you hate it when the kids leave the light on in the bathroom? You could create a simple timer to turn them off after a certain time. Do you want tighter control or scared the light will go off with a guest still in the bathroom? Add a motion detector and your worries are over…read on to find out how.
We need to creater a variable first. This will allow us to turn the light off with the switch, and not have it turn back on as you leave the room due to the motion sensor detecting you leave. So go to agents in composer and then select variables and then select “new”. In my example I call it “guest bathroom” and make it a boolean variable.
Now lets show you how to turn on the light with the motion sensor. In Composer go to the motion sensor on the left, in my case “guest bathroom motion sensor”. Underneath that select “When motion sensor senses motion”. On the right side go to the variable we just created and below that select the conditional tab and select if guest bathroom variable “is true” and drag it to the middle. Now on the right top side select the light you want to control, then below that select “on” and drag it to the middle and put the arrow onto the ? of the if statement already there. This will cause it to indent under the if statement.
Next you need to create a timer by going to agents at the bottom left then select timer at the top left. In the middle left select new and a box will pop up. I’ll call it “guest bathroom timer”. Then select your new timer in the middle left, and now in the middle choose a time allotment. In this example I’ll use 5 minutes.
We now go back to the motion sensor on the left of composer and select “when sensor senses motion” again. On the right top side go to timers. Under that select the timer we just created. Then select “stop timer” Now drag this to the middle and indent it also under the if statement currently there. Now we have two commands that both occur each time motion is sensed if the guest bathroom variable is true.
Stay on the motion sensor on the top left, but now select “When sensor stops sensing motion”. Then on the right side select timers on the top right. On the bottom right select the drop down box and pick the timer we created, mine was guest bathroom timer, then select “reset timer”. Drag this to the center.
Next you need to select your timer under programming on the left side of composer. Under that select “when timer expires”. On the right side of composer choose the light you want to control and then below that select “off” and drag it to the middle.
Time for the last step. This will keep the motion sensor from turning the light right back on after someone turns it off by hitting the bottom button of the dimmer/switch. On the left side of composer go to the switch/dimmer we are controlling with the motion sensor. Below that select “bottom button pushed”. Then on the right side go to the variable we created at the beginning and select “set to false” and drag that to the middle. Now on the right side go to programming control and put in a delay of 5 seconds and drag that to the middle. Go back to the variable on the right and select “set to true” and drag it to the middle also.
Now you are all set. Your light will come on when someone enters the room, and will stay on for only 5 minutes once someone leaves in the example I gave.
Hope you enjoyed
pharmdsmith
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.













April 4, 2010