So, this is a followup post, and sort of extension to one I did earlier titled “How Do I…Use a timer to close my garage doors?”. The original article can be found here.

The first thing we will cover is having the LED’s indicate whether or not the garage door will automatically close. The last write-up we outlined how to have the garage door close on a timer, but what about those times when you want to leave it open? Well, that’s exactly what this is for. What I did at my house is set it up so that when the garage door is going to close once the timer expires, the LED turns green. When the garage door isn’t go to close on it’s own, the LED is red. This way as I am working in the garage I can tell at a glance whether or not I am soon going to have the garage door start closing.

Okay, so let’s get to it. First of all, I am going go assume that you have gone through the last write-up and that you have all that working well. If you haven’t done that yet, please do so. You can find the original write-up here. Let’s move down to the programming tab in Composer HE, and in the Device Events pane (top left) scroll all the way down to timers. Make sure you have the appropriate timer selected from the drop down menu, then select the button “when the xxx timer has been started”. Now move over to the Device Actions pane (top right) and select the switch/dimmer that you want to use the LED as an indicator on (NOTE: If you have 3+ way lighting in your garage like I do, and the dimmer is bound to the keypads, you only need to set the LED on the dimmer and the keypad will follow). Down in the bottom right select the appropriate buttons and colors…this should be self explanatory. I have my top LED set to green when on, and my bottom LED set to green when off.

Now, when the timer starts the LED’s will turn green. Perfect. Now, we need to setup a way to stop the timers and keep the garage door open. This is nice for when you’re working in the yard, etc… What I did was elected to create a “press and hold” action, where if I pressed either of the buttons on the dimmer and held them down for two seconds, the timer would stop and the LED would turn red to indicate that (Now, my press and hold write-up got deleted during the whole debacle with the old site, and I haven’t had a chance to redo it yet. I am going to assume here that you know how to do a press and hold). For this part, I am going to post a screen shot of the programming involved, hopefully it will be somewhat self explanatory.



(Note that the second line in the second screenshot doesn’t pertain to this function)

If you are unfamiliar with how to implement and press & hold, this may fly over your head. I plan on doing that write-up again, hopefully I can do it this week. Essentially what you need to do to make all that happen is create a new boolean variable. Then under programming you set it so that the button you’re going to be pressing and holding (in my case I set this for both the top and bottom button, depending on whether or not you want the light to turn on or off…it is a dimmer after all) toggles the variable to true when pressed, and false when released (second screenshot, first line). When the button is pressed, toggle the variable, then put in a delay for how long you want to be required to hold the button down for. As you can see, I did two seconds. After that two seconds check the variable again and if it is true, that means you’re still holding down the button (had you let the button go, the variable would be false). After that you execute the changing of the LED, and the stopping of the timer. Hopefully that all makes sense. If not, let me know in the comments.

The last thing we need to do to finish off this part of the project is reset the color of the LED’s when the garage closes. When the garage is closed the timer stops, and there is no need for an indicator LED anymore. This is done in the same area where you stopped the timer in the original writeup. When you’re programming is done it should look like this:

You’ll notice I have an extra conditional statment in there. That is because I have more than one garage door, and if one of the other garage doors are open, the timer for that door is either running or not, and I wanted the LED indicator to continue to indicate what was going to happen with that door.

Congratulations! Now you’ve not only got your garage doors closing after a pre-determined period of time so that don’t inadvertantly get left open, but you’ve got an override option if you want them to stay open and you have an LED to indicate whether the override has been activated or not. If you have any questions or any part of this isn’t very clear, please don’t be shy. Let me know in the comments, or in the discussion thread at c4forums (found here).

Share